Skip to content
secondsky avatar

Root Cause Tracing

Systematic backward tracing of bugs through the call stack to fix the original trigger, not the symptom.

CCM score
60 of 100
skills.sh installs
448
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers a five-step process: observe the symptom, find the immediate cause, trace callers, follow the value upward, and locate the original trigger
  • Includes stack-trace instrumentation with console.error() and a bun test capture command for cases where manual tracing fails
  • Enforces a fix at the source rather than where the error appears, plus layered validation as defense in depth
  • Designed for errors that surface deep in execution, such as invalid paths or empty values passed through long call chains

Install

$ npx -y skills add secondsky/claude-skills --skill root-cause-tracing -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

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 ~/project/packages/core

2. Find Immediate Cause

What code directly causes this?

await execFileAsync('git', ['init'], { cwd: projectDir });

3. Ask: What Called This?

WorktreeManager.createSessionWorktree(projectDir, sessionId)
  → called by Session.initializeWorkspace()
  → called by Session.create()
  → called by test at Project.create()

Details

Repository
github.com/secondsky/claude-skills
Category
Debugging
First seen
Jun 3, 2026

Questions

What does the root-cause-tracing skill do?

root-cause-tracing traces bugs backward through the call stack to find the original trigger rather than fixing the place where the error appears. It is meant for errors that occur deep in execution, where the stack trace shows a long call chain.

When should I use root-cause-tracing instead of fixing the error where it appears?

Use root-cause-tracing when an error happens deep in execution, the stack trace shows a long call chain, or it is unclear where invalid data originated. Its core principle is to trace back to the source and fix there.

How do I install root-cause-tracing?

Run npx -y skills add secondsky/claude-skills --skill root-cause-tracing -y in a project to install it. Once installed, root-cause-tracing lets the agent walk the call chain upward to find where a bad value first came from.

Which other debugging skills sit alongside root-cause-tracing?

root-cause-tracing is listed in the Debugging category with diagnosing-bugs, azure-messaging, safe-debug, systematic-debugging and sentry-cli. Its own focus is backward tracing from a deep error to the original trigger, including adding stack trace logging before risky operations.

More from secondsky/claude-skills

All 116

Similar to Root Cause Tracing

More Debugging