Skip to content
AgenticAIWiki
  1. Learn
  2. Part 11. Context engineering and reliability
  3. Chapter 62

Long documents and large codebases

3 lessons · 13 min

A subagent explores a big repo

Full screen
Monorepo: 3,000 files, millions of tokensMain agentcontext: 15kCLAUDE.mdmap of the repoGrep / Globcharge, PaymentIntentsrc/payments/6 files matchsrc/webhooks/2 files match2,990 other filesnever opened

Swipe to change step

Step 1 of 8. The main agent must work out how payments flow through a 3,000-file monorepo. Reading it all would overflow any context window many times over. Main agent (context: 15k), highlighted. CLAUDE.md (map of the repo). Grep / Glob (charge, PaymentIntent). src/payments/ (6 files match). src/webhooks/ (2 files match). 2,990 other files (never opened).

In this chapter

  1. 62.1Long documents: chunk, summarize, cite5 min read
  2. 62.2Exploring large codebases without overflowing context4 min read
  3. 62.3Multi-turn state that lasts4 min read

Chapter check

Already know this? Score 80% or more and you can skip ahead. Each attempt draws 4 questions from 12.

Loading check…