Tool results delayed and duplicated in interactive sessions (v2.1.158, Linux, multiple concurrent sessions)
Symptom
Over the last ~24h, tool calls in interactive sessions exhibit two related problems:
- Tool results arrive seconds late — a noticeable delay between the tool finishing and its result appearing to the model/UI.
- Tool results render duplicated — a single tool call's result is echoed multiple times. For example, one
Readof an unchanged file produced several repeatedWasted call — file unchanged since your last Readresults, and a single batch ofRead/Bashcalls came back with the same outputs repeated.
The duplication causes the model to get confused about what actually ran (it looks like multiple calls completed when only one did).
Local resources are healthy — ruled out
This is not memory/swap/CPU pressure on the host. Measured live:
/proc/pressure/memory:some avg10=0.00 avg60=0.00 avg300=0.00— zero memory-stall time over 10s/60s/300s.vmstat 1:si/so(swap in/out) =0/0on every live sample;wa(io-wait) =0; CPU91–97%idle.kswapd0: cumulative CPU00:01:20over 5 days uptime — no reclaim pressure.- 5s swap-counter delta from
/proc/vmstat: 1 page in, 0 out, 1 major fault — noise, no thrash. - ~6.5 GiB free RAM; load average
0.21 0.65 0.53on 16 cores.
(There is parked swap usage, but it is cold pages Linux offloaded to free cache — not active paging. PSI and si/so confirm nothing stalls on it.)
Hooks — ruled out
Configured PreToolUse/PostToolUse hooks were timed in isolation:
gsd-validate-commit.sh: 22 msgsd-context-monitor.js: 19 msgsd-graphify-update.sh: 28 ms- node cold-start baseline: 18 ms
Total per-Bash hook overhead ~70 ms — far below the multi-second delays observed.
Environment
- Claude Code
2.1.158 - Linux 6.17.0-29-generic, 16 cores, 31 GiB RAM
- 6 concurrent
claudeCLI sessions running with--dangerously-skip-permissions
Possible repro angle (not yet bisected)
The reporter runs 6 concurrent CLI sessions. We did not bisect down to a single session (the reporter needs the sessions running). It is plausible the delayed/duplicated tool results correlate with multiple concurrent sessions contending on some shared client-side state/IPC. If others can reproduce, a useful test would be: does the duplication occur with a single session, or only with several concurrent ones?
Expected
Each tool call returns exactly one result, promptly.
Actual
Results are delayed by seconds and sometimes delivered multiple times for a single call.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗