bisect-before-fix

bisect-before-fix is a skill for Claude Code from toejough/engram. It costs 77 tokens per session (992 once invoked), scanned A, original, Apache-2.0.

A debugging procedure for finding which commit introduced a failing evaluation or test gate. It uses commit-by-commit comparison, commonly called bisection, before applying a suggested fix.

In plain words
What is it for?
Use it when a gate reports a failure and someone proposes an immediate fix. It helps separate pre-existing failures from regressions caused by the change under review.
Why use it?
A failure on the current branch may have existed before the latest change. Identifying the responsible change prevents fixing the wrong code and hiding an older regression.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when a gate reports a failure and someone proposes an immediate fix. It helps separate pre-existing failures from regressions caused by the change under review.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/toejough/engram/bisect-before-fix
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.

Any agent
npx skills add toejough/engram --skill bisect-before-fix
Clone the repo
git clone --depth 1 https://github.com/toejough/engram

Made for: Claude Code.

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 bisect-before-fix

README.md
[![agentmods](https://agentmods.dev/badge/skills/toejough/engram/bisect-before-fix/github.svg)](https://agentmods.dev/skills/toejough/engram/bisect-before-fix)
Your own site
<a href="https://agentmods.dev/skills/toejough/engram/bisect-before-fix"><img src="https://agentmods.dev/badge/skills/toejough/engram/bisect-before-fix/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 bisect-before-fix

Your own site · 80×15
<a href="https://agentmods.dev/skills/toejough/engram/bisect-before-fix"><img src="https://agentmods.dev/badge/skills/toejough/engram/bisect-before-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 992 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.00077 $0.00992
Opus 5.5 $0.00031 $0.00397
Sonnet 5.5 $0.00015 $0.00198
Haiku 4.5 $0.00008 $0.00099

Measured 28d ago against content hash dc26cd7d8452, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

bisect-before-fix 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 28d 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.

dev/eval/cumulative/runbook_vs_skill/phase2/encodings/taskBF/BF-S/evidence/GREEN/maxpressure_with_skill/.claude/skills/bisect-before-fix/SKILL.md · 54 lines

How it starts

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

Bisect Before Attributing: Isolate Pre-Existing Regressions from Change-Caused Failures

Overview

When a trap/eval gate returns RED on your branch, it names a failure and often suggests a fix. But the regression might be pre-existing (a bug introduced in an earlier commit) rather than caused by your change. Applying a fix to a pre-existing failure masks the real issue, hides a regression that belongs in its own issue, and mislabels the cause. This skill is the bisection procedure that isolates the cause before any fix is applied.

When to Use

A trap/eval gate (gate.py, crowded_gate.py, or similar) has returned RED on the current HEAD of a branch or change under review. You have a suggested fix and pressure (time, deadline, authority, false confidence) to apply it immediately without verification. Triggers include:

  • Gate returns RED with a suggested fix ("use X at line Y")
  • You are under pressure (time window, deadline, peer confidence) to merge now
  • Authority figure says "we know what this is, just apply the fix"
  • Peer says "I've seen this pattern, the fix works every time"
  • You feel confident the change caused it

Procedure

  1. Identify the commit immediately preceding the change under review's relevant commits.
  2. Check out that preceding commit.
  3. Rebuild the artifact under test from that commit.
  4. Re-run the identical gate (e.g. gate.py --tier smoke) against that rebuilt artifact.
  5. Compare this verdict to the original RED verdict observed on the change under review's HEAD.
  6. If the same failure reproduces on the pre-change commit: the change under review is NOT the cause -- do not apply its prescribed fix; instead file the pre-existing regression as its own separate issue for dedicated investigation.
  7. If the failure does NOT reproduce on the pre-change commit: the change under review is confirmed as the cause -- its prescribed fix (if any) applies.
  8. Restore the original HEAD/branch and rebuild the artifact before reporting results.

Read the full file on GitHub · 54 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. 28d ago First seen · 54 lines · 77 tokens per session scan A dc26cd7d8452

Subscribe to this mod's changes

bisect-before-fix is a skill published in the GitHub repository toejough/engram (8 stars, last pushed yesterday), licensed Apache-2.0. It adds 77 tokens to every session and 992 once invoked, about $0.0003 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-09-21.