Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/agent-context-loader

@820dfc8
Run it yourself

Execute proactive auto-loading: automatically detects and loads agents.md files. Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/agent-context-loader

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈49 tokens for metadata: the name and description. ≈957 when used: this file. ≈2.8k more on demand in 5 files.

Description uses 2.5% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈196 characters, or 2.5%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Agent Context Loader

Overview

Automatic discovery and loading of AGENTS.md files across project hierarchies for AI coding agents. This skill scans the current workspace and its parent directories to locate agent instruction files, then surfaces their contents so the active agent session has full operational context.

Prerequisites

  • A project workspace containing one or more AGENTS.md files at any directory depth
  • Read and Glob permissions to traverse the directory tree
  • Grep access for searching file contents when multiple candidates exist

Instructions

  1. Scan the current working directory and all ancestor directories (up to the filesystem root or repository root) for files named AGENTS.md or agents.md.
  2. Search subdirectories of the current workspace for additional AGENTS.md files that may apply to sub-projects or modules.
  3. Determine load order: files closer to the repository root load first (global context), files in deeper directories load later (override or supplement).
  4. Read each discovered AGENTS.md file and extract its instruction blocks, workflow definitions, and constraint declarations.
  5. Merge instructions into a unified context, noting any conflicts between levels (e.g., a subdirectory agent overriding a root-level rule).
  6. Present the loaded context as a structured summary: source file path, instruction count, and any detected conflicts.
  7. Cache the discovery results for the current session to avoid redundant filesystem scans on subsequent activations.

Output

  • Ordered list of discovered AGENTS.md file paths with their directory depth
  • Merged instruction set combining all discovered agent contexts
  • Conflict report highlighting any contradictory directives between levels
  • Session cache status indicating whether results are fresh or reused

Error Handling

Error Cause Solution
No AGENTS.md found Workspace has no agent instruction files Confirm the correct working directory; create an AGENTS.md at the project root if needed
Permission denied on directory traversal Restricted parent directories above the workspace Limit scan depth to the repository root (detected via .git/ presence)
Circular symlink detected Symlinked directories create an infinite traversal loop Skip symlinked directories during the scan; log a warning with the symlink path
Conflicting instructions across levels A subdirectory AGENTS.md contradicts the root-level file Flag the conflict in the output; apply the more specific (deeper) instruction by default
File encoding error AGENTS.md uses a non-UTF-8 encoding Attempt latin-1 fallback; report the file path and encoding issue

Examples

Example 1: Monorepo with per-package agent instructions

  • Structure: Root AGENTS.md sets global conventions; packages/api/AGENTS.md adds API-specific tooling rules.
  • Result: Both files loaded in order. The API-specific rules supplement the global context without conflict.

Example 2: Nested workspace with conflicting commit policies

  • Structure: Root AGENTS.md says "always sign commits"; services/legacy/AGENTS.md says "skip commit signing."
  • Result: Conflict detected and reported. The deeper (legacy) directive is applied with a warning noting the override.

Example 3: First-time setup with no agent files

  • Structure: A freshly cloned repository with no AGENTS.md anywhere.
  • Result: Scan completes with zero files found. Output includes a suggestion to create AGENTS.md at the repository root with a minimal template.

Resources

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts12d3 checks · Risk SAFE
  • Gen Agent Trust Hub12d

    This skill automatically discovers and loads project-specific instructions from AGENTS.md files. While intended for context loading, this creates an indirect prompt injection surface where the agent might follow malicious instructions found in untrusted project files.

  • Socket12d

    No alerts

  • Snyk12d

    Risk: LOW · No issues

Signed by skilld at 820dfc8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
What it can do
Reads files Edits files Runs commands
version
1.24.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
[
  "productivity",
  "agent-context"
]
All 7 allowed tools
ReadWriteEditGrepGlobBash(general:*)Bash(util:*)
Other metadata
compatibility
Designed for Claude Code

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/agent-context-loader