A small Claude Code plugin called Ockham adds a project index and final checks to AI coding agents, enabling them to spot and fix duplicated bugs in separate files that plain prompts miss.
How Ockham works
When a session starts, Ockham supplies the agent with a list of existing helpers and test locations. If the agent edits a line that appears elsewhere, Ockham instantly notifies it of the duplicate location. After the agent signals completion, seven hidden checks validate the changes, including a check for an unchanged copy of the bug.
The tool is built around seven textual rules that prioritize the smallest change that resolves the whole task. The first rule decides which half of a change wins, ensuring the agent does not discard needed work while trying to minimise edits.
Benchmark results
In a benchmark of 44 tasks, the baseline agent fixed the original bug but left the second copy untouched in five attempts. With Ockham’s index note, the same bug was fixed in both files in 15 out of 15 recorded sessions, matching the numbers shown in the GitHub readme.
Overall, 70 sessions that involved duplicated bugs reported a successful double fix, and no false warnings were observed across 546 sessions where the index was active.

Cost per session rose from roughly $0.03 to $0.05, largely due to the extra tests that Ockham requests. Disabling the test rule (OCKHAM_TESTS=off) brings cost back down by about a quarter while preserving the duplicate‑bug detection.
Remaining gaps
Some tasks still evade Ockham’s safeguards: a redirect after sign‑in remained open in three out of five sessions, and a second inline version of a helper was caught only once in seven attempts. The index does not reduce raw compute cost; it shortens session length but the same amount of model inference is required.
The GitHub description notes that phase 4 – the end‑of‑task checks – is implemented, while later phases such as memory handling and Codex integration are still pending.
Why the index matters
The experiments demonstrate a fundamental limitation of prompt‑only guidance: an AI model cannot reliably recall or discover code it has not been shown at the moment of edit. By injecting a lightweight code index, Ockham bridges that gap, turning a one‑line patch into a comprehensive fix when the same logic appears elsewhere. For developers relying on AI assistants, this means that tool‑level context can dramatically improve correctness without demanding extensive prompt engineering. However, the added safety comes at a modest monetary price and does not solve every class of duplication, especially when the duplicate resides in a differently named helper or behind a control‑flow change. Teams using Claude Code can adopt Ockham now to reduce regression risk on common patterns, but they should still complement it with manual review for edge cases that the current checks miss.
Cover: The People’s Internet · CC0 · Wikimedia Commons. Layout and headline text by Signal Titans.
Source: A prompt can't see the second copy of a bug. A program can. · GitHub – Octonove/ockham: The smallest change that works, checked: rules, a project index that warns before a coding agent duplicates code, and checks on what it actually wrote. For Claude Code and Co

Leave a Reply