How you frame a task changes how much Claude Code spends
Details
- Published
- Language
- English
- Reading
- 5 min
A preliminary study ran Claude Code on the same tasks with different framing. It took more turns and more time, with no clear gain in quality.
Same model, same task, same repository. You change two sentences at the top of the instruction, sentences that say nothing about the code, and the agent works longer to get to roughly the same place.
That is the short version of a preliminary study that reached the top of Hacker News this weekend. How you ask Claude Code for the work is part of what the work costs, and the honest way to know how much is to measure it per merged change.
I work with Claude every day, so this one landed close to home. Here is what the study actually found, what it did not, and what you can check in your own runs.

What did the Claude Code framing study test?
The post, "Does Task Framing Change How Claude Code Works? A Preliminary Study", kept the model and the task fixed and changed only what the agent was told about how its code would be used. It ran claude-opus-5-5 on two kinds of work: rewriting PyTorch modules from KernelBench as faster GPU kernels, and finding a planted bug in a nanoGPT training run.
There were three versions of the instruction. The plain one added nothing, the second said the code would become training data for a model in development, and the third added that no human would review the output.
Across both tasks that came to 295 sessions. By Sunday the post had 972 points on Hacker News.
What changed when the framing changed?
On both tasks Claude Code took more turns, and on the kernel task the sessions also took longer. Sessions had a 1200 second cap, and with the strongest framing 39% of them ran out of time, against 5% for the plain instruction.
The framed kernel sessions wrote about a quarter more code and ran more commands, and the authors say the same pattern showed up in five separate runs. On the nanoGPT task, turns rose 19%, about 0.9 more turns per session, while the median time stayed at 91 to 92 seconds.
The authors do not read this as the agent slacking off. Their suggestion is that it may be checking its work more, and they say plainly that the mechanism is still an open question.

Did the extra turns buy better code?
Not clearly, and the study is careful about that. In the first kernel round, the share of tasks with a kernel that compiled, stayed correct and beat PyTorch fell from 0.92 to 0.69 across the framings, on eight tasks.
A larger rerun on 36 architectures shrank that gap to 7%, with an interval that includes no change at all. The authors' own advice is to be careful about drawing conclusions on kernel quality from these runs.
On nanoGPT, all 81 sessions found the correct fix, so quality could not separate the conditions. The agent simply took more steps to reach the same answer.
What are the limits of the study?
It tested one model on two kinds of task. In the first kernel round, the checker contained comments about the study's purpose, and the authors say they cannot rule out that this interacted with the framing.
The framings are also unusual. Nobody tells their agent its code is training data, so this is not a test of everyday prompting styles.
What it does show is narrower and still useful: context that says nothing about the code can move how much work the agent does. The authors put the practical side in one line:
From a user's perspective, these extra turns and longer sessions matter even if the final answer is just as good. Whether the extra work is useful is a separate question.
Does Task Framing Change How Claude Code Works? A Preliminary Study
Why does framing belong in the cost per merged change?
I'd rather measure agent work by cost per merged change than by cost per task, because review is where the real cost sits. Turns, time and tokens are the part of that cost the agent spends before anyone reviews anything, and the prompt is one of the inputs that moves them.
My agents open pull requests as drafts, and nothing merges without my OK, which I explained in the note about vendor rules and human approval gates. A framing that makes every run longer for the same diff is a cost you pay on every one of those pull requests, whether or not anyone notices.
The study used framings no one would write on purpose. The question it raises for daily work is simpler: do you know what your usual way of asking costs?

How should you frame a task for Claude Code?
Anthropic's best practices for Claude Code point in the same direction as the study. Give the agent information it cannot get from the code: name the file, describe the symptom and say what fixed looks like.
Give it a check that comes back pass or fail, such as a test, a build's exit code or a linter, and ask for evidence: the command it ran and the output. Without a check, the docs note, you end up being the test suite.
Leave out the pep talk. The same page says lines like "keep going" or "don't be lazy" are more likely to cause over-work than fix a stall, and that phrases like "be thorough" are ordinary prompt text, not a control for effort. Stories about who will use the code are the kind of extra context the study suggests can change the run, so keep them out unless the agent really needs them.
How do you measure turns, time and tokens per merged change?
Pick three to five real tasks that tend to become pull requests, and write two versions of the instruction: the way you usually ask, and a version with the file, the done condition and the check. Run each version several times, because single runs vary a lot.
For each run, record turns, wall time and tokens or cost. In an interactive session, `/usage` shows the session's token use, estimated cost and duration; in a script, claude -p with `--output-format json` returns total_cost_usd, and --max-turns puts a ceiling on turns.
Then follow each run's change to the end: did it merge after review, and did it need rework? Add up turns, time and cost for each framing and divide by the changes that merged. Compare medians, not averages, since a few long sessions can move an average on their own, as the study itself saw on nanoGPT.
If one framing merges as often with fewer turns, keep it. If it costs more turns but merges more often, that may still be the cheaper one. Either way you will be deciding with your own numbers, not with a hunch about prompts.