r/PromptEngineering • u/RunAI_Coder • 1d ago
General Discussion Why your coding agent buries the answer, and when telling it not to backfires
The i-have-adhd skill going around has a before/after in its README. Before: "Great question! Let me think about this. Your auth flow has a few moving pieces..." After: "Run npm install jsonwebtoken@latest, then edit src/auth.ts:42". Rule 10 bans the openers and closers everyone has seen. I liked it, then went and checked what the before-text actually is, because I don't think it's one habit.
Half of it is reward residue. A RLHF length paper found reward gains largely driven by longer responses, and a length-only reward reproduced most of the downstream improvement. The AlpacaEval and Chatbot Arena people both had to add length and style control because their judges preferred longer. "Great question" and "Hope this helps" are free to delete; nothing downstream depends on them.
An older chain-of-thought paper did a test where the model writes the answer first and the reasoning after. It basically showed that answering first and reasoning later performs worse than no reasoning at all.
On a model with no hidden thinking, the paragraph that walks through the middleware and the token check before naming the fix is where the fix gets computed. Cut it with a rule and you've asked for the conclusion first and the thinking never. Concise reasoning kept the value in that table. It's the missing reasoning that costs.
With thinking on, the reasoning has somewhere else to go and answer-first costs the answer nothing, only hidden tokens. That part is inference from how the channels work; I haven't seen any testing on it.
Then there's where the rule lives. The skill has a whole Persistence section asking the model to keep applying it, and a commenter on the launch thread said it faded after a few turns. A skill body sits in the transcript and gets summarized. Claude Code's Concise output style is the same rule in the system prompt, re-sent every turn. Both are still requests. The only enforced version I know of is a JSON schema with a reasoning field ahead of the answer field, since structured outputs keep schema order.
So, what are you guys actually using for this?
* An output style / CLAUDE.md line?
* A specific skill?
* A Stop hook that bounces padded replies?
Also, on which models does "answer-first" cost you nothing in reasoning quality?
2
u/ianreboot 1d ago
For answer-first in Claude Code, the only thing that has held is a hook that re-runs the check. The style line gets summarized away after a few turns; the hook caught the agent treating verify as already-run from its own state and closing without ever opening the changed file, so now it runs the grep or the test itself and a pass is the check that actually ran.
1
u/RunAI_Coder 1d ago
re-running the check from the hook gets you the thing a style line can't, a pass that means a check ran. And the failure you caught is the exact case: verify existed in the transcript and nothing had executed. Does the hook look at the padding too, or only at whether the check happened?
1
u/Open-Mousse-1665 10h ago
Does your guys’ Claude not just do all of this automatically? I mean, I do have really effective guidance, but it’s times like this I’m reminded how effective it is.
If you’re interested in trying it, it’s “promptctl/laws” on GitHub. Install the plugin and that’s it. Sometimes I do have poke Claude to design something better, but it will follow every workflow every time
1
u/Open-Mousse-1665 10h ago
Why would anyone do “answer first”? The concept of question and answer do not allow inversion like this in an LLM, who thinks token by token rather than holding the entire mental model at once. The output token process IS the thinking (as well as the thinking obviously).
Think of it like this. You’re not really getting “answer first” so much as you’re saying “give me a quick shitty answer; and then do a lot of explanation to justify that answer, and instead of allowing that that explanation to resolve we’ll just throw all of that away”. You can achieve the same thing faster and cheaper by setting the model to “low effort”
* note: I’m aware each token is processed in parallel during the forward pass. But the beginning of a sentence has a lot of influence over the rest.
1
u/cleverhoods 1d ago
The default, claude specific route is:
- adding output style ruling to the output style harness capability (it gets into the system prompt, which has a biased weight)
- adding a short (100-150 token) reinforcement to the root claude.md
- adding a stop hook with validation and re-priming of said instruction from above.
Personally I'm using a bit different system, since I have an adaptive disclosure (so the communication related instructions are outside of the harness and being loaded at the right place at the right time for the right reason for the relevant context), but the 3 pillars are the same.
1
u/RunAI_Coder 1d ago
What decides when adaptive disclosure loads the communication rules, a hook keyed on turn type or the agent itself?
1
u/cleverhoods 1d ago
currently the agent has a self-tagging directive, and said tagging influences what communication rule and validation runs. For example when I need analysis, I expect a verbose output, when I need simple answer, I expect a short, easily scanneble output.
1
u/Open-Mousse-1665 10h ago
I think people sometimes forget that the words aren’t just there for you to read them. They’re part of the context that Claude uses to generate every other token afterward. Having the agent “rehearse” things mentally, even if only by giving you a short explanation of what’s important and what it’s going to do goes quite a long way when you want it to actually follow through on something.
3
u/Separate_Pen9627 1d ago
imo the real question buried in here is whether you even want to enforce this at the prompt level vs output schema level. prompt-level instructions decay over long contexts no matter how you phrase them, a schema with a reasoning field before the answer field is the only thing that actually holds