claude-opus-4-8: Extreme latency (>13 min) and repeated malformed tool calls with Extended Thinking + large cache_read context

Resolved 💬 1 comment Opened Jun 4, 2026 by yuanfu8899 Closed Jul 8, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Summary

claude-opus-4-8 in Claude Code becomes completely unresponsive (6–13+ minutes per API call) when Extended Thinking is enabled alongside a large ephemeral cache context (75k–158k cache_read_input_tokens). After these long waits, the model frequently returns malformed tool calls that cannot be parsed.

Environment

  • Model: claude-opus-4-8 (Extended Thinking enabled, speed=standard)
  • - Client: Claude Code CLI
  • - - Session ID: 6ac29982-425d-4d34-981b-6ceed35db7ec
  • - - - Date: 2026-06-04 00:38–02:37 UTC
  • - - - - inference_geo: not_available (all turns)

Symptoms

1. Extreme API Latency (multiple occurrences)

Single API calls took 6–13+ minutes to return:

| Delay | Time (UTC) | Result |
|-------|------------|--------|
| 801s | 01:03→01:16 | Malformed tool call |
| 780s | 02:00→02:13 | Retry also failed (synthetic fallback) |
| 693s | 01:22→01:33 | Malformed tool call |
| 672s | 02:21→02:32 | Normal response |

Key: Slow turns had input_tokens=2 but cache_read_input_tokens=75k–158k — latency is NOT from prompt size but server-side processing.

2. Repeated Malformed Tool Calls (9 occurrences)

After long waits, tool calls could not be parsed. Happened 9 times:

00:51, 00:54, 01:02, 01:16, 01:20, 01:33, 01:50, 01:54, 02:00 UTC

At 02:00 UTC the retry also failed, triggering a synthetic fallback — session had to be abandoned.

All 9 malformed errors occurred on responses WITH extended thinking blocks.

3. Extended Thinking Blocks Always Empty

All 77 extended thinking blocks had thinking: "" (empty string) despite having valid cryptographic signatures — possible streaming truncation or serialization bug.

4. Abnormal turn_duration

  • 40.8 minutes (154 tool-call exchanges, ending 01:33 UTC)
  • - 23.8 minutes (360 tool-call exchanges, ending 02:13 UTC)

Hypothesis

The combination of large cache_read_input_tokens (75k–158k, ephemeral 1h cache) + Extended Thinking + inference_geo=not_available triggers a slow/overloaded inference path that also produces malformed JSON tool calls.

Workaround

Switching to claude-sonnet-4-6 avoids the issue entirely.

What Should Happen?

API calls should return within a reasonable time (seconds, not minutes). Tool calls should be well-formed JSON. Extended thinking blocks should contain actual thinking content, not empty strings.

Error Messages/Logs

Your tool call was malformed and could not be parsed. Please retry.
The model's tool call could not be parsed (retry also failed).

Steps to Reproduce

  1. Start Claude Code with claude-opus-4-8 model
  2. 2. Run a long agentic session (1h+) with heavy tool use (Bash, Agent, Write, Read, etc.)
  3. 3. Allow context to accumulate via ephemeral cache (cache_read_input_tokens grows to 75k–158k)
  4. 4. Observe: individual API calls begin taking 6–13+ minutes each
  5. 5. Observe: after long waits, model returns malformed tool calls that cannot be parsed
  6. 6. In severe cases, retry also fails and session must be abandoned

Note: Switching to claude-sonnet-4-6 in the same session immediately resolves the issue.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.162 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Session ID for reference: 6ac29982-425d-4d34-981b-6ceed35db7ec
Session duration: 2026-06-04 00:38–02:37 UTC (~2 hours)
Total records in JSONL: 562
All 77 extended thinking blocks had empty content despite valid signatures.
cache_read_input_tokens peaked at 158,859 tokens.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗