KilimcininKorOglu/claude-code-mods/tree/main/plugins/bughunt
bughunt
/bughunt:를 사용하여 증명 기반 버그 찾기 라운드를 실행합니다. 각 라운드는 모드가 자체적으로 실행하고 수정하고 수정 사항을 증명하는 실패한 명령으로 one 버그를 증명하며 루프는 차단되거나 확인되지 않은 라운드에서 중지됩니다. /bughunt collab은 읽기 전용 스캐너, 플래너, 비평가를 차례로 실행합니다.
이 mod 소개
버그헌트
버그 찾기 프롬프트는 버그를 수정하기 전에 모델에 버그를 증명하라고 지시하며, 모델은 수정 사항을 먼저 작성하고 테스트를 통과한 후에 작성하는 경우가 많습니다. 이 모드는 라운드별로 사냥을 실행하고 각 라운드를 증거로 유지합니다. 모델은 증명 명령을 작성하고, 모드는 이를 자체적으로 실행하며, 증명이 FAIL 라인을 사용하여 비zero를 종료할 때까지 프로덕션 코드는 변경되지 않은 상태로 유지됩니다. 동일한 명령이 PASS 라인을 사용하여 0를 종료하고 모드가 잠시 동안 수정 사항을 되돌리면 다시 실패하는 경우에만 라운드가 수정된 것으로 간주됩니다. 루프는 각 라운드의 결과를 읽고 다음 one를 시작하는 대신 차단되거나 확인되지 않은 라운드에서 중지됩니다.
/bughunt collab <paths>는 두 번째 읽기 전용 모드입니다. 스캐너, 플래너 및 비평가 하위 에이전트가 차례로 경로를 검토하고 보고서에는 결과, 계획 및 비평가의 평결이 포함됩니다.
기능
라운드
-
/bughunt [--rounds N] [target]는 대상 또는 전체 프로젝트에 대해 1에서 25 라운드 사냥을 시작합니다.--rounds는 인수 중 어디에나 있을 수 있습니다. 사냥은 세션의 어느 시점에서나 시작됩니다. -
Mod는 각 라운드를 프롬프트로 보냅니다: 라운드 번호, 범위, 라운드의 증명 디렉터리(
.temp_files/bughunt/<round>/), 이전 라운드의 지문 및 프로토콜. 모델은 먼저 전체 규칙을 보유하는bughunt:hunt기술을 엽니다. 라운드가 실행되는 동안 모드는 라운드의 블록을 스킬 텍스트에 추가합니다. -
라운드가 진행되는 동안:
- 라운드에서 스킬이 공개될 때까지 편집, 쓰기 및 노트북 편집이 중지됩니다.
- 증명 디렉토리 외부의 편집은 모드가
FAIL를 기록할 때까지 중지됩니다. - 대상이 있는 경우
FAIL이후에도 대상 외부의 편집이 중지됩니다. 테스트 파일(tests/,__tests__/,*.test.*,*.spec.*,*_test.*,test_*.py)이 통과하므로 회귀 테스트가 제품군에 들어갈 수 있습니다. - 모든 하위 에이전트 생성이 중지됩니다. one 대화에서 라운드가 실행됩니다.
-
모델은
phase: "before"및 증명 명령의argv를 사용하여mcp__bughunt__proof를 호출합니다. mod는 명령을 실행하고(최대 5분)FAIL가 아닌 zero를 종료하고FAIL로 시작하는 줄을 인쇄할 때만FAIL를 기록합니다. 그러한 줄을 인쇄하지 않는 설정 또는 가져오기 오류는 거부됩니다. 수정 후 동일한argv를 사용하는phase: "after"는 명령을 다시 실행하고 0와PASS로 시작하는 줄을 종료해야 합니다. 모델은 종료 코드, 출력의 마지막 20 라인 및 이유를 읽습니다.5.PASS를 기록하기 전에 Mod는 증명이 수정 사항에 도달했는지 확인합니다.FAIL가 기록되면 작업 트리(스태시 항목을 추가하지 않는git stash create또는 클린 트리의HEAD)의 스냅샷을 찍었습니다. 승인된PASS실행 후 해당 스냅샷(git diff --diff-filter=M) 이후 수정된 파일을 나열하고 증명 디렉터리와 테스트 파일을 제외하고 작업 트리(git restore --source, 인덱스는 그대로 유지됨)의 스냅샷으로 복원합니다. 증명을 다시 실행한 다음 수정 사항을 다시 적용합니다.PASS는 되돌린 실행이FAIL라인을 사용하여 비zero를 종료하는 경우에만 계산됩니다. 그렇지 않으면 호출이 거부되고 모델은 증명을 수정하고 다시 호출할 수 있습니다. 모델은 각 경우의 이유를 읽습니다.- 수정 사항을 되돌린 상태에서 증명이 통과되므로 수정된 코드에 도달하지 않습니다.
FAIL이후 프로덕션 파일이 수정되지 않았습니다.- 디렉토리가 git 저장소가 아닙니다.
- git 명령이 실패했습니다.
수정 사항이 되돌려지는 동안 모드는
$.store에 기록을 유지합니다. 충돌로 인해 검사가 중단되면 되돌린 파일이 여전히 변경되지 않은 경우 동일한 디렉터리의 다음 세션에서 수정 사항을 다시 적용합니다. 이후 변경된 경우 덮어쓰지 않고 수정 사항을 다시 가져오는git restore명령을 알려줍니다. -
라운드의 차례가 끝나면 모드는 답변의 결과 줄을 읽습니다. 즉, 결과 레이블로 시작하는 첫 번째 줄이므로 이전 문장은 숨기지 않습니다.
fixed-and-verified는 모드가 라운드에서FAIL를 기록한 다음 /bughunt [--rounds N] [target] start a hunt of N rounds (1 by default, 25 at most) /bughunt collab <paths> a read-only scanner, planner and critic review /bughunt stop end the running hunt /bughunt status on or off, and the running round /bughunt on | off on by default; off starts nothing and holds no edit Q를 기록한 경우에만 계속됩니다. 그렇지 않으면 사냥이 중지됩니다.no-proven-bug가 계속됩니다.blocked,fixed-verification-incomplete, 결과 라인 없음, 인터럽트 또는 API 오류로 인해 헌트가 중지됩니다.- 마지막 라운드가 끝나면 사냥이 종료됩니다.
각 답변의
fingerprint:라인은 다음 라운드의 프롬프트로 이동하므로 동일한 근본 원인이 두 번 계산되지 않습니다. -
당신이 직접 작성하는 프롬프트는 사냥을 종료합니다.
/bughunt명령은 그렇지 않습니다.
콜라보
/bughunt collab <paths>또는 모델의mcp__bughunt__collab도구는 three 하위 에이전트를 차례로 시작합니다. 이는 모델의 에이전트 목록에서 숨겨진 모드의 자체 에이전트 유형(bughunt:scanner,bughunt:planner,bughunt:critic)이며 각각Read,Grep,Glob만 읽을 수 있습니다.- 스캐너는
mcp__bughunt__found(파일, 행, 심각도, 설명, 선택적 수정 사항)를 사용하여 각 결과를 한 번에 보고합니다. 모드는 필드를 확인하고 결과를 유지합니다. 실행 중인 스캐너만 도구를 호출할 수 있습니다. - 플래너는 결과와 스캐너의 보고서를 받고 수정 계획을 작성합니다. 비평가는 조사 결과와 계획을 받고
verdict: approve,revise또는reject로 답변을 시작합니다.4. 각 단계에는 시간 제한이 있습니다(스캐너 10, 플래너 ❯ ./register.ts hooks: session.start, command.run{command=bughunt}, agent.offer{agent=/"^bughunt:(scanner|planner|critic)$"/}, tool.describe{tool=/"^mcp__bughunt__(proof|found|collab)$"/}, tool.call{tool=/"^mcp__bughunt__proof$"/}, tool.call{tool=/"^mcp__bughunt__found$"/}, tool.call{tool=/"^mcp__bughunt__collab$"/}, prompt.submit, skill.prompt{skill=bughunt:hunt}, tool.call{tool=Skill}, tool.call{tool=Edit}, tool.call{tool=Write}, tool.call{tool=NotebookEdit}, agent.spawn, turn.complete ❯ ./register.ts calls: $.agent.register (via declare), $.agent.spawn (via portsOf), $.clock.after (via portsOf, send), $.command.register (via declare), $.command.run (via send), $.process.run (via git, recoverFix, runProof), $.prompt.submit (via send), $.sidebar.clear (via show), $.sidebar.set (via show, toPerson), $.store.delete (via putBack, recoverFix), $.store.get (via readSettings, recoverFix), $.store.set (via revertCheck, setEnabled), $.tool.register (via declare), $.ui.log (via launchCollab, send, toPerson) Q 비평가 6분). 실행되는 단계는 보고서에서timed-out로 이름이 지정되며 그 전에 스캐너가 보낸 결과는 보고서에 유지됩니다. - 비평가가 평결을 내리지 않으면 평결은
no-verdict이지 결코approve가 아닙니다. - 스캐너가 시작되면 명령과 도구가 반환됩니다. 보고서는 나중에 one 메시지로 도착하고 모델은 이를 읽기 전용 검토로 읽습니다. 한 단계의 반환 메시지는 모드에 의해 취해져서 삭제되므로 자체적으로 차례를 시작하지 않습니다.
- 라운드가 진행되는 동안에는 공동 작업이 시작되지 않습니다.
당신이 보는 것
사이드바에는 라운드, 스킬 공개 여부, 증명 상태, 완료된 각 라운드의 결과 및 지문 등 bughunt 섹션이 표시됩니다. 중지된 편집, 증명 결과 및 검색 종료는 사이드바 스트림으로 이동됩니다. 사이드바가 없으면 각각 bughunt: edit stopped (proof): src/a.ts와 같은 one 성적표 라인입니다.
명령
/bughunt [--rounds N] [target] start a hunt of N rounds (1 by default, 25 at most)
/bughunt collab <paths> a read-only scanner, planner and critic review
/bughunt stop end the running hunt
/bughunt status on or off, and the running round
/bughunt on | off on by default; off starts nothing and holds no edit
설치
claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install bughunt@kilimcininkoroglu-mods
함수 후크는 조기 액세스입니다. Claude Code 2.1.288 이상에서는 기본적으로 로드하므로 스위치를 켤 것이 없습니다.
설치 후
- Claude Code를 다시 시작하십시오.
- 명령줄에서 테스트를 실행할 수 있는 저장소에서
/bughunt를 실행하세요. 증명 명령은 사용자의 권한으로 실행되므로 모델이 제안하는 내용을 읽어보세요.
도달할 수 있는 것
Claude Code 2.1.284에서 claude plugin validate로 검증됨:
❯ ./register.ts hooks: session.start, command.run{command=bughunt}, agent.offer{agent=/"^bughunt:(scanner|planner|critic)$"/}, tool.describe{tool=/"^mcp__bughunt__(proof|found|collab)$"/}, tool.call{tool=/"^mcp__bughunt__proof$"/}, tool.call{tool=/"^mcp__bughunt__found$"/}, tool.call{tool=/"^mcp__bughunt__collab$"/}, prompt.submit, skill.prompt{skill=bughunt:hunt}, tool.call{tool=Skill}, tool.call{tool=Edit}, tool.call{tool=Write}, tool.call{tool=NotebookEdit}, agent.spawn, turn.complete
❯ ./register.ts calls: $.agent.register (via declare), $.agent.spawn (via portsOf), $.clock.after (via portsOf, send), $.command.register (via declare), $.command.run (via send), $.process.run (via git, recoverFix, runProof), $.prompt.submit (via send), $.sidebar.clear (via show), $.sidebar.set (via show, toPerson), $.store.delete (via putBack, recoverFix), $.store.get (via readSettings, recoverFix), $.store.set (via revertCheck, setEnabled), $.tool.register (via declare), $.ui.log (via launchCollab, send, toPerson)
L2에 도달하면 모델 이름에 대한 증명 명령이 실행됩니다.
1. Reads: the path of each Edit, Write and NotebookEdit call; your prompts, only to see whether you wrote one; each round's final answer; the collab subagents' answers
2. Runs: the proof command the model passes to mcp__bughunt__proof, as argv without a shell, in the working directory or the cwd it names, for 5 minutes at most, a second time with the fix reverted; git stash create, rev-parse, diff and restore --worktree in the working directory for that check; three read-only subagents for a collab
3. Sends: each round's prompt and each collab report to the model as a message, a deny text for a stopped edit or spawn, the round's block after the skill's text, sidebar sections and lines or transcript lines to you; nothing leaves the machine
4. Persists: in $.store, the on/off setting, and while a revert check runs the snapshot that holds the fix and the reverted files; the hunt itself lives in memory and ends with the session
5. Hostile input: the proof command is the model's and runs with your permissions, as a Bash call would, but without a shell; a finding's fields are checked before they are kept
한도
- 게이트는 편집, 쓰기 및 노트북편집을 읽습니다. Bash를 통해 변경된 파일(
sed -i, 리디렉션, 스크립트)은 보관되지 않습니다. - 되돌리기 검사에서는 수정 사항이 수정된 파일에 따라 증거가 달라짐을 보여줍니다. 증거가 올바른 행동을 주장하는지 여부를 알 수 없습니다.
- 되돌리기 검사는 수정 사항이 수정된 추적 파일만 되돌립니다. 파일만 추가하는 수정사항은 되돌릴 내용이 없으므로 claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install bughunt@kilimcininkoroglu-mods
Q가 거부됩니다. git 저장소 외부에는
PASS가 기록되지 않습니다. - 검사가 실행되는 동안(최대 one 추가 증명 실행) 수정된 파일에는 이전 코드가 보관됩니다. 해당 창에서 이를 읽는 다른 프로세스가 버그를 확인합니다.
- 모드는 모델이 스킬을 읽었는지 측정하는 것이 아니라 스킬이 전달되었는지 측정합니다.
- 시간이 부족한 공동작업 단계는 종료될 때까지 백그라운드에서 계속 실행됩니다. 모드는 더 이상 기다리지 않습니다.- 테스트 엔진은 하위 에이전트를 시작할 수 없으므로
pipeline.ts에서 가짜 엔진 호출을 통해 공동 작업 대기(핸드백, 조기 답변, 시간 제한, 종료 실패)를 테스트하고 전체 실행을 실시간으로 확인합니다. 2.1.284 라이브: two 라운드 헌트는 FAIL을 기록하고 PASS를 기록하고 지문을 2 라운드로 가져간 다음 거기서 끝났습니다. 공동 작업은 스캐너의 결과를 유지하고 비평가의 평결을 읽었으며 three 핸드백은 차례대로 시작되지 않았습니다. 되돌린 실행이 실패한 후 git 저장소의 라운드에서PASS가 기록되었고 수정 사항은 이후에 다시 제자리로 돌아갔으며git stash list는 비어 있었습니다. - 라운드 게이트 우회는 없습니다.
/bughunt stop는 헌트를 종료하고/bughunt off는 모드를 끕니다.
개발
make install # eslint, typescript-eslint, typescript
make lint # complexity limit 10, the build fails above it
make typecheck # needs .claude/types/ from /plugin-types
make validate
make test # claude plugin test
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add KilimcininKorOglu/claude-code-mods claude plugin install bughunt
원문 / README
bughunt
A bug hunt prompt tells the model to prove a bug before it fixes it, and the model often writes the fix first and a test that passes after. This mod runs the hunt in rounds and holds each round to its proof. The model writes a proof command, the mod runs it itself, and production code stays unchanged until the proof exits non-zero with a FAIL line. The round counts as fixed only when the same command then exits 0 with a PASS line, and fails again once the mod reverts the fix for a moment. The loop reads each round's outcome and stops at a blocked or unverified round instead of starting the next one.
/bughunt collab <paths> is a second, read-only mode: a scanner, a planner and a critic subagent review the paths in turn, and the report carries the findings, the plan and the critic's verdict.
What it does
Rounds
-
/bughunt [--rounds N] [target]starts a hunt of 1 to 25 rounds over the target, or over the whole project.--roundsmay stand anywhere among the arguments. The hunt starts at any point of the session. -
The mod sends each round as a prompt: the round number, the scope, the round's proof directory (
.temp_files/bughunt/<round>/), the fingerprints of the earlier rounds and the protocol. The model first opens thebughunt:huntskill, which holds the full rules; while a round runs, the mod appends the round's block to the skill's text. -
While a round runs:
- Edit, Write and NotebookEdit stop until the skill is open in the round.
- An edit outside the proof directory stops until the mod recorded a
FAIL. - With a target, an edit outside it stops after the
FAILtoo. A test file (tests/,__tests__/,*.test.*,*.spec.*,*_test.*,test_*.py) passes, so the regression test can go into the suite. - Every subagent spawn stops: a round runs in one conversation.
-
The model calls
mcp__bughunt__proofwithphase: "before"and the proof command'sargv. The mod runs the command (5 minutes at most) and recordsFAILonly when it exits non-zero and prints a line that starts withFAIL. A setup or import error that prints no such line is rejected. After the fix,phase: "after"with the sameargvruns the command again and needs exit 0 and a line that starts withPASS. The model reads the exit code, the last 20 lines of output and the reason. -
Before it records the
PASS, the mod checks that the proof reaches the fix. When theFAILwas recorded, it took a snapshot of the working tree (git stash create, which adds no stash entry, orHEADon a clean tree). After an acceptedPASSrun it lists the files modified since that snapshot (git diff --diff-filter=M), leaves out the proof directory and test files, and restores them to the snapshot in the working tree (git restore --source, the index stays as it was). It runs the proof again and then puts the fix back. ThePASScounts only when that reverted run exits non-zero with aFAILline. Otherwise the call is rejected and the model can fix the proof and call again. The model reads the reason in each case:- the proof passes with the fix reverted, so it does not reach the fixed code;
- no production file was modified since the
FAIL; - the directory is not a git repository;
- a git command failed.
While the fix is reverted, the mod keeps a record in
$.store. When a crash cuts the check short, the next session in the same directory puts the fix back, if the reverted files are still unchanged. If they changed since, it does not overwrite them and tells you thegit restorecommand that brings the fix back. -
When the round's turn ends, the mod reads the answer's outcome line: the first line that begins with an outcome label, so a sentence before it does not hide it:
fixed-and-verifiedgoes on only when the mod recordedFAILthenPASSin the round; otherwise the hunt stops.no-proven-buggoes on.blocked,fixed-verification-incomplete, no outcome line, an interrupt or an API error stop the hunt.- After the last round the hunt ends.
The
fingerprint:line of each answer goes into the next rounds' prompts, so the same root cause is not counted twice. -
A prompt you write yourself ends the hunt;
/bughuntcommands do not.
Collab
/bughunt collab <paths>, or the model'smcp__bughunt__collabtool, starts three subagents in turn. They are the mod's own agent types (bughunt:scanner,bughunt:planner,bughunt:critic), hidden from the model's agent list, and each can only read:Read,Grep,Glob.- The scanner reports each finding at once with
mcp__bughunt__found(file, line, severity, description, optional fix). The mod checks the fields and keeps the finding. Only the running scanner may call the tool. - The planner receives the findings and the scanner's report, and writes a fix plan. The critic receives the findings and the plan, and begins its answer with
verdict: approve,reviseorreject. - Each step has a time limit (scanner 10, planner 8, critic 6 minutes). A step that runs out is named in the report as
timed-out, and the findings the scanner sent before that stay in the report. - When the critic gives no verdict line, the verdict is
no-verdict, neverapprove. - The command and the tool return once the scanner started; the report arrives later as one message, and the model reads it as a read-only review. A step's hand-back message is taken by the mod and dropped, so it does not start a turn of its own.
- A collab does not start while a round runs.
What you see
The sidebar shows a standing bughunt section: the round, whether the skill is open, the proof state and each finished round's outcome and fingerprint. Stopped edits, proof results and the hunt's end go to the sidebar stream. Without the sidebar, each of them is one transcript line such as bughunt: edit stopped (proof): src/a.ts.
Command
/bughunt [--rounds N] [target] start a hunt of N rounds (1 by default, 25 at most)
/bughunt collab <paths> a read-only scanner, planner and critic review
/bughunt stop end the running hunt
/bughunt status on or off, and the running round
/bughunt on | off on by default; off starts nothing and holds no edit
Install
claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install bughunt@kilimcininkoroglu-mods
Function hooks are early access. Claude Code 2.1.288 and later load them by default, so there is nothing to switch on.
After installing
- Restart Claude Code.
- Run
/bughuntin a repository whose tests you can run from the command line. The proof command runs with your permissions, so read what the model proposes.
What it can reach
Validated with claude plugin validate on Claude Code 2.1.284:
❯ ./register.ts hooks: session.start, command.run{command=bughunt}, agent.offer{agent=/"^bughunt:(scanner|planner|critic)$"/}, tool.describe{tool=/"^mcp__bughunt__(proof|found|collab)$"/}, tool.call{tool=/"^mcp__bughunt__proof$"/}, tool.call{tool=/"^mcp__bughunt__found$"/}, tool.call{tool=/"^mcp__bughunt__collab$"/}, prompt.submit, skill.prompt{skill=bughunt:hunt}, tool.call{tool=Skill}, tool.call{tool=Edit}, tool.call{tool=Write}, tool.call{tool=NotebookEdit}, agent.spawn, turn.complete
❯ ./register.ts calls: $.agent.register (via declare), $.agent.spawn (via portsOf), $.clock.after (via portsOf, send), $.command.register (via declare), $.command.run (via send), $.process.run (via git, recoverFix, runProof), $.prompt.submit (via send), $.sidebar.clear (via show), $.sidebar.set (via show, toPerson), $.store.delete (via putBack, recoverFix), $.store.get (via readSettings, recoverFix), $.store.set (via revertCheck, setEnabled), $.tool.register (via declare), $.ui.log (via launchCollab, send, toPerson)
Reach L2, it runs the proof command the model names.
1. Reads: the path of each Edit, Write and NotebookEdit call; your prompts, only to see whether you wrote one; each round's final answer; the collab subagents' answers
2. Runs: the proof command the model passes to mcp__bughunt__proof, as argv without a shell, in the working directory or the cwd it names, for 5 minutes at most, a second time with the fix reverted; git stash create, rev-parse, diff and restore --worktree in the working directory for that check; three read-only subagents for a collab
3. Sends: each round's prompt and each collab report to the model as a message, a deny text for a stopped edit or spawn, the round's block after the skill's text, sidebar sections and lines or transcript lines to you; nothing leaves the machine
4. Persists: in $.store, the on/off setting, and while a revert check runs the snapshot that holds the fix and the reverted files; the hunt itself lives in memory and ends with the session
5. Hostile input: the proof command is the model's and runs with your permissions, as a Bash call would, but without a shell; a finding's fields are checked before they are kept
Limits
- The gate reads Edit, Write and NotebookEdit. A file changed through Bash (
sed -i, a redirect, a script) is not held. - The revert check shows that the proof depends on the files the fix modified. It cannot tell whether the proof asserts the right behaviour.
- The revert check reverts only tracked files the fix modified. A fix that only adds files has nothing to revert, so its
PASSis rejected. Outside a git repository, noPASSis recorded. - While the check runs (at most one more proof run), the fixed files hold the old code. Another process that reads them in that window sees the bug.
- The mod measures that the skill was delivered, not that the model read it.
- A collab step that runs out of time keeps running in the background until it ends; the mod no longer waits for it.
- The test engine cannot start a subagent, so the collab waits (hand-back, early answer, time limit, failed end) are tested in
pipeline.tswith fake engine calls, and the whole run is checked live. Live on 2.1.284: a two-round hunt recorded FAIL then PASS, carried the fingerprint into round 2 and ended there; a collab kept the scanner's finding, read the critic's verdict, and its three hand-backs started no turn. A round in a git repository recordedPASSafter the reverted run failed, the fix was back in place afterwards, andgit stash liststayed empty. - There is no bypass of a round's gates.
/bughunt stopends the hunt, and/bughunt offturns the mod off.
Development
make install # eslint, typescript-eslint, typescript
make lint # complexity limit 10, the build fails above it
make typecheck # needs .claude/types/ from /plugin-types
make validate
make test # claude plugin test
