code-debugger

A structured workflow for debugging existing code or adding small features. It maps the relevant call chain and data dependencies, records decisions in .debug files, and verifies the change.

In plain words
What is it for?
Use it to trace variables and module interactions, fix bugs, investigate performance issues, make incremental changes, and document how to check the result.
Why use it?
It helps identify the real source of a bug while limiting unrelated edits. It also avoids running tests in the wrong place when code is on a remote server or network-mounted drive.

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/samqin123/claude_skill_pool/code-debugger
Any agent
npx skills add samqin123/Claude_skill_pool --skill code-debugger
Clone the repo
git clone --depth 1 https://github.com/samqin123/Claude_skill_pool

Made for: Claude Code, Codex.

Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,102 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00063 $0.02102
Opus 5 $0.00032 $0.01051
Sonnet 5 $0.00013 $0.00420
Haiku 4.5 $0.00006 $0.00210

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

Security

Grade C, and why

code-debugger 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 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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

- 若无,则指导用户建立公钥-私钥登录(`ssh-keygen` + 将公钥写入远程 `~/.ssh/authorized_keys`),并确认**项目在远程机器上的实际路径**(如 `/mnt/dev/xxx`、`/home/user/proj`)。
package/full-dev-脚手架/.codex/skills/code-debugger/SKILL.md · 136 lines

How it starts

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

Code Debugger

Overview

在修改代码前先建立完整上下文关系网络,最小化变更并记录可追溯的调试文档,确保修复可验证、可回滚、可复盘。

开发环境与运行上下文(优先确认)

执行验证、测试或 Checkfix 之前,务必确认项目的「部署-开发」架构,避免在错误环境中跑命令导致死循环或无法推进:

  • 常见形态:本机 Windows 开发;WSL 内开发;内网 NAS 或云服务器上代码通过 Samba 挂载到 Windows 盘符,在本地 IDE 编辑,但实际运行/测试需 SSH 登录远程执行
  • 若无法从仓库或路径推断:主动问开发者一句,例如:「项目是否在 NAS/Samba+SSH 或远程服务器上开发?当前是怎么跑测试/构建的?」
  • 若是远程/NAS-Samba+SSH 形态
    • 询问是否已有现成的 SSH 登录方式(如 ssh nasssh dev 等别名或主机配置)。
    • 若无,则指导用户建立公钥-私钥登录(ssh-keygen + 将公钥写入远程 ~/.ssh/authorized_keys),并确认项目在远程机器上的实际路径(如 /mnt/dev/xxx/home/user/proj)。
    • 后续验证与 Checkfix 的 shell 命令应在该上下文中执行(例如 ssh nas "cd /mnt/dev/xxx && cargo test"),而不是在本地 Samba 映射路径下直接执行,以保障调试流畅、节省成本并防止 AI 反复无效尝试。
  • 首次与用户确认后,将上述判断结果写入当前模块的 .debug 文档,作为「运行上下文/测试规则」(运行环境类型、SSH 方式、远程项目路径、验证/Checkfix 执行方式等)。后续再调用本命令时,优先从 .debug 读取该规则,不再反复询问。

Workflow

1. 上下文构建

  • 解析用户任务,识别涉及模块与边界。
  • 使用 rg/文件浏览定位入口与相关模块,梳理调用链、变量依赖和数据流向。
  • 检查 .debug/:若已有同模块记录则加载;若模块不同则新建,避免混杂上下文。
  • 评估影响范围与潜在回归点,只改必要代码。

2. 问题定位与实施

  • 基于上下文网络定位根因,给出 1-2 个方案并评估风险。
  • 采用最小改动原则实施修复或增量功能,保持现有架构与风格一致。
  • 添加必要的边界检查和错误处理。

3. 验证与记录

  • 运行现有测试或提供明确的手动验证步骤。
  • Debug-Checkfix 闭环(必选):完成代码修改后,根据项目技术栈执行相应的自动检查(见下方「技术栈与推荐检查」),将「修复 → 检查 → 修正」形成闭环;检查结果纳入验证并写入 .debug/
  • 更新 .debug/ 记录:问题、根因、变更、验证(含 checkfix 结果)、影响评估。
  • 根据反馈迭代修复与文档。

4. 文档同步与部署约束(必选)

  • 前端功能变更:必须同步更新 docs/ 用户说明书,默认面向零基础用户,步骤写到可直接照做。
  • 后端/API/环境变更:必须同步更新开发与部署文档,明确命令、执行顺序、预期输出、失败排查与回滚。
  • 每次功能或环境更新后,必须检查既有部署指导是否需要联动修改(如 docs/DEPLOYMENT.mddocs/README.md)。

技术栈与推荐检查(Checkfix 闭环)

读取本 skill 的编程工具应在 debug 完成后自动考虑执行下列检查,减少开发者反复提醒的负担:

技术栈/类型 推荐检查 说明
Python 优先 uv venv + uv sync(或 uv pip install -r requirements.txt),并执行 ruff check .ruff format --check .black --check . 部署优先级:uv(非 uvicorn)> 直接部署 > conda
前端 (Node/npm) npm install(依赖变更时)、npm run lintnpx eslint .,可选 npm run build 依赖与静态检查,优先用 package.json scripts
PyTorch (GPU) uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124(按目标 CUDA 版本调整) 有 NVIDIA GPU 时优先 CUDA 包,并补充 CPU 回退命令
Rust cargo checkcargo clippy 编译与 Clippy
Go go build ./...gofmt -l .golangci-lint run 编译与格式/静态检查
Java/Kotlin (Maven) mvn compilemvn verify 编译与测试
Java/Kotlin (Gradle) ./gradlew compileJava./gradlew check 同上
C# / .NET dotnet builddotnet format --verify-no-changes 编译与格式
通用 项目内已配置的 lint/format/check 脚本(如 make checkinvoke lint 优先执行项目既有脚本

Read the full file on GitHub · 136 lines

Files

What ships with it

1 file 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. yesterday First seen · 136 lines · 63 tokens per session scan C b36688c8884c

Subscribe to this mod's changes

code-debugger is a skill published in the GitHub repository samqin123/Claude_skill_pool (2 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 63 tokens to every session and 2,102 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens