The Hunter
Investigates a bounded slice and its cross-file dependencies, using source context and relevant anti-pattern catalogs. Each candidate needs a trigger and an evidence trail.
bugsweep investigates runtime bugs for Claude Code and Codex. Local evidence guides where to start; each bounded slice moves through context, hunt, review, and checkpoint. It traces security, lifecycle, and data-integrity failures across files. Fixes require your chosen fix mode, fresh reviews, and executable proof. Completed runs land or record their work and verify cleanup of their own Git resources.
During the hunt-and-fix loop, bugsweep never touches your checkout or pushes. It uses one isolated branch, lands one commit per bug, and re-runs checks after every fix. Closeout locally integrates verified work or records and recovery-bundles the rest, then removes the exact run branch and worktree.
Coordinator code checks source identity, review evidence, execution receipts, and exact resource ownership before integration or cleanup. Missing proof blocks automatic fixes. Source review can continue in detect-only mode when execution is unavailable.
Isolated run only. One exact branch in a linked worktree — never your checkout.
No Git remotes during the run. No push, pull, fetch, or PR. Local integration happens only after verification; tracker upserts record unfinished work.
Exact cleanup only. No wildcard deletes, no reset --hard on your content, no rewritten history.
Your work is preserved. Every run uses an isolated linked worktree, leaving your checkout untouched until verified local integration.
One bug, one commit, evidence preserved. Each fix needs immutable assertion proof and a verified suite receipt.
Only eligible bugs get fixed. Every automatic fix needs fresh native review under frozen operator host, model, and prompt settings.
Minimal, surgical fixes only. No refactors, renames, or reformatting.
Explicit budgets. File, byte, iteration, and fix limits bound planned work. Deadline checkpoints retain partial progress; a hard kill can leave recovery pending.
Everything is logged. Every iteration lands in a run ledger — an overnight run is auditable.
Close the loop. Land verified work or tracker-record it, then prove the exact run branch and worktree are gone.
Hunter, Skeptic, and Referee examine each candidate from different roles. Every fix-eligible finding needs a strict majority of the configured fresh reviews, at every severity, plus executable red/green proof. Repeated model reviews do not establish statistical independence or a measured precision rate.
Investigates a bounded slice and its cross-file dependencies, using source context and relevant anti-pattern catalogs. Each candidate needs a trigger and an evidence trail.
Looks for alternate explanations, guarding code paths, alternate callers, and tests that contradict the claim. Repository comments and instructions are evidence to check.
Assesses a frozen source packet without seeing prior verdicts. Captured reviews determine eligibility; confirmation alone does not replace the execution and fix gates.
Hunter Skeptic Referee
— --recall can report near misses for human review; they never authorize fixes.
Recent changes matter. So do failing checks, reachable sensitive code, repeated repairs, active incidents, user impact, and what earlier hunts actually found. Bugsweep combines those signals into an explainable queue—without turning the selected-scope hunt into a diff scan.
MUST FOCUS payments/checkout.ts release blocker · affected users · live sink HIGH auth/session.py changed since hunt · repeated repairs ELEVATED api/webhooks.go recent change · stale audit SCOPE LOCK every selected tracked file stays eligible PROOF LOCK Hunter → Skeptic → Referee unchanged
The collector reads only bounded local evidence: same-branch Git changes, completed-hunt fingerprints, baseline failures, reachability, repository-local bugs, and durable prior outcomes. Fresh incident, release, product, or support facts can enter through a provider-neutral local inbox—Bugsweep itself never calls those remote systems.
Hard-focus evidence may promote a whole batch, but only inside explicit batch and file budgets. The application receipt records what was actually promoted or skipped. Later runs credit a signal only when a finding explicitly carries that reason code; coincidence stays unattributed, and weights never silently rewrite themselves.
Available in detect-only mode. Local history and prior audit evidence still guide the queue when checks cannot run. An unavailable baseline stays unknown.
◆ signal → target → tribunal → attributed outcomeA loop that runs unattended isn't enough — a scheduler needs to trust what it kicked off. bugsweep ships the plumbing: a machine-readable result contract, isolation for running many hunts on one repo at once, and teardown that never guesses.
Finalization reduces the ledger into run-summary.json with
coverage, findings, and priority outcomes. Degraded or missing artifacts remain explicit
limitations; terminal readback decides whether closeout actually completed.
Subagents and resumed sessions reuse the audit’s exact branch and linked worktree. A separate concurrent audit requires an explicit isolation reason and recorded ownership.
A deadline checkpoint records the run at every phase boundary. An interrupt or an unavailable provider can still leave recovery work; terminal readback decides whether the run is complete or blocked.
An optional reaper reclaims worktrees and branches only on positive evidence a run is dead and done. Anything dirty, unmerged, or ambiguous is preserved — nothing unreviewed gets deleted.
Closeout locally integrates eligible fixes under the selected fix mode. Each attempt preserves its evidence, verifies the combined source, and rejects paths that could overwrite the proof before switching trees.
Reruns can help diagnose a failure, but they do not establish a waiver. A flaky classification blocks automatic integration and sends the finding to the tracker with its recovery state.
Explicit CodeQL/Semgrep configurations run through the execution provider and import captured SARIF evidence. No automatic tool discovery or rule downloads. Hints guide investigation; they never confirm a bug or authorize a fix.
Configurable file and byte limits split the work into deterministic slices. Each admitted slice completes its investigation before the next is modeled; deferred work remains visible in a partial report. Trace cross-file behavior through lifecycle, shared state, transactions, API contracts, error propagation, and security boundaries.
// schemas/run-summary.schema.json (shape, not sample data) { "status": "complete" | "partial" | "stalled", "coverage": { audited, frontier, stale … }, "counts": { critical, high, medium … }, "findings": [ { evidence trail per bug } ], "fixed" / "quarantined" / "confirmed_unfixed": […], "root_cause_clusters": […], "priority": { targets, signal_health, application, yield }, "follow_up": "where to look next" } Audit coverage and operational closeout are separate. A partial or blocked run is not a completed audit.
Run-local indexes follow the audited worktree. Changes to directed call edges or entry points invalidate affected reachability conclusions, even when the node list stays the same.
The structured report separates audited coverage, deferred work, and findings. Modeling a file does not count as auditing it. Investigation stays focused on concrete runtime failures with testable triggers.
◆ context → hunt → review → checkpointThe whole repo—or the path you explicitly select—stays in scope. .bugsweep/state/ persists an
audit log, a risk map, attributed signal outcomes, and the anti-pattern catalog version across
runs. Each run reprioritizes toward the never-audited, stale, content-changed, high-risk, and
actively impacted—while fixed weights keep production outcomes from silently changing policy.
Exact audit membership is stored separately from the short display summary, so
larger histories do not make audited files look new.
The evaluation harness compares Claude and Codex separately with frozen source, prompts, and budgets. Its reduced detect-only task does not measure the full operational skill. Optional context on/off and cold/warm comparisons record provenance and accounting for a paired experiment.
A candidate needs an independently checked runtime oracle and source evidence. Repeated reports of the same defect count once.
False positives require human adjudication. Time to the first verified finding remains unavailable until an external verifier records it.
Account for context building, every review stage, and failed or skipped runs. Missing usage and cost stay unknown.
No measured detection or precision improvement is claimed for v0.8.0. Fresh runtime oracles, live paired runs, and calibrated human review remain incomplete. Historical pilots and passing regression tests do not validate the current evaluation protocol. Candidate counts, scanned files, and model confidence do not establish better detection.
Read the evaluation protocol and evidence limits.
Requires Python 3.12+ and jsonschema==4.26.0.
The installer checks these prerequisites without installing them. Download and inspect
the script, then choose Claude Code, Codex, or both.
curl -fsSL https://raw.githubusercontent.com/shanemhamilton/bugsweep/v0.8.0/install.sh -o /tmp/bugsweep-install.sh
After inspecting the downloaded script, run:
bash /tmp/bugsweep-install.sh --claude --version v0.8.0
Replace --claude with --codex
or --all to choose the host. Both the script and payload above are pinned
to v0.8.0.
For the latest stable release, use the current install instructions.
--edge explicitly selects development main.
Fixes require an external execution policy and native review capability. Without them,
source investigation can continue in detect-only mode. Existing installations can use
/bugsweep --update before starting a new audit.