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.
Log in to leave a comment.
Hand Claude your heap snapshots or server code and ask it to trace memory leaks — it spots missing event listener cleanup, unbounded caches, and stream lifecycle bugs that are easy to miss in code review.
Ask Claude to audit your UI components for WCAG accessibility issues — it catches semantic problems, missing ARIA attributes, and keyboard navigation gaps that automated tools miss.
The --debug flag enables verbose logging for Claude Code, and an optional category filter like "api,mcp" lets you narrow output to exactly the subsystem you need to investigate.