← ClaudeAtlas

root-cause-tracinglisted

Systematically trace bugs backward through call stack to find original trigger
magnusrodseth/dotfiles · ★ 0 · DevOps & Infrastructure · score 68
Install: claude install-skill magnusrodseth/dotfiles
# Root Cause Tracing ## Overview Bugs often manifest deep in the call stack (git init in wrong directory, file created in wrong location, database opened with wrong path). Your instinct is to fix where the error appears, but that's treating a symptom. **Core principle:** Trace backward through the call chain until you find the original trigger, then fix at the source. ## When to Use ```dot digraph when_to_use { "Bug appears deep in stack?" [shape=diamond]; "Can trace backwards?" [shape=diamond]; "Fix at symptom point" [shape=box]; "Trace to original trigger" [shape=box]; "BETTER: Also add defense-in-depth" [shape=box]; "Bug appears deep in stack?" -> "Can trace backwards?" [label="yes"]; "Can trace backwards?" -> "Trace to original trigger" [label="yes"]; "Can trace backwards?" -> "Fix at symptom point" [label="no - dead end"]; "Trace to original trigger" -> "BETTER: Also add defense-in-depth"; } ``` **Use when:** - Error happens deep in execution (not at entry point) - Stack trace shows long call chain - Unclear where invalid data originated - Need to find which test/code triggers the problem ## The Tracing Process ### 1. Observe the Symptom ``` Error: git init failed in /Users/jesse/project/packages/core ``` ### 2. Find Immediate Cause **What code directly causes this?** ```typescript await execFileAsync('git', ['init'], { cwd: projectDir }); ``` ### 3. Ask: What Called This? ```typescript WorktreeManager.createSessionWorktree(