← 所有文章
claudeClaudeGitHub

I Threw an Entire Codebase at Claude's 1M Context Window. Here's What It Actually Did Well (and Where It Choked).

OctoDock is about 47k lines of TypeScript across maybe 200 files. Last weekend I asked Claude Opus 4.6 to do something I'd been putting off: rename a core abstraction (Adapter to AppAdapter) everywhere it appeared, including all the places where it leaked into log messages, error strings, type names, and test fixtures.
I didn't run a script. I dumped the entire repo into one Claude conversation — about 800k tokens of source — and asked it to do the rename, surface anything ambiguous, and explain its reasoning for the edge cases.
It mostly worked. Here's where it shone and where it tripped.

Three things to walk away with

The setup

I used claude CLI (Claude Code) with the --model claude-opus-4-6 flag. Pasted in the entire repo via the Read tool in a single session. Total tokens used in the initial context: roughly 820k. That left me about 180k of headroom for the conversation itself.
The official 1M context window for Opus 4.6 and Sonnet 4.6 is generally available at standard pricing per Anthropic's API release notes. No beta header. No special endpoint. Same SDK call as 200k requests, just bigger.

What it nailed

The straight rename was perfect across all 200 files. Not a single missed reference, including:

Where it choked

Documentation lag. The README, the architecture doc, and three CLAUDE.md files used Adapter extensively. The model renamed them, but didn't catch that the README's example code block referenced a type that no longer existed because the example was inline markdown, not real code. Tests caught it (because the docs include doctest-like snippets), but I had to point that out.
It also got slower as context filled up. The first three turns felt instant. By turn 8, when most of my conversation was visible in context, response start time was noticeably longer — maybe 4 to 6 seconds for thinking before tokens started streaming.

What I learned about when to use 1M

🔬 Use it when:

The honest comparison

Could I have done this with sed -i? Yes, in 30 seconds. But sed would have hit dataAdapterPattern and other false positives. I'd have spent the next hour fixing what sed broke.
Could I have done this with a 200k context Claude session, file by file? Yes, but I'd have had to feed it files one at a time, and it wouldn't have known about cross-file references.
1M context is not magic. It doesn't make Claude smarter. It removes the "I haven't seen the rest of the codebase" excuse. For tasks where that excuse was the actual blocker, the difference is night and day.

What I'd want next

One thing the 1M context didn't help with: my conversation history. Once I'm in the middle of a refactor and I've had 20 turns of dialogue, that history pushes the codebase context out. Anthropic's memory tool and prompt caching help, but for a refactor that genuinely needs both "the whole repo" and "the whole conversation," we're not there yet.
The ceiling moved up. The shape of work that fits under it is the interesting design space now.

Sources: Context windows — Anthropic API docs, Claude Platform release notes. All capability claims verified against Anthropic documentation as of April 2026.

← 所有文章OctoDock 首頁 →