Transcript
When you're debugging complex issues, here's a systematic workflow that combines git worktrees with Claude's capabilities.
First, create an issue.md file that documents the symptom you're seeing, steps to reproduce it, and references to relevant code or logs. This gives Claude a clear understanding of what you're trying to solve.
Next, ask Claude to generate numbered theories about what might be causing the problem. Don't just settle for one explanation - get Claude to think through multiple possibilities. Maybe it's a concurrency issue. Maybe it's incorrect error handling. Maybe it's a configuration problem.
Then comes the clever part: create one git worktree per theory. This lets you explore multiple debugging approaches in parallel without constantly switching branches or stashing changes. You can have Claude Code working on theory one in the main directory, while you manually investigate theory two in a worktree, and maybe even run a third Claude session testing theory three in another worktree.
As each approach succeeds or fails, capture the "why not" feedback. If a theory doesn't pan out, document why it failed and feed that information back into your issue.md or a progress.md file. This creates a feedback loop that makes Claude progressively smarter about your specific problem.
This systematic approach turns debugging from a frustrating guessing game into an organized process of elimination.