debugging

A structured method for finding and fixing software bugs, such as errors, failing tests, or unexpected behaviour.

In plain words
What is it for?
Investigating error messages, stack traces, failing tests, production incidents, and problems that happen only with certain inputs or conditions.
Why use it?
It replaces guesswork with a repeatable process for reproducing a problem, understanding its cause, and checking the fix.

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/asgarovf/locusai/debugging
Any agent
npx skills add asgarovf/locusai --skill debugging
Clone the repo
git clone --depth 1 https://github.com/asgarovf/locusai

Made for: Claude Code, Codex.

Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,319 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 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.00029 $0.01319
Opus 5 $0.00015 $0.00660
Sonnet 5 $0.00006 $0.00264
Haiku 4.5 $0.00003 $0.00132

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

Security

Grade B, and why

debugging scanned grade B with 2 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.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

curl -X POST http://localhost:3000/api/users -d '{"name": "test"}'

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s http://localhost:3000/api/users/123 | jq .
skills/debugging/SKILL.md · 189 lines

How it starts

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

Debugging

When to use this skill

  • Investigating error messages or stack traces
  • Diagnosing unexpected behavior
  • Fixing failing tests
  • Debugging production issues
  • Understanding why code doesn't work as expected

Step 1: Reproduce the problem

Before fixing anything, confirm you can reproduce it:

# Run the failing command/test
npm test -- --grep "failing test name"
pytest -xvs test_file.py::test_name

# Check error logs
tail -100 logs/error.log
docker compose logs app --tail 100

Key questions:

  • What exactly is the error? (exact message, stack trace)
  • When did it start? (recent commit, dependency update?)
  • Where does it happen? (specific input, environment, timing?)
  • How often? (every time, intermittent, under load?)

Step 2: Read the error carefully

TypeError: Cannot read properties of undefined (reading 'map')
    at UserList (src/components/UserList.tsx:15:23)
    at renderWithHooks (node_modules/react-dom/...)

Parse the stack trace:

  1. Error type: TypeError — wrong type, likely null/undefined
  2. Message: Cannot read properties of undefined — something is undefined
  3. Property: reading 'map' — trying to call .map() on undefined
  4. Location: UserList.tsx:15 — exact file and line
  5. Context: React component render — data likely not loaded yet

Step 3: Narrow the scope

Binary search approach

If you don't know where the bug is, bisect:

# Git bisect to find the breaking commit
git bisect start
git bisect bad          # Current commit is broken
git bisect good abc123  # This commit was working
# Git will checkout middle commits — test each one
git bisect run npm test

Isolate variables

  • Does it fail with minimal input?
  • Does it fail in a fresh environment?
  • Does it fail without feature flags / config?
  • Does it fail with the previous version of dependencies?

Step 4: Inspect state

Check the data

# Search for where the variable is set
grep -rn "userData\s*=" --include="*.ts" src/

# Check database state
psql -c "SELECT * FROM users WHERE id = 123"

# Check API response
curl -s http://localhost:3000/api/users/123 | jq .

Read the full file on GitHub · 189 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 · 189 lines · 29 tokens per session scan B 52e823d7bc6b

Subscribe to this mod's changes

debugging is a skill published in the GitHub repository asgarovf/locusai (23 stars, last pushed 5mo ago), licensed MIT. It adds 29 tokens to every session and 1,319 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.