debug-bug

A step-by-step bug-fixing workflow that reproduces a problem, finds where it starts, follows the relevant code path, applies a small fix, and checks the result.

In plain words
What is it for?
Use it to investigate errors, debug unexpected behavior, and verify that a bug fix does not break related code.
Why use it?
It prevents guessing at fixes and limits how much code must be read before identifying the cause.

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

Made for: Claude Code, Codex.

Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 623 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.00057 $0.00623
Opus 5 $0.00028 $0.00311
Sonnet 5 $0.00011 $0.00125
Haiku 4.5 $0.00006 $0.00062

Measured yesterday against content hash 1e0a4f956016, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug-bug 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 yesterday.

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/claude/debug-bug/SKILL.md · 82 lines

How it starts

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

Debug Bug

Systematically find and fix bugs while reading as little code as possible.

Workflow

Reproduce → Localize → Trace → Fix → Verify

1. Reproduce

tl run "<repro command>"   # Capture the actual error output

No fix without reproduction. If no repro command is given, ask for one. If the bug is in tests, run the failing test. This step is non-negotiable.

2. Localize

Narrow down where the bug lives:

tl parallel \
  "errors=tl errors" \
  "blame=tl blame <file>" \
  "history=tl history <file>"

If the error includes a stack trace, start with the top frame. If it's vague, use tl search "<error message>" to find where the error originates.

3. Trace

Understand the code path without reading entire files:

tl parallel \
  "flow=tl flow <function> <file>" \
  "deps=tl deps <file>" \
  "snippet=tl snippet <function> <file>"

4. Fix

Apply the minimal fix. Then check for side effects:

tl parallel "guard=tl guard" "impact=tl impact <file>"

5. Verify

tl parallel "repro=tl run '<repro command>'" "tests=tl run '<test command>'"

Decision tree

Bug report → Can you reproduce it?
  ├─ Yes → What layer does the error come from?
  │   ├─ Stack trace points to a file → tl blame + tl snippet on that file
  │   ├─ Error is vague / no stack → tl errors + tl search for the error message
  │   └─ Happening in dependency → tl deps to confirm, check dep version
  ├─ No → Ask for reproduction steps before proceeding
  └─ Intermittent → tl history on suspect files, look for recent changes

Tips

  • Use tl parallel to run context-gathering commands simultaneously
  • Use tl search "<error message>" to find where errors are thrown
  • Check tl diff for recent regressions — the bug may be in the last few commits
  • If a file is under 150 lines, just read it directly — tokenlean overhead isn't worth it
  • After fixing, run tl impact to ensure dependents aren't affected by the change

Read the full file on GitHub · 82 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. yesterday First seen · 82 lines · 57 tokens per session scan A 1e0a4f956016

Subscribe to this mod's changes

debug-bug is a skill published in the GitHub repository edimuj/tokenlean (11 stars, last pushed 1mo ago), licensed MIT. It adds 57 tokens to every session and 623 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

localization-toolkit

This skill should be used when setting up, auditing, or enforcing internationalization/localization in UI codebases (React/TS, i18next or similar, JSON locales), including installing/configuring the i18n framework, replacing hard-coded strings, ensuring en-US/zh-CN coverage, mapping error codes to localized messages…

zebbern/claude-code-guide · 82 tokens

vs-alias-mapping

Provide system alias mapping for Search CLI. Invoke this skill when user mentions "Search CLI", "searchcli", or tries to execute searchcli commands.

volcengine/SearchCLI · 36 tokens

jsonl-subprocess-runner

JSONL subprocess management patterns for Untether engine runners. Covers JsonlSubprocessRunner base class, template methods, event translation, session locking, resume tokens, process lifecycle, PTY usage, and concurrent session registries.

littlebearapps/untether · 52 tokens

codex-opencode-pi

Codex CLI, OpenCode CLI, and Pi CLI runner protocols for Untether. Covers JSONL event types, event translation, resume mechanisms, and key differences between engines. All three are non-interactive (no control channel).

littlebearapps/untether · 53 tokens

ontology-mapper

Map materials science terms, crystal structures, and sample descriptions to standardized ontology classes and properties — resolve natural-language concepts to ontology entries with confidence scores, translate Bravais lattice types, space groups, and lattice constants into ontology-compliant annotations, and produce…

HeshamFS/materials-simulation-skills · 141 tokens

localization

Localize (not just translate) text, UI content, or marketing copy to feel native in the target culture.

furkangonel/cowrangler · 25 tokens