# agent folder is making claude code 10x better
<!--
ref: @content/youtube/ai-jason/agent-folder-is-making-claude-code-10x-better
tags: [context-engineering, claude-code, documentation-systems, sub-agents, coding-agents, SOPs]
version: 2
updated_at: 2026-11-22T04:18:15.509Z
-->

**[Watch on YouTube](https://www.youtube.com/watch?v=MW3t6jP9AOs)**


*Synthesized from ai-jason, 2025-10-06; the presenter is not named in the source.*

A solo presenter explains how to keep Claude Code effective on large codebases through context engineering and a `.agent` documentation folder. A short clip features Simon of AI Builder Club describing his team's documentation system for their Lexi codebase.

## Core Thesis
The presenter argues that Claude Code degrades on complex codebases because the conversation thread fills with noise, and that the fix is context engineering: controlling what enters the context window. Besides trimming MCPs and using sub-agents, the presenter's main method is a maintained `.agent` folder of summarized docs (tasks, system, SOPs, README). The agent reads these instead of re-researching the whole codebase each time.

## Key Insights
- Claude Code's default context limit is 200,000 tokens. Running `/context` shows token use by category: system prompt, system tools, MCP tools, custom agents, memory files (CLAUDE.md) and messages.
- The system prompt and built-in tools can't be changed. The parts you can optimize are unused MCP tools, unused custom agents, an oversized CLAUDE.md and the message history. In the presenter's example, removing the unused MCPs freed about 2% more of the window.
- Most of an agent's work on a request like "add Google Auth" is research to build an implementation plan, not code changes. That research eats a lot of context.
- Sub-agents isolate this cost. They research in their own conversation thread and return only a summary to the main thread.
- A simple trigger is to add a short instruction before a big feature, such as "use a task/sub-agent to do the research first."
- The presenter runs `/compact` proactively after finishing a fairly isolated chunk of work, rather than waiting for the window to fill.
- A documentation system gives the agent a summarized snapshot of the codebase. This reduces noise and ensures the relevant information is fed in, instead of hoping the agent assembles it by searching.
- The `.agent` folder has four parts:
  - **Task**: PRDs and implementation plans. The presenter always uses plan mode before a feature, then saves the plan here so similar future work can reference it.
  - **System**: project structure, database schema, APIs and critical or complex code areas that span multiple PRDs. This part grows the most.
  - **SOPs**: standard procedures and records of mistakes the agent made. Examples run from generic ("add a new database table") to specific ("integrate a new Replicate model").
  - **README**: an index of all docs and when to read each.
- A custom `/update doc` command holds the instructions for initializing the structure and for updating it. It is run after implementing a feature or after correcting an agent mistake, so the mistake becomes an SOP.
- Each SOP includes step-by-step instructions and a "related documentations" section that acts as a directory to other docs. SOPs are also added to the README.
- Simon's team (in the clip) keeps a pointer doc that links to how they do migrations, data storage, helpers, updaters and utilities. It is human-readable but designed for LLMs. The first versions were generated with Claude, then maintained in Cursor. Their workflow is to review a class and upgrade its inline documentation first, then generate the more detailed class documentation from it.
- Demo result: the presenter built a text-to-image app on a Replicate model and had the agent write a "replicate model integration" SOP. After clearing the conversation, the presenter asked for text-to-video, told the agent to read the `.agent` docs first, and used plan mode. The agent one-shotted a fully functional implementation with no errors.
- The presenter notes a trend of people using Claude Code for non-coding work (emails, productivity apps, journaling, task automation), which suggests a large market for agent products.

## Actionable Takeaways
1. Run `/context` in Claude Code to see token use by category. Remove MCP tools and custom agents you don't use, and trim CLAUDE.md if it's crowding out message space.
2. Before large features, tell the agent to use a task or sub-agent for research, so the research tokens stay out of the main thread.
3. Run `/compact` after finishing a self-contained task.
4. Create a `.agent` folder with `task/`, `system/`, `SOPs/` and a `README.md` index.
5. Add a docs section to CLAUDE.md. It should explain the doc structure and set two rules: update the `.agent` docs after implementing features, and read the README first before planning any implementation.
6. Create `.claude/commands/update-doc.md`. It should describe the doc structure, what to do on initialization, what to do on updates, and the rules for creating new doc files.
7. For a new project, run `/update doc initialize`. It scans the project and creates the `.agent` folder with a project architecture doc and a README. For an existing codebase, have it generate system docs such as project architecture, database schema and API endpoints.
8. For each feature, use plan mode, then save the plan to `.agent/task` before implementing.
9. After you correct the agent or it finishes a repeatable process, run `/update doc` to generate an SOP, for example "generate SOP integrating replicate model."
10. In a fresh conversation, tell the agent to read the `.agent` docs first, then plan the next feature.

## Notable Quotes
> "Context engineering basically means how you can optimize what goes into conversation history thread so that only relevant and necessary information are included." — the presenter (unnamed)

> "You can have higher confidence that I can just come in any time and start implementing something with pretty consistent performance." — the presenter (unnamed)

---

*Related: `@content/web/github/2026-11-27-resume-command-osc-7577-issue-112408` · `@content/web/huggingface/2026-11-26-real2simlab-unified-platform` · `@content/web/github/2026-11-26-opus-context-fills-faster-issue-112194` · `@content/web/github/2026-11-26-interactive-session-misclassified-background-issue-112133` · `@content/web/github/2026-11-26-autodream-silently-ignored-issue-112310`*

---

*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).*