You need to know the shape of the solution ...
https://stackoverflow.com/questions/1732348/regex-match-open...
If you draw a sloppy circle and fill it in, it'll "escape" and try to paint the whole canvas (and back in the day would get my slow computer stuck until I spam "esc").
You have to be able to draw a good circle to use it.
Is it already too late to have humans just write down what they are thinking instead of passing it through a lossy expander?
And it feels like claude code has gotten more verbose with the multiline comments lately
Edit: Similar with the "UI components" section, the long one is missing the UI while the short one is UI without the trigger to activate it. You'd probably combine the two, using state from the first to control the UI in the second (replacing the contents of the useEffect with the dialog API to get the modal effect).
One thing I found: asking the model to respond in structured JSON (with a strict schema) vs free-form text cuts token output by ~40% on average. The model stops "explaining itself" and just gives you the answer.
Also noticed that including a reference image in vision calls roughly doubles the input cost but improves accuracy enough that you save on retries. Net cost ended up lower for my use case.
Curious if you've measured the difference between asking for "concise" output vs actually constraining the response format.