[BUG] Bash and Read tool outputs arriving one turn late

Resolved 💬 3 comments Opened May 29, 2026 by dwalleck Closed Jul 3, 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?

(Description written by Claude for better accuracy) Session ID: d848440f-3756-4916-8e74-9c209dfc605b

During an interactive Claude Code session, Bash and Read tool outputs began arriving one turn late — each command's real output only surfaced after the next tool call was issued, rather than immediately. Over the session this degraded further into tool results being lost entirely ("Tool result missing due to internal error").

Symptoms (in order of progression)

  1. Bash commands initially returned blank; their actual stdout appeared on the following tool call (consistent ~1–2 turn lag).
  2. Some results were dropped outright instead of just delayed.
  3. One Read returned corrupted/garbled content that did not match the file on disk.
  4. Large outputs were redirected to a persisted-output file, which still resolved correctly.

Impact
Forced a workaround of issuing throwaway no-op commands (printf 'flush\n') to advance/drain the buffer, plus a switch to writing results to temp files and reading them back. Many wasted tool calls and difficulty confirming whether operations (including a git commit) actually succeeded.

Workarounds that helped

  • Redirecting command output to a temp file (cmd > /tmp/out.txt) then reading the file rendered more reliably than raw bash stdout.
  • Issuing extra trivial calls to flush previously stuck output.

What Should Happen?

Tool output should arrive on the same turn

Error Messages/Logs

● Bash(printf 'flush\n')
  ⎿  flush

● Bash(cd /home/dwalleck/.claude/projects/-home-dwalleck-repos-rivets
      {…)
  ⎿  written
  ⎿  Shell cwd was reset to /home/dwalleck/repos/rivets
  ⎿  Allowed by auto mode classifier

● Bash(printf 'f2\n')
  ⎿  f2

  Read 1 file (ctrl+o to expand)

● Bash(printf 'f3\n')
  ⎿  f3

  Read 1 file (ctrl+o to expand)

● Bash(printf 'f4\n')
  ⎿  f4

Steps to Reproduce

This is just happening in any session without any special behavior.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.156

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

Session ID: d848440f-3756-4916-8e74-9c209dfc605b

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗