Use when errors occur deep in execution and you need to trace back to find the original trigger - systematically traces bugs backward through call stack with quantitative tracking, adding instrumentation when needed, to identify source of invalid data or incorrect behavior
View on GitHubkrzemienski/shannon-framework
shannon
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/krzemienski/shannon-framework/blob/main/skills/root-cause-tracing/SKILL.md -a claude-code --skill root-cause-tracingInstallation paths:
.claude/skills/root-cause-tracing/# 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
```
**Shannon tracking**: Record symptom details:
```python
serena.write_memory(f"tracing/{trace_id}/symptom", {
"error_message": "git init failed in...",
"location": "/Users/jesse/project/packages/core",
"timestamp": ISO_timestamp,
"initial_depth": 0 # Surface level
})
```
### 2. Find Immediate Cause
**What code directly causes this?**
```typescript
await execFileAsync('git', ['init'], { cwd: projectDir });
```
**Shannon tracking**:
```python
serena.write_memory(f"tracing/{trace_id}/layer_1", {
"code": "execFileAsync('git', ['init'], { cwd: projectDir })",
"file": "src/worktree.ts",
"line": 45,
"depth": 1
})
```
### 3. Ask: What Called This?
```typescript
WorktreeManager.createS