debug-sweep

debug-sweep is a command for Claude Code from keez97/phase-gate. It costs 37 tokens per session (953 once invoked), scanned A, original, MIT.

A command that runs several focused bug-audit passes on the changes made for a coding plan.

In plain words
What is it for?
Use it to run correctness, robustness, architecture, or adversarial sweeps, choose the review severity, and collect findings in the plan's sweep directory.
Why use it?
It organizes repeated reviews so different kinds of problems can be checked without changing the code automatically.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md.

Part of the phase-gate plugin — 4 commands, 3 agents shipped together

Good fit Use it to run correctness, robustness, architecture, or adversarial sweeps, choose the review severity, and collect findings in the plan's sweep directory.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/keez97/phase-gate/debug-sweep
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.

Clone the repo
git clone --depth 1 https://github.com/keez97/phase-gate

Made for: Claude Code.

Or install phase-gate, the plugin that ships this one along with the rest of its 4 commands, 3 agents.

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 debug-sweep

README.md
[![agentmods](https://agentmods.dev/badge/commands/keez97/phase-gate/debug-sweep/github.svg)](https://agentmods.dev/commands/keez97/phase-gate/debug-sweep)
Your own site
<a href="https://agentmods.dev/commands/keez97/phase-gate/debug-sweep"><img src="https://agentmods.dev/badge/commands/keez97/phase-gate/debug-sweep/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 debug-sweep

Your own site · 80×15
<a href="https://agentmods.dev/commands/keez97/phase-gate/debug-sweep"><img src="https://agentmods.dev/badge/commands/keez97/phase-gate/debug-sweep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 953 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00037 $0.00953
Opus 5.5 $0.00015 $0.00381
Sonnet 5.5 $0.00007 $0.00191
Haiku 4.5 $0.00004 $0.00095

Measured 3mo ago against content hash 25ad724902cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

debug-sweep 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 3mo 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.

commands/debug-sweep.md · 84 lines

How it starts

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

/debug-sweep — Adversarial Post-Implement Audit

Fires N sequential debug-agent sweeps against a plan's implementation diff. Each sweep uses a distinct lens (correctness / robustness / architecture / adversarial). Findings go to the plan's own sweeps/ directory: <plan-dir>/sweeps/. Flag-only — no code is modified.

Invocation

/debug-sweep <plan-path>                            Auto-severity (from diff)
/debug-sweep <plan-path> --severity critical        Force severity level
/debug-sweep <plan-path> --base <commit>            Override diff base (default: HEAD~1)
/debug-sweep <plan-path> --lens robustness          Run only specific lens(es)
/debug-sweep <plan-path> --no-aggregate             Skip summary report
/debug-sweep <plan-path> --severity-paths-config <file>
                                                    Override the critical-path marker
                                                    list (default: scripts/debug-severity-paths.txt)

Under the hood: scripts/debug-sweep.sh.

Severity → sweeps

Severity Sweeps Lenses
low 0 (skipped)
medium 2 correctness, robustness
high 3 + architecture
critical 4 + adversarial

Severity is auto-classified by scripts/debug-severity.sh:

  • Docs-only diff → low
  • Critical-path match (default list at scripts/debug-severity-paths.txt; override with --severity-paths-config) → critical
  • New agent / hook / command / script → high
  • Multi-file or >50 insertions → medium

The default critical-path list is empty in phase-gate — it ships as a stub for projects to populate with their own load-bearing path globs (e.g. scripts/payments/, lib/auth/). Pass --severity-paths-config <file> to point at a project-local list without modifying the plugin tree.

When to run

Manual: any time you want a second pass on recent work. Ideal targets:

  • Just-shipped plans that touched critical infrastructure
  • Plans where the original author had limited bandwidth for self-review
  • Refactors that crossed multiple modules

Read the full file on GitHub · 84 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. 3mo ago First seen · 84 lines · 37 tokens per session scan A 25ad724902cf

Subscribe to this mod's changes

debug-sweep is a command published in the GitHub repository keez97/phase-gate (1 stars, last pushed 7mo ago), licensed MIT. It adds 37 tokens to every session and 953 once invoked, about $0.0001 per session on Opus 5.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.

Related

debug-sweep compared with commands from other repositories

debug-sweep next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
debug-sweepkeez97/phase-gateCommand17mo agoMITA37Claude Code
bugolehsvyrydov/AI-development-teamCommand1814d agoMITA19Claude Code
issueolehsvyrydov/AI-development-teamCommand1814d agoMITA26Claude Code
debugHigorAlves/orcCommand76d agoMITA53Claude Code
ccc-debug-sessionKevinZai/commanderCommand6todayMITA42Claude Code
ciHigorAlves/orcCommand76d agoMITA47Claude Code
bifrost-debugneXenio/bifrost-pluginCommand522d agoMITA18Claude Code