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.
npx agentmods add skills/nschneir/pet-project/6502-debuggingnpx skills add nschneir/PET-Project --skill 6502-debugginggit clone --depth 1 https://github.com/nschneir/PET-ProjectWrote 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.
[](https://agentmods.dev/skills/nschneir/pet-project/6502-debugging)<a href="https://agentmods.dev/skills/nschneir/pet-project/6502-debugging"><img src="https://agentmods.dev/badge/skills/nschneir/pet-project/6502-debugging.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00053 | $0.01306 |
| Opus 5 | $0.00026 | $0.00653 |
| Sonnet 5 | $0.00011 | $0.00261 |
| Haiku 4.5 | $0.00005 | $0.00131 |
Grade A, and why
6502-debugging 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.
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.
How it starts
The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.
6502 debugging playbook
Procedures that turn a symptom into a verified cause using pet commands.
Follow the procedure before forming theories — each one exists because
improvising in its situation reliably wastes time. The companion
references are the pet-development skill's diagnosis table (quick
symptom→cause lookups) and the 6502-assembly skill's gotchas (the bugs
you write, rather than find).
Rule zero: prove you are debugging the binary you think you are
The most expensive class of debugging failure is the hunt for a "bug" that does not exist: a rebuild failed silently and every observation is of the previous binary. Before trusting any runtime evidence:
pet status— read theprogram:line and look forSTALE (source changed since load). Stale means rebuild and reload before doing anything else.- If in doubt, spot-check code bytes:
pet mem read <label> 8and compare against the assembler listing. Two minutes here beats hours of fiction-driven debugging. - A failed
pet runsays loudly that the emulator still runs the previous program. Believe it.
Triage: the first three commands
For any misbehavior, in order: pet status (running or stopped? stale?),
pet screen (what does the program think is happening?), pet reg (where
is PC — in your code, in ROM, or in the weeds?). If PC is in unmapped or
BSS space, the crash already happened; the question becomes "what jumped
here," not "what is wrong here."
Something is corrupting memory
Symptom: a variable changes that "nothing writes to"; code bytes change; behavior degrades over time. Do not read code looking for the writer — trap it:
pet watch add <addr> --store
pet wait --break <ID>
The machine halts ON the writing instruction; pet reg and the PC symbol
name the culprit. Pass the watchpoint's ID to --break so a leftover
breakpoint cannot intercept the wait. One watchpoint routinely finds in
seconds what an hour of code-reading cannot. If the writes are legitimate
but wrong (right routine, wrong index), add a condition:
pet break add <label> --condition 'X > 4'.
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.
- 3d ago First seen · 116 lines · 53 tokens per session scan A 95b14edd17d6
6502-debugging is a skill published in the GitHub repository nschneir/PET-Project (1 stars, last pushed 11d ago), licensed MIT. It adds 53 tokens to every session and 1,306 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-31.
Other skills, from other repositories
c64-development
Use when developing, running, or debugging Commodore 64 software (Commodore BASIC or 6510/6502 assembly) on the VICE emulator with the c64 CLI or the c64-tools MCP server. Covers the build/run/observe/debug loop, the stopped-state discipline, C64 text encodings, graphics and sprites, and the memory map.
6502-assembly
Use when writing or debugging 6502 assembly for the Commodore 64 with ca65/ld65 via c64 build or c64 run. Covers the C64 program skeleton, the BASIC SYS stub, calling ROM routines, and 6502 gotchas.
cartridge-programming
Use when writing, building, or debugging a Commodore 64 cartridge — plain 8K/16K/Ultimax or bank-switched EasyFlash — with the c64 CLI or the c64-tools MCP server. Covers the two boot mechanisms (CBM80 vs the $FFFC reset vector), the memory modes, cart-native code in ROM, the EasyFlash banking discipline from…
disk-io-programming
Use when a Commodore 64 program has to touch a disk while it runs — loading levels, music or graphics on demand, saving a high-score file, or streaming a data file byte by byte. Covers the KERNAL LOAD/SAVE and channel calls, device and secondary-address conventions, reading the DOS error channel, and the…
6502-debugging
Use when a C64 program misbehaves at runtime — crashes, corruption, wrong values, dead input, visual glitches — and you need a procedure, not a guess. Symptom-indexed playbook of runtime debugging procedures using c64-tools.
git-workflow-and-versioning
Structures git workflow practices. Use when making any code change. Use when committing, branching, resolving conflicts, or when you need to organize work across multiple parallel streams.