1 Million Tokens in Opus 4.7: Why Only 300 Thousand Actually Work

Anthropic has launched Claude Opus 4.7 with a claimed one-million-token window — and the marketing worked. The number is impressive until you start working on real tasks. It turns out the model effectively maintains context only up to 300,000 tokens — about 30% of what was claimed. Beyond that, degradation begins, and it is more noticeable than it was in the previous 4.6 version.
Anthropic themselves confirmed this in a technical document: Opus 4.7 is optimized for agentic coding and visual understanding through long-context retrieval, rather than for linearly holding a million tokens in memory. This means the model works better with external document search but worse with long sessions within a single conversation.
Why context degrades after 300,000 tokens
The problem is not that the model technically cannot process a million tokens — it can. The problem is the quality of processing. After 300,000 tokens, the model begins to lose coherence: it forgets decisions made at the beginning of the session, repeats questions, and loses focus on architectural constraints.
This is especially noticeable in long coding sessions: if you are working with a monorepo, editing several files, and discussing architecture, the model stops considering earlier agreements after a certain threshold. You might explicitly state, "we agreed not to use this library," and 50,000 tokens later, the model will suggest it again.
Four ways to bypass context degradation
Developers working with Opus 4.7 on real projects have developed several working strategies:
- Forced compaction at 50–60% capacity. Do not wait for the automatic trigger at 95% — manually run the
/compactcommand after completing a discrete task: writing a PRD, fixing a bug, or agreeing on a plan. This will preserve key decisions and free up space for the next stage. - Redefining the default compaction prompt. In Claude Code, this is done via the settings file. Instead of a generic "state, next steps, learnings," specify a focus on the current state of the codebase, active TODOs, project constraints, and the latest architectural decisions. This will give the model a more accurate picture for continuing work.
- Intermediate state snapshots in text files. A compacted summary is encrypted — if the session goes off track after compaction, you won't be able to debug it via the log. Keep intermediate states in regular files: "here we agreed on the architecture," "here we made a decision on migration." In text, in the repository, visible.
- Splitting tasks by model type. If work is being done on long traces with retrieval, use Opus 4.6 for document search and 4.7 for agentic loops. Anthropic themselves noted in their system card that Opus 4.7 is better at agentic coding and visual understanding due to long-context retrieval, not due to linear context retention.
Why OpenAI's Codex-Max outperforms Opus in long sessions
The main advantage of Codex-Max is native compaction built into the model itself. The auto-trigger almost always fires on time; the model does not "forget" the summary and does not lose focus. This provides a tangible advantage in long coding sessions where context grows linearly.
In Codex-Max, you can configure the auto-compaction threshold via a configuration file — the default might be more conservative than you need. Setting the threshold at 70–80% provides comfort for large tasks without manual intervention.
What to do if you are working with Opus 4.7 right now
If you have already integrated Opus 4.7 into your workflow and encountered context degradation, follow these three steps:
- Configure forced compaction at 50–60% capacity. Do not trust the auto-trigger.
- Redefine the instructions for compaction — add your project specifics: NDAs, conventions, and architectural decisions.
- Keep intermediate state snapshots in text files — this will save you during debugging after a failed compaction.
If the task requires linear context retention on long traces, consider Codex-Max or a combination of Opus 4.6 for retrieval + 4.7 for agents.
Both companies, it seems, will arrive at the same point: compaction will become part of the model rather than an external hook. Anthropic is playing catch-up on this axis — it is logical to expect a response in future iterations. Until then, use wrappers, redefine instructions, and do not trust the headline context numbers.
At GEMERA AI, you can test both Claude Opus 4.7 and GPT-5.5 or Codex-Max — and choose the model for a specific task, not for a marketing headline. Access is available via a Telegram bot and a web dashboard, without switching between platforms.