Arbiter Finds 152 Bugs in Claude Code and Gemini CLI for $0.27
A new framework audits the system prompts of Claude Code, Codex CLI, and Gemini CLI — finding 152 bugs for just $0.27 in API costs
ProTakeaways
- Arbiter is a new framework for auditing LLM agent system prompts, combining formal rule-based analysis with multi-model "scouring" to find internal contradictions and design bugs.
- Applied to Claude Code, Codex CLI, and Gemini CLI, it found 152 issues in the undirected phase and 21 hand-labeled interference patterns in Claude Code alone — for a total cost of $0.27.
- A critical bug in Gemini CLI: any preferences saved via
save_memoryare structurally guaranteed to be deleted during history compression, because the compression schema has no field for saved memories. Google patched a related symptom but not the root cause. - Prompt architecture predicts failure class: monolithic prompts (Claude Code) produce subsystem boundary contradictions; modular prompts (Gemini CLI) produce seam-level design bugs; flat prompts (Codex CLI) are the most consistent.
- Multi-model evaluation is essential: different LLMs surface categorically different vulnerability classes — running 10 models found 10 distinct analytical lenses, not just more of the same findings.
- The paper and reproducibility artifacts are available on arXiv and Zenodo; code is released at the paper's GitHub repo (tag v0.1.1).
System prompts are the constitutions that govern AI coding agents. They tell Claude Code when to use a task manager, instruct Gemini CLI how to handle memory, and define Codex CLI's entire behavioral contract. They range from 245 to 1,490 lines, encode security policies, define tool usage rules, and manage state. And yet, unlike virtually every other piece of software these agents interact with, they have no linter, no test suite, and no static analysis. A new paper introduces Arbiter, a framework that treats system prompts as the software artifacts they actually are , and the results are striking.
The problem nobody is checking
When a system prompt contains contradictory instructions , "always use TodoWrite" in one section, "NEVER use TodoWrite" in another , the executing LLM resolves the conflict silently through whatever heuristic its training provides. No error is raised. No warning is logged. The agent just picks one and moves on, and the contradiction persists invisibly across every future invocation.
This is not a theoretical concern. 80% of developers now use AI coding agents in their workflows, and those agents are executing shell commands, writing files, and managing codebases based on instructions that have never been formally verified. The paper's central argument is sharp: the agent that resolves the conflict cannot be the agent that detects it. An LLM executing a contradictory system prompt will smooth over inconsistencies through "judgment" , the same mechanism that makes LLMs useful makes them unreliable as their own auditors.
What Arbiter actually does
Arbiter combines two complementary phases. The first is directed evaluation , a structured, exhaustive analysis. The second is undirected scouring , a deliberately vague, multi-model exploration designed to find what the rules don't cover.
Directed evaluation works like a compiler for prompt logic:
- The prompt is decomposed into contiguous blocks, each tagged by tier (system/domain/application), category (identity, security, tool-usage, workflow), modality (mandate, prohibition, guidance), and scope.
- Formal interference rules are applied across block pairs. Five built-in rule types cover direct contradictions, scope overlaps, priority ambiguities, and unresolved dependencies.
- Pre-filtering reduces the combinatorial explosion: for 56 blocks and 5 rules, the naive O(n² × R) search space of ~15,680 evaluations shrinks to 100–200 relevant pairs.
- Structural rules (duplicate text, conflicting priority markers) run as pure Python predicates , zero LLM calls, zero cost.
Undirected scouring is where it gets interesting. Each pass sends the full prompt to a different LLM with a deliberately vague instruction: read this carefully and note what you find interesting. Each subsequent model receives the accumulated findings from all prior passes and is asked to go where previous explorers didn't. Convergent termination , three consecutive models declining to continue , provides a calibrated stopping criterion. The key insight is that this is not about consensus. It is about complementarity: different models, trained on different data, surface categorically different classes of problems.
Three prompts, three architectural failure modes
Applied to three major coding agent system prompts , Claude Code (Anthropic), Codex CLI (OpenAI), and Gemini CLI (Google) , Arbiter identifies 152 findings across the undirected scouring phase and 21 hand-labeled interference patterns in directed analysis of one vendor. The corpus spans an order of magnitude in size:
| Agent | Lines | Characters | Architecture | Scourer Findings |
|---|---|---|---|---|
| Claude Code | 1,490 | 78K | Monolithic | 116 |
| Codex CLI | 298 | 22K | Flat | 15 |
| Gemini CLI | 245 | 27K | Modular | 21 |
The central finding is not just a list of bugs , it is a taxonomy. Prompt architecture (monolithic, flat, modular) strongly correlates with observed failure class but not with severity. Each architecture produces a characteristic class of failure, for the same structural reasons that apply to conventional software.
Claude Code (monolithic): The four critical contradictions all follow the same pattern: a general-purpose subsystem (TodoWrite task management) makes universal claims ("ALWAYS use," "use VERY frequently") that conflict with specific workflow subsystems (commit, PR creation) that prohibit the same tool ("NEVER use TodoWrite"). These subsystems were evidently authored by different teams or at different times, and no integration test checks their mutual consistency. This is Conway's Law , the structure of the prompt reflects the structure of the team that built it.
Codex CLI (flat): The simplest prompt produces the fewest problems. With fewer capabilities encoded, there are fewer opportunities for contradiction. Most findings are structural observations , identity confusion between the model name and tool name, an empty section header suggesting truncation , rather than operational bugs. Simplicity buys consistency.
Gemini CLI (modular): This is where the most insidious bugs live. Each module works correctly in isolation. The bugs exist exclusively in the gaps between modules , contracts that were never written because each module was designed independently. Two findings were rated "alarming" by independent scourer models.
The Gemini memory bug that Google half-fixed
The most concrete validation of Arbiter's approach involves Gemini CLI's memory system. Gemini CLI includes a nested "History Compression System Prompt" that governs how conversation history is summarized when context limits are reached. This compression prompt defines a rigid XML schema that becomes "the agent's only memory" post-compression. The save_memory tool allows users to store global preferences. However, the compression schema contains no field for saved memories. The result: any preference a user stores via save_memory is structurally guaranteed to be deleted the next time context compression runs.
This is not a bug in either module. The save_memory tool works correctly. The compression prompt works correctly. The bug exists in the contract between them , a contract that was never written.
After the scourer identified this, the researchers discovered that Google had independently filed a P0 (critical priority) bug about the compression system entering an infinite loop, opened in January 2026. The merged fix reorders the compression pipeline and adds token budget truncation. It makes compression work. It does not add a <saved_memory> field to the compression schema, does not change how save_memory data flows through compression, and does not mention user preference persistence in the code review discussion. The symptom was patched. The root cause remains.
Why multi-model evaluation is not optional
The methodological contribution that will matter most to practitioners is the evidence for multi-model complementarity. Running the same prompt through ten different models is not just "more coverage" , it surfaces categorically different vulnerability classes. Each model brings a distinct analytical lens rooted in its training:
- Claude Opus 4.6: Structural contradictions, security surfaces, meta-observations
- Kimi K2.5: Economic exploitation, resource exhaustion, cognitive load
- Grok 4.1: Permission schema gaps, environment assumptions, state management
- MiniMax M2.5: Trust architecture flaws, concurrency, impossible instructions
- GLM 4.7: Data integrity, temporal paradoxes, competitive logic
- DeepSeek V3.2: Hidden references, delegation loopholes, format mismatches
Kimi K2.5's economic/resource lens is categorically absent from Claude Opus's structural analysis. GLM's focus on data integrity does not overlap with Grok's attention to permission schemas. The models are not redundant; they are complementary. Claude Code required 10 passes across 10 distinct models to converge. Smaller prompts converged in 2–3 passes. The stopping criterion , three consecutive models declining to continue , transferred across all three vendors without recalibration.
Three bugs that appear everywhere
Beyond vendor-specific findings, three interference patterns appeared in all three system prompts, suggesting they are structural properties of governing an LLM coding agent rather than vendor-specific mistakes:
- Autonomy vs. restraint: All three prompts tell the agent to "persist until the task is fully handled" and also to "ask before acting" on ambiguous tasks. These cannot both be satisfied simultaneously in many real scenarios.
- Precedence hierarchy ambiguity: All three define multiple authority sources , system instructions, config files, user messages, tool-injected context , without fully specifying how conflicts between them resolve.
- State-dependent behavioral modes: All three include mechanisms for changing behavior based on runtime state (approval presets, plan mode, skill activation) without always specifying how mode-specific rules interact with base rules.
What it costs: $0.27
The total cost of analyzing all three vendor prompts was $0.27 USD, verified against OpenRouter billing records , $0.236 for Claude Code, $0.012 for Codex CLI, and $0.014 for Gemini CLI. The cost per finding across all analyses works out to $0.002. This is not a footnote , it is a result. It means that the kind of systematic prompt analysis that previously required a dedicated security team is now accessible to any developer with an API key.
The paper also introduces a structural layer: an AST (abstract syntax tree) parser that decomposes any system prompt into typed nodes and semantic channels. This enables version diffing between prompt releases , tracking exactly which behavioral, safety, tool, and memory channels changed between updates , without relying on fragile line-level text diffs. Applied to two versions of Claude Code, it revealed a systematic architectural evolution: tool definitions migrating out of the prompt into API parameters, flat prose becoming structured lists, and an entirely new memory channel appearing between versions.
What it can't do (yet)
Arbiter is a static analysis tool. It finds contradictions in what the prompt says, not in what the agent does. A contradiction may or may not manifest as incorrect runtime behavior depending on how the executing model resolves it. The paper notes that related work on repository-level context files found that instruction redundancy and contradiction increase inference cost by 14–22% and reduce task success rates , consistent with the structural conditions Arbiter identifies, but not a direct measurement of them.
The directed analysis (with hand-labeled ground truth) was only performed on Claude Code. The architectural taxonomy is grounded in three examples, which is enough to establish a strong correlation but not a universal law. And the Gemini CLI prompt required custom composition from TypeScript render functions, meaning the analyzed version is a researcher-constructed worst case, not necessarily what every user receives.
The infrastructure gap
The paper's broader argument is that system prompts need the same engineering infrastructure that conventional software has: linters for internal consistency, tests for behavioral contracts, CI/CD pipelines that catch regressions when one section is edited. For developers and vendors building agents for customers, testing and evaluation cannot stop at simple golden prompts and manual chat testing. Manual refinement and patching is enough for experimentation, but does not hold up to mass-market use. As the agent connects to tools, memory, external data, and customer-facing workflows, the number of potential failure points increases.
The Arbiter paper and its reproducibility artifacts are publicly available. The code is released at the paper's GitHub repository (tag v0.1.1). For teams shipping agents that write code, manage files, and execute shell commands on behalf of users, the question the paper leaves open is pointed: if a $0.27 analysis can find 152 issues in the prompts of three of the best-resourced AI labs in the world, what would it find in yours?