Intermittent malformed or silently dropped tool calls in long sessions (1M context, post-compaction)

Open 💬 1 comment Opened Jul 2, 2026 by rascal-sl

Description

In a long-running session, assistant tool calls intermittently fail in one of two ways:

  1. The harness returns "Your tool call was malformed and could not be parsed. Please retry." for well-formed calls (Bash, Edit, Read, Write all affected).
  2. The call is emitted but never executes. No tool result comes back, the assistant turn ends silently, and to the user it looks like the assistant froze mid-task. The user has to type "continue" to nudge the session forward.

Re-sending the exact same call verbatim usually succeeds, so the call content itself is not the problem. Failures cluster after the session becomes very long and has been auto-compacted several times. Short fresh sessions do not show the issue.

Environment

  • Claude Code Desktop on macOS (Darwin 25.5.0)
  • Version 2.1.170 when the failures occurred (since updated to 2.1.198, not yet re-verified in a fresh long session)
  • Model: claude-opus-4-8 with 1M context
  • Happened dozens of times across one long session on 2026-07-02, roughly every 2 to 5 calls at its worst

Steps to reproduce

  1. Run one session for many hours with a 1M context model until it auto-compacts multiple times.
  2. Continue issuing tasks that require frequent tool calls.
  3. Observe intermittent "malformed and could not be parsed" errors and silently dropped calls.

Expected

Tool calls parse and execute consistently regardless of session length or compaction count.

Workarounds that helped

  • Small single-purpose calls instead of large compound ones
  • Writing files via bash heredoc or a python script instead of the Edit tool
  • Verifying state on disk after every write, since a dropped call leaves no result

View original on GitHub ↗

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