Library / Debug

Print-debug plan

Instrument a hard-to-see bug, then clean up after.

Debug logging diagnosis cleanup Claude Code
The prompt
Add targeted logging to narrow down <issue>. Tell me exactly what output to look for and what each value would mean. Once we've found the cause, remove the logs.

Why it works

Good logging is a hypothesis test: the model states what each line should show and how to interpret it. Baking in the cleanup step keeps debug noise out of your final diff.

Fill in

  • <issue> — the behavior you can’t yet explain.

Follow-ups

  • “Output says X — what does that rule in or out?”