root-cause-tracing

root-cause-tracing is a skill for Claude Code, Codex from hamr0/agentic-toolkit. It costs 47 tokens per session (1,367 once invoked), scanned A, a copy of Root Cause Tracing, Apache-2.0.

A debugging method that follows an error backward through the chain of code that led to it, until it finds the original trigger. It focuses on where invalid data or behavior began, not only where the error appeared.

In plain words
What is it for?
Use it to investigate deep errors, long call stacks, invalid data, or uncertainty about which code or test first caused a problem.
Why use it?
Errors often surface far from their cause, such as a file being created in the wrong place. Tracing backward helps avoid patches that only hide the visible symptom.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/hamr0/agentic-toolkit/root-cause-tracing
Any agent
npx skills add hamr0/agentic-toolkit --skill root-cause-tracing
Clone the repo
git clone --depth 1 https://github.com/hamr0/agentic-toolkit

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for root-cause-tracing

README.md
[![agentmods](https://agentmods.dev/badge/skills/hamr0/agentic-toolkit/root-cause-tracing.svg)](https://agentmods.dev/skills/hamr0/agentic-toolkit/root-cause-tracing)
Your own site
<a href="https://agentmods.dev/skills/hamr0/agentic-toolkit/root-cause-tracing"><img src="https://agentmods.dev/badge/skills/hamr0/agentic-toolkit/root-cause-tracing.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,367 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 91% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.01367
Opus 5 $0.00023 $0.00683
Sonnet 5 $0.00009 $0.00273
Haiku 4.5 $0.00005 $0.00137

Measured 3d ago against content hash 61dda95d3f44, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

root-cause-tracing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (find-polluter.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

91% identical to Root Cause Tracing — 7 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

ai/customize/skill-to-command/skills/root-cause-tracing/SKILL.md · 175 lines

How it starts

The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

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?

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()

4. Keep Tracing Up

What value was passed?

  • projectDir = '' (empty string!)
  • Empty string as cwd resolves to process.cwd()
  • That's the source code directory!

5. Find Original Trigger

Where did empty string come from?

const context = setupCoreTest(); // Returns { tempDir: '' }
Project.create('name', context.tempDir); // Accessed before beforeEach!

Read the full file on GitHub · 175 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 175 lines · 47 tokens per session scan A 61dda95d3f44

Subscribe to this mod's changes

root-cause-tracing is a skill published in the GitHub repository hamr0/agentic-toolkit (22 stars, last pushed 4d ago), licensed Apache-2.0. It adds 47 tokens to every session and 1,367 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to Root Cause Tracing, differing in 7 lines, and is treated as a copy.

Related

Other skills, from other repositories

create_profile_style_skill

【META SKILL】分析当前剪辑逻辑与风格,总结并生成一个新的可复用 Skill 文件,存入剪辑技能库。Analyze the current editing logic and style, summarize and generate a new reusable Skill file, and store it in the editing skill library.

FireRedTeam/FireRed-OpenStoryline · 64 tokens

company-product-context

Compiles comprehensive company product context from PDF documents, web research, and industry knowledge.

lofcz/LLMTornado · 20 tokens

Paper Writing Workflow

Workflow phases for paper-writing tasks: triage, material inventory, research question, literature review, paper outline, data analysis summary, figure storyline, reader testing, and finalize packet. Each phase is a short contract — read the relevant rows for the current task only.

aristoteleo/PantheonOS · 58 tokens

codebase-context-extractor

This skill provides a comprehensive context extraction system for large codebases. It intelligently analyzes code structure, dependencies, and relationships to extract relevant context for understanding, debugging, or modifying code.

lofcz/LLMTornado · 42 tokens

deep-researcher

Performs comprehensive, multi-layered research on any topic with structured analysis and synthesis of information from multiple sources.

lofcz/LLMTornado · 27 tokens

llmtornado-tutorial-generator

Generates comprehensive code tutorials on LlmTornado API formatted for Medium publication with examples, explanations, and best practices.

lofcz/LLMTornado · 31 tokens