debug-trajectory

A debugging procedure for investigating bugs and error messages in seven stages. It starts by comparing the problem with known patterns, then requires reproduction, ranked explanations, and a recorded fix process.

In plain words
What is it for?
Use it to investigate software failures, reproduce errors, test likely causes, apply fixes, and record the debugging trajectory.
Why use it?
It prevents guesses from replacing evidence during debugging. The required steps help narrow down the cause and stop repeated investigation after several unsuccessful exchanges.

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/soleimanmansouri/debug-bank/debug-trajectory
Any agent
npx skills add soleimanmansouri/debug-bank --skill debug-trajectory
Clone the repo
git clone --depth 1 https://github.com/soleimanmansouri/debug-bank

Made for: Claude Code, Codex.

Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 745 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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.00037 $0.00745
Opus 5 $0.00018 $0.00373
Sonnet 5 $0.00007 $0.00149
Haiku 4.5 $0.00004 $0.00075

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

Security

Grade A, and why

debug-trajectory 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 2d ago.

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.

skills/debug-trajectory/SKILL.md · 104 lines

How it starts

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

Debug Trajectory Protocol

You are now in debug trajectory mode. Follow this protocol exactly.

Step 1: Pattern Check (DO THIS FIRST)

Before investigating, scan the pattern bank for a matching root cause type.

Read all files in the patterns/ directory (or your project's pattern bank location). For each pattern, check if its symptoms match the current bug.

If a pattern matches:

  • State which pattern (e.g., "This matches P08: Config Resolution Chain Gap")
  • Read the full pattern file
  • Apply the check list
  • If the check list confirms, apply the fix strategy directly
  • Skip to Step 6 (Fix) — no need for Steps 2-5

If no pattern matches:

  • State "No pattern match" and proceed to Step 2

Step 2: Reproduce

Get the exact error. Capture FULL output — never summarize.

  • Run the failing operation
  • Capture complete logs, stack traces, HTTP responses
  • Include 50+ lines of surrounding context
  • Record exact reproduction steps

If you can't reproduce, add temporary logging and try again. Do NOT proceed without reproduction.

Step 3: Hypothesize

State 2-3 possible root causes, ranked by likelihood.

For each hypothesis:

  • "If [hypothesis] is correct, then [specific test] would show [specific result]"

Step 4: Isolate

Test hypotheses ONE AT A TIME. Binary search.

  • Start with the most likely hypothesis
  • Disable/enable components to narrow scope
  • If 3 hypotheses fail → TRIGGER 3-EXCHANGE RULE (see below)

Step 5: Diagnose

Identify the SINGLE root cause.

  • Trace the full call chain: trigger → propagation → symptom
  • Check for "root cause behind the root cause"
  • Verify this cause explains ALL symptoms

Step 6: Fix

Minimal change addressing the root cause.

  • Change as little as possible
  • Verify ALL symptoms resolved
  • Check for regressions

Step 7: Record

Add trajectory to your domain catalog:

### [Category] Short Title (YYYY-MM-DD)
- **Symptom:** What was observed
- **Root cause:** The actual cause
- **Fix:** What was changed
- **Key insight:** Generalizable lesson
- **Pattern:** P-number or "New"

Read the full file on GitHub · 104 lines

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. 2d ago First seen · 104 lines · 37 tokens per session scan A 12b128937047

Subscribe to this mod's changes

debug-trajectory is a skill published in the GitHub repository soleimanmansouri/debug-bank (1 stars, last pushed 3mo ago), licensed MIT. It adds 37 tokens to every session and 745 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.