Even if you ask the same question, the answer to the Claude Code changes if you ask it differently. In a preliminary investigation, the team of troubleshooting has not changed from start to finish, but the bill has changed.
This structure is deliberately kept narrow. KernelBench only has a GPU kernel optimization task and only one bug was introduced in nanoGPT training. Each task was first performed with normal instructions, and then several variations were performed with human review to define the task as model development. Nothing else has changed. Same model, same repo, same tools.
Inside the agent loop, where framing lands
Claude Code is essentially something like a use that attaches to the outside of the model. At each step, a piece of context is put together. Everything from the system prompt, the tool definitions, the conversations we've had so far, to the files the model asks us to read and the results of the shell commands we've run. When the model issues a tool call, the use picks it up, executes it, appends the output, and spins again. Until the model stops on its own or hits a reversible cap and stops.
The frame text is entered by the user. It doesn't affect the tool schema or the permission level. What changes is the implicit plan the model has in mind for that session. The plan manifests itself in the form of more reads, more test calls, and more self-checks before final editing. The study measured exactly this area - the number of rounds, the working time and the execution costs.
The results were clearly divided. The number of rounds has been increased for both tasks. If you look at the clock, the kernel is taking longer to execute. In KernelBench, the quality difference between frame and plain runs increases or decreases with each iteration of the experiment, and this signal is not yet stable, so no conclusions can be drawn from it. The only thing that was consistent every time was the increase in costs. No matter how the frame changes, nanoGPT runs always get the same fix - the author clearly points out this ceiling effect.
Reproduce the experiment on your own repository
You don't need KernelBench to try this out. A deterministic test suite in the repo is sufficient. The key is to isolate framing as the only variable and record revolutions, costs and duration for each session.
- Pin the use version. A silent CLI upgrade invalidates every prior run.
Record the output next to your results table.npm install -g @anthropic-ai/claude-code@<pinned-version> claude --version - Freeze the workspace at a known commit. Clone fresh for every run so leftover edits cannot leak between sessions.
git clone https://github.com/karpathy/nanoGPT.git C:\bench\nanogpt git -C C:\bench\nanogpt checkout <commit-sha> - Write the two prompt files. Keep the task sentence byte-identical and append only the framing paragraph.
plain.txtholds the bare instruction.framed.txtadds the review context: production pipeline, human auditor, change log required. - Lock permissions so the agent never stalls. An interactive approval prompt mid-run destroys your timing data. Drop a
.claude\settings.jsoninto the repo root:{ "permissions": { "allow": ["Read", "Edit", "Bash(python:*)", "Bash(pytest:*)"], "deny": ["Bash(rm:*)", "Bash(git push:*)"] } } - Run headless and capture structured output. The
--output-format jsonflag returns turn counts, duration, and cost in one object.$env:ANTHROPIC_API_KEY = (Get-Content .\key.txt -Raw).Trim() New-Item -ItemType Directory -Force .\runs | Out-Null claude -p (Get-Content .\prompts\plain.txt -Raw) ` --output-format json ` --max-turns 40 ` --model <model-id> ` --allowedTools "Read,Edit,Bash(python:*),Bash(pytest:*)" | Out-File .\runs\plain-01.json -Encoding utf8 - Flatten the JSON into a spreadsheet.
Get-ChildItem .\runs\*.json | ForEach-Object { $r = Get-Content $_.FullName -Raw | ConvertFrom-Json [pscustomobject]@{ Run = $_.BaseName Turns = $r.num_turns CostUSD = $r.total_cost_usd Duration = $r.duration_ms } } | Export-Csv .\metrics.csv -NoTypeInformation - Interleave the arms. Alternate plain and framed runs (plain, framed, plain, framed) instead of batching. Provider latency drifts across the hour and batching turns that drift into a fake framing effect.
- Compare medians, not means. One runaway session with 38 turns will drag an average far from anything a user experiences.
Import-Csv .\metrics.csv | Group-Object { $_.Run.Split('-')[0] } | ForEach-Object { $_.Group | Measure-Object Turns, CostUSD -Median } - Score correctness outside the agent. Run your own test suite against the final diff. The agent's own claim that it fixed something is not a measurement.
What to log, and what the study found
| Signal | Study observation | How to capture it locally |
|---|---|---|
| Turns per session | Rose on both task families | num_turns in the JSON result |
| Wall-clock on kernel work | Longer than the plain run | duration_ms, logged per session |
| Execution cost | Most consistent increase measured | total_cost_usd, summed per arm |
| KernelBench quality | Gap varied across experimental repeats | Your own pass rate on a held-out test set |
| nanoGPT fix correctness | Identical fix in every run | Diff against the reference patch |
Tip: First adjust --max-turns and then rotate the frame arm. By the time you're done running, it's too late. Framing lengthens the verification loop, and in an uncapped session, you'll find yourself re-reading files you've already read over and over again, using three times as many tokens, without even realizing it. By keeping the cap at 30-40 rounds, you can make comparisons without deceiving yourself and you can avoid blowing your monthly budget all at once.
Treat framing as a budget dial
Mechanism はまだ決着がついていない. The authors offer a plausible explanation. Agents spend more time reviewing their work. This modesty is right. 295 sessions.
Roughly speaking, this view is quite easy to use because it has a narrow scope. If the prompt says "Auditor", "Production Pipeline", "Downstream Auditor", expect the number of tool calls to increase and the bill to increase. When there is only one obvious solution to a task, the answer is generally the same. Save this frame for work that will be expensive once removed. It is not necessary to cover small daily corrections. The ceiling effect protects us first and foremost.
For detailed instructions, appended tables, and a breakdown of each task, see the original article by Hacker News.
Comments
Post a Comment