bisect
БесплатноБез исполняемых скриптовНе проверенFind which commit introduced a bug using git bisect with automatic test verification. Use when tracking down which commit introduced a bug.
от drn★ 23 звезды на GitHubОб этом скилле
Git Bisect
Find the exact commit that introduced a bug using binary search with automatic test verification.
Arguments
$ARGUMENTS- Required: a test command to verify the bug (e.g., "go test ./pkg/..." or "npm test"), or a description of the bug to investigate manually
Context
- Current branch: !
git branch --show-current - Git status: !
git status --short - Recent commits (50): !
git log --oneline -50 2>/dev/null | head -50 - Test framework: !
find . -maxdepth 1 \( -name go.mod -o -name Gemfile -o -name package.json -o -name Cargo.toml -o -name pyproject.toml \) 2>/dev/null | head -5 - Latest tag: !
git describe --tags --abbrev=0 2>/dev/null | head -1
Instructions
Step 0: Validate state
- IF
git status --shortshows uncommitted changes, offer to stash them withgit stash push -m "bisect: stashing before bisect". If the user declines, stop and tell them to commit or stash first. - IF
$ARGUMENTSis empty, ask the user: "What test command should I run to detect the bug? Or describe the bug and I will check each commit manually."
Step 1: Determine boundaries
The "bad" commit is HEAD (current state where the bug exists).
For the "good" commit, ask the user or infer:
- IF the user provides a known-good commit or tag, use it.
- IF a latest tag exists, suggest it as the good commit: "Is the bug present in
? If not, I will use it as the good boundary." - OTHERWISE, suggest a commit from the recent history (e.g., 20 commits back) and ask the user to confirm.
Step 2: Start bisect
git bisect start
git bisect bad HEAD
git bisect good <good-commit>
Report how many commits are in the range and the estimated number of steps (log2).
IF the range exceeds 1000 commits, warn the user: "This is a large range (
Step 3: Run bisect
IF the user provided a test command:
- Use
git bisect run <test-command>for automatic bisection. - The test command should exit 0 for "good" (bug not present) and non-zero for "bad" (bug present).
- Monitor the output. IF the test command exits with 125 (skip), report that the commit could not be tested and bisect will skip it.
IF the user described the bug (manual mode):
- At each bisect step, read the relevant code or run the described check.
- Mark each commit as
git bisect goodorgit bisect badbased on findings. - Report progress: "Step N/~M: testing commit
( )..." - Limit to 20 steps maximum. IF exceeded, run
git bisect reset, report "Bisect exceeded 20 steps — likely inconclusive. Consider narrowing the range." and stop.
Step 4: Present the result
Once bisect identifies the offending commit:
- Record the commit hash from bisect output.
- Run
git bisect resetto restore the original state. - IF changes were stashed in Step 0, run
git stash pop. - Show the offending commit details:
git show <hash> --stat
git show <hash>
- Check if the commit is associated with a PR:
git log --merges --ancestry-path <hash>..HEAD --oneline
- Present a summary:
## Bisect Result
**Offending commit:** <hash>
**Author:** <name> (<date>)
**Subject:** <commit message>
### Changed files
<list of files changed>
### Diff
<relevant diff excerpts>
### Related
- Merge commit: <if found>
- PR: <if identifiable from merge commit message>
Step 5: Cleanup
Verify that bisect state is fully cleaned up:
git bisect reset(if not already done)- Restore stashed changes (if applicable)
- Confirm the user is back on the original branch
Установить bisect в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Bash(git bisect:*)Bash(git log:*)Bash(git status:*)Bash(git diff:*)Bash(git show:*)Bash(git rev-parse:*)Bash(git stash:*)FAQ
Что делает скилл bisect?
Find which commit introduced a bug using git bisect with automatic test verification. Use when tracking down which commit introduced a bug.
Как установить скилл bisect?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bisect запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic