---
title: "What 4,206 Failed Claude Code Tool Calls Taught Us — PromptConduit"
description: "Claude Code's PostToolUseFailure hook has no tool_response, only an error field. Our ingest missed that and logged 4,206 failed tool calls as successes. What the real failure rate turned out to be, and what failure mining found."
image: "https://promptconduit.dev/og-image.png"
---

<!-- Markdown copy of https://promptconduit.dev/blog/claude-code-failed-tool-calls. Index of every page: https://promptconduit.dev/llms.txt -->

November 29, 2026 · [PromptConduit](https://promptconduit.dev/) · 6 min read

# What 4,206 failed Claude Code tool calls taught us

**Claude Code’s `PostToolUseFailure` hook event has no `tool_response`. The failure is in a top-level `error` field.** Our ingest only looked for an error inside `tool_response`, so for 30 days it stored every failed tool call it received (4,206 of them) as a success, with no error text. If you write Claude Code hooks, check `error` on `PostToolUseFailure` and deduplicate calls on `tool_use_id`. The rest of this post covers how we found the bug, what the real failure rate looks like, and what mining the failures has found so far.

All numbers are aggregates from our own account. No prompt or command from anyone else is quoted.

## The bug: every failure looked like a success

PromptConduit records each tool call an agent makes, along with whether it worked. That outcome feeds the tool success rate in [coaching](https://promptconduit.dev/coaching/raise-tool-success-rate), skill rankings, and the daily stats.

Claude Code sends a separate hook event when a tool call fails, `PostToolUseFailure`. That event carries the failure as `error` and has no `tool_response` at all. Our parser treated a call as failed only when it found an error inside `tool_response`. The failure event had none, so it marked the call as a success.

A read-only check on production found **4,206 `PostToolUseFailure` events in 30 days, all stored as successes.** For a month, every tool success rate we showed was close to 100%, and that number was wrong.

The fix in [platform#393](https://github.com/promptconduit/platform/pull/393) treats the failure event itself as the signal and keeps the `error` text.

## The second bug: the same call, recorded twice

While checking that fix live, we found a second bug. Every tool call reaches a hook twice:

1.  its own `PostToolUse` or `PostToolUseFailure` event;
2.  the `PostToolBatch` event for the turn, which lists every call again.

We deduplicated on the exact second the call happened. When the batch arrived in a later second, the call got a second row. The batch stores the result the model saw as a plain string, such as `Exit code 1`, which our parser didn’t read as a failure. So the second copy of a failed call came back as a success.

Our local event log covered August to November: 78,000 batched calls.

| What we measured | Count |
| --- | --: |
| Batched calls that also had their own event with the same `tool_use_id` | 99.6% |
| Batched calls that arrived in a different second (double-counted) | 26%, about 20,000 |
| Failures re-recorded as successes by the batch | 421 |
| Batched calls with no event of their own (they never ran) | about 300 |

The calls that never ran matter. Of the roughly 300, 206 were `<tool_use_error>` results: a hook or a check blocked them before they ran. The rest were safety-check denials. For those calls, the batch is the only record.

[platform#394](https://github.com/promptconduit/platform/pull/394) keys every tool call on its `tool_use_id`. The two copies now collide in either order, and the batch only adds calls that never ran. It also reads batch strings: `Exit code N` (N above 0) on Bash and `<tool_use_error>` count as failures. A cleanup migration removed the duplicate rows written before the fix ([platform#402](https://github.com/promptconduit/platform/pull/402)).

### If you write Claude Code hooks

-   On `PostToolUseFailure`, read the top-level `error`. Don’t look for `tool_response`.
-   Deduplicate on `tool_use_id`, not on timestamps.
-   In `PostToolBatch`, a call’s result is the string the model saw. `Exit code N` means a Bash failure. `<tool_use_error>` means the call never ran.
-   Expect calls in a batch that have no event of their own. Those are calls that were blocked before they ran.

The events PromptConduit captures, per assistant, are listed in [Supported tools](https://promptconduit.dev/docs/tools).

## The real failure rate

Outcomes have been reliable since 2026-11-29 02:00 UTC. These are our own account’s first 24 hours of correct data, to 2026-11-30 02:24 UTC:

|  | Calls | Failed | Failure rate |
| --- | --: | --: | --: |
| All tools, 136 sessions | 8,564 | 653 | 7.6% |
| Bash | 6,953 | 648 | 9.3% |
| Edit | 679 | 5 | 0.7% |
| Write | 460 | 1 | 0.2% |
| Read | 283 | 2 | 0.7% |
| WebFetch | 44 | 3 | 6.8% |

**122 of 136 sessions (90%) had at least one failed tool call.** Before the fix, the same dashboards would have shown close to zero.

Almost all failures are Bash. The file tools fail less than 1% of the time.

## What the failures were

We grouped the 648 failed Bash calls by their error text:

| Cause | Failed calls | Share |
| --- | --: | --: |
| A worktree-isolation hook refused the command | 529 | 82% |
| Exit code 1, other | 70 | 11% |
| No such file or directory | 21 | 3% |
| Other exit codes, other errors | 28 | 4% |

The biggest cause of failed tool calls wasn’t the model or the code. It was our own guardrail. We run many agents in parallel, each in its own git worktree, and a hook refuses any git command it can’t prove stays inside that worktree. Typical cases are `cd` into a computed path before running git, or several git commands chained in one line. The agent then retries with a plainer command, which works.

Each refusal costs a full round-trip: the model writes a command, the hook rejects it, and the model reads the refusal and tries again. That’s what the coaching guide on [raising your tool success rate](https://promptconduit.dev/coaching/raise-tool-success-rate) is about. The fix is to tell the agent the rule up front, in `CLAUDE.md` or a skill: run git from the worktree directory, one plain command at a time.

## What failure mining found (and didn’t)

The same PR added failure mining. It looks for a command that failed, then a *different* command that did the same job right after it in the same session, such as `npm test` → `pnpm test` or `git push` → `git push -u`. Those pairs become candidate [skills](https://promptconduit.dev/docs/skills): “this fails here, this works instead”.

It skips what isn’t a real fix:

-   exploratory commands (`grep` exits 1 when it finds nothing);
-   a plain retry that then works;
-   “next step” pairs, such as checking CI and then merging;
-   anything more than 15 minutes later.

A pair has to recur in at least **two sessions** before it’s shown.

Over 45 days of our data (65,636 Bash calls and 4,721 failures), the miner found 14 real failure→fix pairs. Two examples:

-   `git commit -m "<multi-line message>"` failed, and `git commit -F <file>` worked;
-   `git merge -q --ff-only` failed, and `git merge --ff-only` worked.

**None of the 14 recurred in a second session, so none is shown as a pattern yet.** On 2026-11-29 the skills patterns view still reports 0 failure patterns for our account. One sighting isn’t a rule, and we’d rather show nothing than turn a one-off into advice.

The worktree-guard refusals don’t show up there either, even though they’re 82% of failures. They’re mostly `cd …` chains, which the miner skips on purpose because it can’t tell which part of the chain failed. That gap is real. The coaching insight catches it as a low success rate, and failure mining doesn’t.

Two changes should make patterns appear:

-   error text is now captured, so more failures can be classified;
-   mining runs across a whole team, not just one person.

## What we changed in how we read our own numbers

-   **A success rate near 100% is a bug until proven otherwise.** Ours was the visible symptom for a month, and nobody questioned it.
-   **Check a fix against the live event stream, not just the tests.** The tests for #393 passed. The double-counting only showed up when we compared a real failure event with the batch that arrived three seconds later.
-   **Report the sample size, and say “not enough data” when it’s true.** The 24-hour numbers above come from one heavy user, and the miner’s 14 pairs come from one person’s month.

## See your own failure rate

PromptConduit’s free CLI records the outcome of every tool call. Once you sign in, your agent can ask for it through the [MCP server](https://promptconduit.dev/docs/agents): `my_insights` for the success-rate coaching, and `skills_patterns` for failure→fix pairs as they start to recur.

```
curl -fsSL https://promptconduit.dev/install | bash
promptconduit init
```

Start with the [Quick Start](https://promptconduit.dev/docs/quick-start).

## Frequently asked questions

### How do I tell that a tool call failed in a Claude Code hook?

Listen for the PostToolUseFailure event. It has no tool\_response field. The failure text is in a top-level error field. A hook that only checks tool\_response for an error sees nothing wrong and treats every failure as a success.

### Why does my hook see the same Claude Code tool call twice?

Each call fires its own PostToolUse or PostToolUseFailure event, then appears again in the PostToolBatch for that turn. Deduplicate on tool\_use\_id. Matching on timestamps fails: in our data, 26% of batched calls arrived in a later second than their own event.

### How do I read a failure from a PostToolBatch event?

The batch carries the result the model saw, as a string. A failed Bash call reads "Exit code N" with N above 0. A call that never ran, because a hook or a check blocked it, starts with <tool\_use\_error>, and the batch is its only record.

### What is a normal tool failure rate for Claude Code?

On our own account, over the first 24 hours of correct data, 7.6% of tool calls failed (653 of 8,564) and 90% of sessions had at least one failure. Bash failed 9.3% of the time; Edit, Write and Read failed under 1%. That is one heavy user, so treat it as one data point, not a benchmark.

See what your own sessions cost

PromptConduit is a free, open-source CLI that prices every Claude Code and Cursor session on your machine. No account needed; events stay in a local file until you choose to sync.

`curl -fsSL https://promptconduit.dev/install | bash`

[Quick start →](https://promptconduit.dev/docs/quick-start) [Teams: free up to 3, Team $99/month flat →](https://promptconduit.dev/pricing)

## Related

-   [Batch your tool calls](https://promptconduit.dev/coaching/batch-tool-calls)
    
    Grouping independent reads and edits cuts round-trips and output tokens.
    
-   [Cursor AI Spend by Repo and Model](https://promptconduit.dev/blog/cursor-ai-spend-by-repo-and-model)
    
    See which repositories and models drive your Cursor bill: Cursor's usage dashboard and APIs compared with local, per-request tracking tagged by git repo.
    
-   [Raise your tool success rate](https://promptconduit.dev/coaching/raise-tool-success-rate)
    
    Failed tool calls waste a full round-trip each. Give the agent what it needs to get them right first time.
    

[← All posts](https://promptconduit.dev/blog)

```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "@id": "https://promptconduit.dev/#software",
  "name": "PromptConduit",
  "applicationCategory": "DeveloperApplication",
  "operatingSystem": "macOS, Linux, Windows",
  "description": "PromptConduit shows what AI coding costs per developer, repo, and pull request across Claude Code and Cursor. An open-source CLI records every session to a local JSONL file first, with git context and exact cost computed on your machine. Teams sync to see spend across members, models, repos, and clients, with budgets and alerts.",
  "url": "https://promptconduit.dev",
  "installUrl": "https://promptconduit.dev/docs/installation",
  "softwareHelp": {
    "@type": "CreativeWork",
    "url": "https://promptconduit.dev/docs"
  },
  "releaseNotes": "https://promptconduit.dev/changelog",
  "license": "https://opensource.org/licenses/MIT",
  "isAccessibleForFree": true,
  "publisher": {
    "@id": "https://promptconduit.dev/#organization"
  },
  "offers": [
    {
      "@type": "Offer",
      "name": "Free",
      "description": "The full CLI on your machine, and a team of up to 3.",
      "price": "0",
      "priceCurrency": "USD",
      "url": "https://promptconduit.dev/pricing",
      "availability": "https://schema.org/InStock",
      "eligibleQuantity": {
        "@type": "QuantitativeValue",
        "maxValue": 3,
        "unitText": "members"
      }
    },
    {
      "@type": "Offer",
      "name": "Team",
      "description": "Up to 15 members. One flat price, no seat math.",
      "price": "99",
      "priceCurrency": "USD",
      "url": "https://promptconduit.dev/pricing",
      "availability": "https://schema.org/InStock",
      "priceSpecification": {
        "@type": "UnitPriceSpecification",
        "price": "99",
        "priceCurrency": "USD",
        "unitCode": "MON",
        "referenceQuantity": {
          "@type": "QuantitativeValue",
          "value": 1,
          "unitCode": "MON"
        }
      },
      "eligibleQuantity": {
        "@type": "QuantitativeValue",
        "maxValue": 15,
        "unitText": "members"
      }
    },
    {
      "@type": "Offer",
      "name": "Growth",
      "description": "Up to 50 members, for teams and agencies running AI across many repos.",
      "price": "249",
      "priceCurrency": "USD",
      "url": "https://promptconduit.dev/pricing",
      "availability": "https://schema.org/InStock",
      "priceSpecification": {
        "@type": "UnitPriceSpecification",
        "price": "249",
        "priceCurrency": "USD",
        "unitCode": "MON",
        "referenceQuantity": {
          "@type": "QuantitativeValue",
          "value": 1,
          "unitCode": "MON"
        }
      },
      "eligibleQuantity": {
        "@type": "QuantitativeValue",
        "maxValue": 50,
        "unitText": "members"
      }
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "Organization",
  "@id": "https://promptconduit.dev/#organization",
  "name": "PromptConduit",
  "url": "https://promptconduit.dev",
  "logo": "https://promptconduit.dev/favicon.svg",
  "email": "hello@promptconduit.dev",
  "contactPoint": {
    "@type": "ContactPoint",
    "contactType": "customer support",
    "email": "hello@promptconduit.dev",
    "url": "https://promptconduit.dev/about"
  },
  "sameAs": [
    "https://github.com/promptconduit/cli",
    "https://github.com/promptconduit/editor-extension",
    "https://twitter.com/promptconduit"
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "What 4,206 Failed Claude Code Tool Calls Taught Us",
  "description": "Claude Code's PostToolUseFailure hook has no tool_response, only an error field. Our ingest missed that and logged 4,206 failed tool calls as successes. What the real failure rate turned out to be, and what failure mining found.",
  "author": {
    "@type": "Organization",
    "@id": "https://promptconduit.dev/#organization",
    "name": "PromptConduit",
    "url": "https://promptconduit.dev"
  },
  "publisher": {
    "@id": "https://promptconduit.dev/#organization"
  },
  "datePublished": "2026-11-29",
  "dateModified": "2026-11-29",
  "mainEntityOfPage": "https://promptconduit.dev/blog/claude-code-failed-tool-calls",
  "image": "https://promptconduit.dev/og-image.png",
  "keywords": "claude code posttoolusefailure, claude code hooks tool failure, posttoolbatch, claude code tool call failure rate, claude code hook tool_use_id, claude code failed bash command"
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [
    {
      "@type": "ListItem",
      "position": 1,
      "name": "Home",
      "item": "https://promptconduit.dev/"
    },
    {
      "@type": "ListItem",
      "position": 2,
      "name": "Blog",
      "item": "https://promptconduit.dev/blog"
    },
    {
      "@type": "ListItem",
      "position": 3,
      "name": "What 4,206 Failed Claude Code Tool Calls Taught Us",
      "item": "https://promptconduit.dev/blog/claude-code-failed-tool-calls"
    }
  ]
}
```

```json
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "How do I tell that a tool call failed in a Claude Code hook?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Listen for the PostToolUseFailure event. It has no tool_response field. The failure text is in a top-level error field. A hook that only checks tool_response for an error sees nothing wrong and treats every failure as a success."
      }
    },
    {
      "@type": "Question",
      "name": "Why does my hook see the same Claude Code tool call twice?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "Each call fires its own PostToolUse or PostToolUseFailure event, then appears again in the PostToolBatch for that turn. Deduplicate on tool_use_id. Matching on timestamps fails: in our data, 26% of batched calls arrived in a later second than their own event."
      }
    },
    {
      "@type": "Question",
      "name": "How do I read a failure from a PostToolBatch event?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "The batch carries the result the model saw, as a string. A failed Bash call reads \"Exit code N\" with N above 0. A call that never ran, because a hook or a check blocked it, starts with <tool_use_error>, and the batch is its only record."
      }
    },
    {
      "@type": "Question",
      "name": "What is a normal tool failure rate for Claude Code?",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "On our own account, over the first 24 hours of correct data, 7.6% of tool calls failed (653 of 8,564) and 90% of sessions had at least one failure. Bash failed 9.3% of the time; Edit, Write and Read failed under 1%. That is one heavy user, so treat it as one data point, not a benchmark."
      }
    }
  ]
}
```
