demo-2-bug-hunt

demo-2-bug-hunt is a skill for Claude Code, Codex from decodingai-magazine/building-a-coding-agent-from-scratch-course. It costs 38 tokens per session (621 once invoked), scanned C, original, Apache-2.0.

A demonstration debugging workflow for a small statistics package with two intentionally planted bugs.

In plain words
What is it for?
Use it to reproduce the failures, inspect the median and variance code, fix the implementation, rerun the test suite, and write a detective-style CASEFILE.md report.
Why use it?
It turns failing tests into evidence for locating and correcting the defects, while preserving the tests as the expected behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to reproduce the failures, inspect the median and variance code, fix the implementation, rerun the test suite, and write a detective-style CASEFILE.md report.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/decodingai-magazine/building-a-coding-agent-from-scratch-course/demo-2-bug-hunt
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.

Any agent
npx skills add decodingai-magazine/building-a-coding-agent-from-scratch-course --skill demo-2-bug-hunt
Clone the repo
git clone --depth 1 https://github.com/decodingai-magazine/building-a-coding-agent-from-scratch-course

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 demo-2-bug-hunt

README.md
[![agentmods](https://agentmods.dev/badge/skills/decodingai-magazine/building-a-coding-agent-from-scratch-course/demo-2-bug-hunt/github.svg)](https://agentmods.dev/skills/decodingai-magazine/building-a-coding-agent-from-scratch-course/demo-2-bug-hunt)
Your own site
<a href="https://agentmods.dev/skills/decodingai-magazine/building-a-coding-agent-from-scratch-course/demo-2-bug-hunt"><img src="https://agentmods.dev/badge/skills/decodingai-magazine/building-a-coding-agent-from-scratch-course/demo-2-bug-hunt/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for demo-2-bug-hunt

Your own site · 80×15
<a href="https://agentmods.dev/skills/decodingai-magazine/building-a-coding-agent-from-scratch-course/demo-2-bug-hunt"><img src="https://agentmods.dev/badge/skills/decodingai-magazine/building-a-coding-agent-from-scratch-course/demo-2-bug-hunt.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 621 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00038 $0.00621
Opus 5 $0.00019 $0.00311
Sonnet 5 $0.00008 $0.00124
Haiku 4.5 $0.00004 $0.00062

Measured 10d ago against content hash 5c967167f0e2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade C, and why

demo-2-bug-hunt scanned grade C with 1 finding 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 10d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (references/buggy_repo/stats.py, references/buggy_repo/test_stats.py), 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

`rm -rf .decode/outputs/bug-hunt && mkdir -p .decode/outputs && cp -r .decode/skills/demo-2-bug-hunt/references/buggy_repo .decode/outputs/bug-hunt`
.decode/skills/demo-2-bug-hunt/SKILL.md · 51 lines

How it starts

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

Play detective on a small statistics package: reproduce the failures, hunt down the bugs, fix them until every test passes, and file a case report.

Setup

  1. Copy the seeded project into a working directory you own (fresh — delete a stale one first): rm -rf .decode/outputs/bug-hunt && mkdir -p .decode/outputs && cp -r .decode/skills/demo-2-bug-hunt/references/buggy_repo .decode/outputs/bug-hunt
  2. Change into it and run the suite to see the failures: cd .decode/outputs/bug-hunt/ && uv run pytest -q
  3. Save the crime scene: keep the exact failing-test output — the failure names and the expected-vs-actual values — you will quote it in the case file at the end.

Exactly two tests fail as committed — one in median, one in variance. Do NOT edit the tests; they encode the correct behaviour. Fix stats.py instead.

Hunt

Track the investigation with todo_write (reproduce → suspect A → suspect B → verify → case file) and tick items off as you close them.

  • Read test_stats.py to learn the contract each failing test asserts (the expected values are the spec).
  • Read stats.py and locate the defect behind each failure with grep/read. The LSP diagnostics that surface on your edits will help you catch typos and type slips as you go.
  • There are two independent bugs:
    • median returns the wrong element for odd-length inputs (an indexing off-by-one).
    • variance comes back with the wrong sign (it should never be negative).

Fix and verify

  1. Fix the root cause of each bug in stats.py — the smallest correct change, not a special case that only satisfies the one test input.
  2. Re-run uv run pytest -q and confirm the whole suite is green. Keep that green one-liner too.

File the case report

Write .decode/outputs/bug-hunt/CASE_FILE.md — short, punchy, detective-flavoured:

  • The symptoms — the failing test names and the quoted expected-vs-actual output from setup step 3.
  • The culprits — one section per bug: the guilty line (stats.py:<line>), the root cause in one sentence, and the before/after of the fixed line.
  • Case closed — the quoted green pytest -q summary line proving the suite passes.

Read the full file on GitHub · 51 lines

Files

What ships with it

2 files 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. 10d ago First seen · 51 lines · 38 tokens per session scan C 5c967167f0e2

Subscribe to this mod's changes

demo-2-bug-hunt is a skill published in the GitHub repository decodingai-magazine/building-a-coding-agent-from-scratch-course (374 stars, last pushed today), licensed Apache-2.0. It adds 38 tokens to every session and 621 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). 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

openocd

A toolkit for programming and debugging microcontrollers through hardware probes such as ST-Link or CMSIS-DAP. OpenOCD can act as a GDB Server, allowing a debugger to inspect source code, registers, memory, breakpoints, and program execution.

zhinkgit/embeddedskills · 247 tokens

serial

A tool for communicating with devices over serial ports, such as USB-to-UART connections. It can find ports, watch incoming data, send messages, save logs, and display raw bytes in hexadecimal form.

zhinkgit/embeddedskills · 137 tokens

gcc

A build tool for embedded CMake projects using arm-none-eabi-gcc, a compiler that turns code into firmware for ARM microcontrollers. It supports CMake presets, which are saved build configurations.

zhinkgit/embeddedskills · 162 tokens

net

A toolkit for diagnosing network connections and traffic in embedded systems. A packet capture is a recorded sample of network traffic, and this tool can create or analyze captures in formats such as pcap and pcapng.

zhinkgit/embeddedskills · 234 tokens

probe-rs

A command-line tool wrapper for probe-rs, which connects a computer to a microcontroller through a hardware debug probe. It supports common firmware programming and debugging operations over SWD or JTAG.

zhinkgit/embeddedskills · 182 tokens

terminal

An interactive terminal session that keeps a live connection to a local shell, an SSH remote computer, or a serial device. It lets you send commands and read the next output while preserving the session’s login, menu, or program state.

zhinkgit/embeddedskills · 105 tokens