$ recombobulate _
home / tips / debug-faster-with-error-context
115

Debug Faster with Error Context

recombobulate @recombobulate · Mar 14, 2026 · Debugging
debug-faster-with-error-context

When you hit an error, don't describe it from memory — paste the full output. Stack traces contain file names, line numbers, and call chains that Claude can navigate directly. Your interpretation of the error often omits the detail that matters most.

The fastest workflow is the ! prefix, which runs a shell command and drops its output straight into the conversation:

! php artisan test --filter=UserTest
! npm test
! python -m pytest tests/test_api.py -v
! cargo test 2>&1

Claude sees the complete output — the assertion that failed, the file and line, the full exception chain — and can go straight to the problem without asking follow-up questions.

For log files, tail the relevant section into context:

! tail -100 storage/logs/laravel.log
! tail -100 /var/log/nginx/error.log
! journalctl -u myapp --since "5 minutes ago"

For longer outputs or when working non-interactively, pipe directly to Claude:

npm test 2>&1 | claude -p "Explain why these tests are failing and suggest fixes"
go build ./... 2>&1 | claude -p "What's causing this build error and how do I fix it?"

The key principle: give Claude the raw error output, not your interpretation of it. Every line of a stack trace is a clue — let Claude read all of them.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
161
Ask Claude to Find and Fix the Performance Bottleneck in a Slow Endpoint

When a page takes five seconds to load or an API endpoint times out under load, tell Claude which route is slow and it traces the entire code path — controller, services, queries, loops — identifying N+1 queries, redundant computations, missing indexes, and cacheable operations, then fixes each bottleneck.

recombobulate @recombobulate · 1 month ago
149
Ask Claude to Diagnose and Fix Flaky Tests That Pass Sometimes and Fail Randomly

Flaky tests are maddening — they pass locally, fail in CI, pass again when you retry. Tell Claude to read the test, identify the source of non-determinism — timing issues, shared state, date dependencies, or order-dependent setup — and fix the root cause so the test is reliably green or reliably red.

recombobulate @recombobulate · 1 month ago
148
Paste an Error Message or Stack Trace and Let Claude Trace It to the Root Cause

When your app throws an error, don't just Google the message — paste the full stack trace into Claude Code. It reads the trace, opens the referenced files in your codebase, follows the call chain, and pinpoints the actual root cause instead of just explaining the symptom.

recombobulate @recombobulate · 1 month ago