Patterns and best practices for organizing large AGENTS.md files using nested structure and modular references. Use when AGENTS.md is too large, needs reorganization, context window optimization, or splitting into modular files. Applies to monorepos, multi-component projects, and files over 500 lines.
Automatically reorganizes large AGENTS.md files into nested, modular structures to optimize context window usage. Triggers when files exceed 500 lines or need reorganization, enabling efficient loading of relevant context for monorepos and multi-component projects.
/plugin marketplace add L-Sypniewski/claude-code-toolkit/plugin install documentation-templates@claude-code-toolkitThis skill inherits all available tools. When active, it can use any tool Claude has access to.
examples/organization-examples.mdguides/migration-strategy.mdpatterns/organization-patterns.mdtemplates/organized-root-agents-md.mdPatterns and best practices for organizing large AGENTS.md files to save context window space and improve maintainability.
Large AGENTS.md files can:
AGENTS.md supports nested structure and file references, allowing you to:
For detailed organization patterns, see patterns/organization-patterns.md.
AI agents (Claude Code, GitHub Copilot, Cursor) automatically:
This ensures agents have:
| State | What Loads | Benefit |
|---|---|---|
| Before (single file) | Entire file every time | All content competes for context |
| After (organized) | Root + relevant nested files | Only relevant context loaded |
For migration steps, see guides/migration-strategy.md.
For real-world examples, see examples/organization-examples.md.
For a root AGENTS.md template, see templates/organized-root-agents-md.md.