# "agent folder is making claude code 10x better" <!-- ref: @content/youtube/ai-jason/2025-10-06-agent-folder-is-making-claude-code-10x-better triggers: [agent struggles with context, bloated documentation, inefficient research process, repeated task rediscovery] trigger_prompt: When the agent is overwhelmed by context or when documentation is cluttered, leading to inefficiencies in task execution. version: 4 updated_at: 2026-10-31T20:20:52.603Z --> Claude Code (AI Jason, 2025-10-06): Agent effectiveness is bottlenecked by context, not capability — Claude Code's 200K token window gets crowded by bloated CLAUDE.md files, unused MCPs, and repeated research. AI Jason walks through his context-engineering workflow for Claude Code, centered on a self-maintained `.agent/` documentation folder, with a nod to Simon (AI Builder Club) on inline-to-class doc generation. ## Core Thesis Agent effectiveness is bottlenecked by context, not capability — Claude Code's 200K token window gets crowded by bloated CLAUDE.md files, unused MCPs, and repeated research. The fix is deliberate context engineering: offload research to sub-agents, compact proactively, and — most importantly — build a structured `.agent/` folder where the agent itself maintains PRDs, architecture notes, and SOPs so every new task starts from a curated knowledge base instead of rediscovering the codebase from scratch. ## Key Insights - Run `/context` to see exactly where tokens go (system prompt, tools, MCPs, memory, messages); only MCPs, custom agents, and CLAUDE.md are actually tunable. - Sub-agents are the highest-leverage move: research burns most tokens, and delegating it to an isolated thread returns only a summary to the main conversation. - Pre-built, summarized documentation beats hoping the agent discovers the right files — it guarantees relevant context arrives cheaply. - The `.agent/` folder has four parts: `task/` (plan-mode outputs/PRDs), `system/` (architecture, DB schema, APIs), `SOPs/` (playbooks captured after friction), and a `README.md` index telling the agent when to read what. - SOPs are generated *after* the agent fails or gets corrected — turning one-time friction into reusable one-shot playbooks (e.g., "integrate a new Replicate model"). - Cross-linking docs via a "related documentations" section turns the folder into a navigable knowledge graph that scales with the codebase. - Claude Code is increasingly used for non-coding tasks (email, productivity, journaling) — a signal for where agentic products can expand. ## Actionable Takeaways 1. Audit tokens with `/context`; remove unused MCPs and custom agents; keep CLAUDE.md lean. 2. Before big features, explicitly prompt: *"Let's use task or sub-agent to do the research first."* 3. Use `/compact` proactively between isolated task blocks — don't wait for the ceiling. 4. Create an `/update-doc` slash command with rules for initializing, updating, and adding new docs. 5. Run `/update-doc initialize` on any project to auto-generate the `.agent/` folder, architecture doc, and README index. 6. New-feature loop: plan mode (with *"read .agent doc first for context"*) → save plan to `.agent/task/` → implement → run `/update-doc` to capture an SOP if there was friction. 7. Clear the conversation between features — let the docs carry the context, not chat history. 8. Apply the pattern retroactively: generate architecture, DB schema, and API docs for existing codebases. 9. Borrow Simon's two-pass workflow: improve inline documentation of a class first, then generate class-level docs from the improved source. ## Notable Quotes > "Context engineering basically means how you can optimize what goes into conversation history thread." > "The majority of the actions agent take here is actually not about making [changes] but doing the research to figure out the plan for the implementation." > "Before we plan any implementation, always raise the readme first to get the full context." > "Quite often in my experience, model will fail to integrate replicated model out of the box — and that's where we can use this update doc command." > "You can have higher confidence that I can just come in any time and start implementing something with pretty consistent performance." --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*