1. Repository access
A model that cannot see the code can only guess. What does it need first?2. Editing & execution
Our agent can search and read repository files, but it can only suggest a fix. What capabilities does it need to apply the change and check whether it works? Tool design deep dive: Essential tools — Which capabilities does a coding agent need, and how do real agents build them? Read this after editing & execution, then resume the numbered walkthrough. Tool design deep dive: Edit & run tools in detail — How should the edit and command tools behave, and how should the agent read their results?3. Context rot
The loop works. What breaks after 50 tool calls?4. Seven state stores
Where does everything outside the context live, and how is the context rebuilt from it?5. Why not one blob
Why not just keep one JSON blob per session instead of seven stores?6. Token levers
Our agent is consuming too many tokens. How would you reduce it?7. Enforce with a hook
Why not just tell the agent in the system prompt to use the cheaper model?8. Conditional planning
What if the agent forgets what remains — or plans everything?9. Subagent isolation
Why not let the main agent investigate everything?10. The delegation gate
Should every independent task become a subagent?11. Write conflicts
Say it happens anyway — two subagents both need to write to the same file. Then what?12. When to delegate
Two tasks. Why does only one deserve subagents?13. Recap
Ten decisions, two kinds of pressure.14. The architecture
What architecture did those failures force us to build?Advanced
Reading large files
If a file contains 20,000 lines, doesread_file send all of them to the model?