← All posts

Same Model, Different Brain: Why GPT-6 Astra Stalls in Codex and Thrives in Claude Code

How unrolled transcript history and compaction drift in Codex compare with file-backed state and selective context eviction in Claude Code.

Over the past few weeks I moved my daily vulnerability research and refactoring workflows over to GPT-6 Astra. Most of my sessions involve tracing data flow across large repositories, writing reproduction harnesses, updating build targets, and fixing regressions that span multiple modules.

When I first ran Astra inside OpenAI Codex, long sessions kept bogging down. On isolated questions the model was sharp, yet twenty minutes into a multi-file task it would start re-reading files it had just edited, running the same failing test twice, or revisiting hypotheses it had already ruled out. Worse, whenever context compaction fired, Astra remembered the high-level goal while losing track of which sub-steps were already verified and which file it needed to touch next. A few hours of heavy refactoring could easily burn through a full day's usage quota.

Out of curiosity, I pointed Claude Code at the exact same GPT-6 Astra model endpoint and ran the same class of tasks. The difference was immediate: Astra pulled only the files it needed, applied targeted edits, ran the test suite once or twice to verify, and stopped cleanly when done. Even across hour-long refactoring sessions, it held onto its place in the task and barely moved my usage meter. Watching the same weights behave like two different models pushed me to dig into how both harnesses manage context and state.

Where the harness sits in the loop

When we talk about coding agents, we usually credit or blame the model checkpoints. In practice, the model only ever sees the prompt assembled by the surrounding harness on each turn. The harness decides which file contents enter the window, how shell output is truncated, what gets dropped during compaction, and how intermediate verification is structured.

Even with a 200,000-token context window, every extra kilobyte of stale shell telemetry, old diffs, and superseded stack traces competes for the model's attention. Once the working context fills up with historical noise, the model spends as much effort reconstructing where it is in the task as it does solving the actual code change.

Effective capability = model × context × tools × state × loop

Figure 1. Capability is a systems property. An informal model: one weak layer can suppress the capability of every layer before it.

Inside Codex: unrolled prefixes and cached bloat

OpenAI's engineering write-up, Unrolling the Codex agent loop, lays out why Codex transcripts grow the way they do. Instead of chaining stateful server-side sessions via previous_response_id, Codex sends the unrolled sequence of messages and tool outputs on every request so the API remains stateless and compatible with Zero Data Retention setups. To keep inference costs down, each new request is structured as an exact prefix extension of the prior turn so prefix caching can reuse the KV cache.

Prefix caching makes repeated input tokens cheap for the inference cluster, yet those tokens still sit inside the model's active attention window on every step. In GitHub issue #44305, an audit of Codex rollout logs tracked a single 11.4-minute run across 34 model requests and 33 tool calls: the active request ballooned from 16.7K tokens to 158.3K tokens, accumulating 3.52 million input tokens (3.37 million cached). A second logged run hit 197K active tokens and over 12 million cumulative input tokens. Issue #44884 documented similar long-session behavior where small shell checks carried 100K to 250K input tokens per turn and drained a Pro 20x weekly quota from 14% to 100% in 28 hours.

Because every grep, file dump, diff, and compiler error stays appended to the prefix until compaction triggers, a single noisy inspection taxes every decision that follows.

The expanding tool loopTRACE
model → inspect → model → search → model → edit      → test → model → inspect again → model → compact

Transcript history vs. current state

Comparing the two harnesses highlights the difference between keeping a chronological transcript and maintaining a compact state snapshot. A chronological transcript records every dead end: listing eight files, opening the wrong one, hitting a syntax error, and retrying a command. A state snapshot records only what still matters: the header parser is patched and passing tests, the lexer still chokes on null bytes, and the next step is adding a bounds check in lexer.c.

When an engineer works through a bug, we update our mental state and discard the raw terminal scrollback. A transcript-heavy harness forces the model to re-derive that state from hundreds of lines of old tool output on every turn. GitHub issues #43103 and #34095 describe the exact failure mode this creates in Codex Desktop: repeated compaction cycles, premature stops, and loss of what #34095 calls the execution frontier.

At any point in a long task, that frontier comes down to four concrete facts:

  1. Which changes are already finished?
  2. Which behaviors have been verified by tests?
  3. What is still failing or unimplemented?
  4. What is the immediate next action?
Transcript memory
1Read parser
2Ran tests
3Saw null error
4Edited guard
5Read parser again
State memory
DoneHeader parser passes
BrokenLexer rejects null bytes
NextPatch input guard
Figure 2. History is not the same thing as state. The same session recorded two ways. The transcript lists what happened in order; the state records only what is true now and the next action.

Why compaction triggers circular rework

Once a session accumulates over 150K tokens of raw exploration output, Astra has to sift through outdated file versions and old test failures just to decide its next tool call. Uncertainty makes the model run extra verification commands (git diff, rg, re-reading files), which appends even more output to the transcript.

When the context limit finally forces a compaction pass, the summary reliably preserves the high-level user request ('refactor the auth middleware and fix the session tests') while smoothing over the fine-grained operational state ('test 4 passed after the cookie patch, do not touch session.ts again'). Waking up from compaction with a clear mission and a blurry frontier, the model starts auditing the repository from scratch, kicking off the next cycle.

Figure 3. The convergence failure loop. Tool output enlarges the context, which makes the current frontier harder to see, which triggers more checks and more output. Compaction relieves the pressure, but a summary that keeps the goal and drops verified facts sends the model back to discovery.

How Claude Code keeps the working set small

Pointing Claude Code at GPT-6 Astra changed the behavior because Claude Code treats context window space as scarce working memory rather than an append-only log. As Anthropic details in Effective context engineering for AI agents, the harness loads lightweight project instructions (CLAUDE.md) up front and relies on targeted glob, grep, and file-read calls to pull context in just in time.

When Claude Code compacts a session, its summarizer is explicitly structured to retain architectural decisions, open bugs, and concrete implementation state while stripping redundant tool outputs, then re-attaching the five most recently accessed files. For multi-session or deep-horizon work, Anthropic's harness design leans on externalized state on disk: progress files, structured task lists, git commits, and test gates. Instead of inferring progress from a massive chat transcript, the model reads the current repository state and picks up the next uncompleted item.

Splitting state across the right layers

Running Astra across both tools made it clear how much cleaner an agent runs when each layer of the environment holds the state suited to it:

  • The active prompt window holds only the immediate decision context and recent working files.
  • The filesystem holds persistent project notes, plans, and constraints.
  • Git history holds verified checkpoints that do not need to stay in prompt memory.
  • The test suite acts as the ground-truth check for whether a step is done.

When the prompt window only has to carry the current step and its immediate evidence, Astra stops second-guessing its own edits.

Evaluating the model and harness together

Codex's unrolled prefix design makes sense from an infrastructure perspective: stateless requests simplify Zero Data Retention compliance and maximize prefix cache hits. The catch is that server-side cache efficiency and model-side attention quality pull in opposite directions when tool outputs pile up.

Before running this comparison, whenever an agent stalled two-thirds of the way through a complex refactor, I blamed the model's long-horizon reasoning. Watching GPT-6 Astra spin in circles inside Codex and then breeze through the same work inside Claude Code cured me of that habit. A frontier model's effective capability in daily engineering work is bounded by how well its harness prunes noise and preserves the execution frontier.

SourcesOpenAI · Unrolling the Codex agent loop ↗openai/codex #44305 · Context snowballing audit ↗openai/codex #44884 · Long-session cached-context amplification ↗openai/codex #43103 · Astra convergence report ↗openai/codex #34095 · Execution-frontier degradation ↗Anthropic · Effective context engineering for AI agents ↗Anthropic · Effective harnesses for long-running agents ↗

By Jing Qian (Civitasmass)Permanent link