Перейти к содержимому

Claude Code Context Window: Why It Forgets

AI Coding Mastery

0:00 / 0:00

Claude Code Context Window: Why It Forgets

17 просмотров · 2 недели назад
AI Coding Mastery
1 подписчик
17 просмотров · 2 недели назад
Coding agents now have about a million tokens of context, yet Anthropic's own Claude Code docs warn that detailed instructions from early in a conversation may be lost. This video draws what actually fills an agent's context window, why a fuller window makes a worse agent (Lost in the Middle, context rot), and 5 moves coding agents use to keep it useful: load less, fetch just in time, clear and compact, write it down, and hand work to subagents, with examples from Claude Code, Codex, Cursor and Aider. Product details as documented on 5 October 2026. Sources • Anthropic — Effective context engineering for AI agents (Sep 2025): https://www.anthropic.com/engineering... • Claude Code docs — How Claude Code works: https://code.claude.com/docs/en/how-c... • Claude Code docs — Memory (CLAUDE.md): https://code.claude.com/docs/en/memory • Claude Code docs — Model configuration (auto-compact): https://code.claude.com/docs/en/model... • Claude Code docs — Subagents: https://code.claude.com/docs/en/sub-a... • Claude Code docs — Commands (/context, /clear, /compact): https://code.claude.com/docs/en/commands • Anthropic — Models overview: https://platform.claude.com/docs/en/a... • Liu et al. — Lost in the Middle (TACL 2024): https://aclanthology.org/2024.tacl-1.9/ • Chroma — Context Rot (Jul 2025): https://research.trychroma.com/contex... • Anthropic — Agent Skills (Oct 2025): https://www.anthropic.com/engineering... • Anthropic — Code execution with MCP (Nov 2025): https://www.anthropic.com/engineering... • Anthropic — Advanced tool use (Nov 2025): https://www.anthropic.com/engineering... • Anthropic — Managing context on the Claude Developer Platform (Sep 2025): https://www.anthropic.com/news/contex... • Anthropic — Effective harnesses for long-running agents (Nov 2025): https://www.anthropic.com/engineering... • OpenAI Codex docs — AGENTS.md: https://developers.openai.com/codex/g... • OpenAI Codex — Configuration reference: https://developers.openai.com/codex/c... • Aider docs — Repository map: https://aider.chat/docs/repomap.html • Cursor — Improving agent with semantic search (Nov 2025): https://cursor.com/blog/semsearch • Cursor docs — Search: https://cursor.com/docs/agent/tools/s... • Latent Space podcast — Claude Code, with Boris Cherny and Cat Wu (May 2025): https://www.latent.space/p/claude-code Chapters 0:00 1M tokens, and it still forgets 0:31 What fills the window 1:17 Context rot 2:22 Move 1: Load less 3:06 Move 2: Fetch just in time 3:45 The catch 4:00 Move 3: Clear and compact 4:39 Move 4: Write it down 5:07 Move 5: Subagents 5:38 Verdict: a budget, not a hard drive Previous video, on why the order of your context changes your bill:    • Why prompt caching can cost you more   Credits: narration is an AI voice (Google Gemini text-to-speech, voice "Charon") reading a script written for this channel; animation built with HyperFrames (open source, HeyGen); sound effects synthesised for this video; documentation, paper and podcast screenshots quoted briefly for commentary, sources above. What's in your agent's context window right now that it doesn't need? #ClaudeCode #AIAgents #ContextEngineering