claude-code - 💡(How to fix) Fix Harness hangs indefinitely after Skill tool returns tool_result — no API call, no assistant event, no token usage [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47996Fetched 2026-04-15 06:36:21
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×5

After invoking the Skill tool, the harness occasionally hangs for many minutes with zero visible activity — no assistant event written to the session JSONL, no usage block, no token delta. The model is never called. The only recovery is to interrupt with Esc/Ctrl+C and resend.

I first assumed these were slow extended-thinking turns, but the JSONL proves otherwise: real thinking writes an assistant event at the end with a usage block; these stalls write nothing at all between the Skill tool's tool_result event and the user's interrupt event.

Error Message

  • fail visibly with an error event.
  1. Add a client-side timeout + error event when a turn has been in "awaiting assistant response" state for > N seconds with no network activity, so users can tell hang from think.

Root Cause

After invoking the Skill tool, the harness occasionally hangs for many minutes with zero visible activity — no assistant event written to the session JSONL, no usage block, no token delta. The model is never called. The only recovery is to interrupt with Esc/Ctrl+C and resend.

I first assumed these were slow extended-thinking turns, but the JSONL proves otherwise: real thinking writes an assistant event at the end with a usage block; these stalls write nothing at all between the Skill tool's tool_result event and the user's interrupt event.

Fix Action

Fix / Workaround

  1. Log the exact point between "Skill tool_result written to JSONL" and "request dispatched to API" — is the request being constructed? Submitted? Waiting on a lock?
  2. Check whether skill content of certain sizes (the two observed stalls were triggered by skills with ~300–600 line markdown bodies) crosses a buffer/chunking threshold.
  3. Add a client-side timeout + error event when a turn has been in "awaiting assistant response" state for > N seconds with no network activity, so users can tell hang from think.
RAW_BUFFERClick to expand / collapse

Summary

After invoking the Skill tool, the harness occasionally hangs for many minutes with zero visible activity — no assistant event written to the session JSONL, no usage block, no token delta. The model is never called. The only recovery is to interrupt with Esc/Ctrl+C and resend.

I first assumed these were slow extended-thinking turns, but the JSONL proves otherwise: real thinking writes an assistant event at the end with a usage block; these stalls write nothing at all between the Skill tool's tool_result event and the user's interrupt event.

Environment

  • Claude Code version: 2.1.107
  • Platform: darwin 25.4.0 (macOS)
  • Shell: zsh
  • Model: claude-opus-4-6 (1M context)
  • Project location: iCloud Drive (~/Library/Mobile Documents/com~apple~CloudDocs/...) — may or may not be relevant

Reproducer (observed)

  1. Start a normal Claude Code session in a project directory.
  2. Invoke a Skill via the Skill tool (e.g. superpowers:writing-plans, superpowers:subagent-driven-development). The skill content is returned as a tool_result event in the session JSONL.
  3. Claude should now emit its next assistant turn (thinking + text + any tool calls).
  4. Instead: nothing happens. No assistant event. No usage record. Silence for minutes until the user interrupts.

Not 100% reproducible on every Skill invocation — observed 2–3 times in a single day of heavy use. Correlation with the Skill tool is tight: every observed stall begins on the turn immediately following a Skill tool_result.

Evidence from JSONL

Two sessions from 2026-04-14, same project, analyzed by parsing the JSONL files in ~/.claude/projects/<slug>/<session>.jsonl:

SessionGapBEFORE eventAFTER eventAssistant event in gap?usage block?
23a3cec3…40.7 minuser / tool_result — Skill returning subagent-driven-development contentuser / text [Request interrupted by user]NoNo
08020c86…8.4 minuser / tool_result — Skill returning writing-plans contentqueue-operation (user's interrupt message)NoNo
23a3cec3… (control)10.2 minattachmentassistant with tool_use BashYesYes (cache_read_input_tokens=364262, output_tokens=343)

The "control" row is a legitimate slow-thinking turn in the same session — it writes a full assistant event with a usage block at the end. The two stall rows have zero events between the Skill tool_result and the interrupt, proving the model was never invoked.

Expected behavior

After a Skill tool_result arrives, the harness should send the conversation to the API within seconds, and either:

  • produce an assistant event with a usage block (possibly many seconds later for long thinks), or
  • fail visibly with an error event.

Actual behavior

The harness enters a state where no API request is made (no assistant event, no token usage) and remains there indefinitely until the user interrupts. After interrupt + retry, the same turn completes normally in seconds.

Impact

From the user's side it is indistinguishable from a hang. We lost 40+ minutes in a single instance and had to interrupt and resend. The UI status bar shows a token counter that never ticks, which is the giveaway — but it's easy to mistake for "Claude is thinking very hard."

Diagnostic suggestions

  1. Log the exact point between "Skill tool_result written to JSONL" and "request dispatched to API" — is the request being constructed? Submitted? Waiting on a lock?
  2. Check whether skill content of certain sizes (the two observed stalls were triggered by skills with ~300–600 line markdown bodies) crosses a buffer/chunking threshold.
  3. Add a client-side timeout + error event when a turn has been in "awaiting assistant response" state for > N seconds with no network activity, so users can tell hang from think.

Happy to share the full JSONL files privately if useful — they contain project context so I'd rather not attach publicly.

extent analysis

TL;DR

The issue can be mitigated by implementing a client-side timeout and error event when a turn has been in "awaiting assistant response" state for an extended period with no network activity.

Guidance

  • Investigate the point between "Skill tool_result written to JSONL" and "request dispatched to API" to determine if the request is being constructed, submitted, or waiting on a lock.
  • Check if the size of the skill content is causing the issue, potentially crossing a buffer or chunking threshold, especially for skills with ~300-600 line markdown bodies.
  • Implement a client-side timeout and error event when a turn has been in "awaiting assistant response" state for > N seconds with no network activity to distinguish between a hang and a long think.
  • Consider logging the exact point where the request is being constructed and submitted to the API to gain more insight into the issue.

Example

No code example is provided as the issue does not specify a particular code snippet that needs to be modified.

Notes

The issue seems to be related to the interaction between the Skill tool and the API, and the provided JSONL files may contain valuable information for further diagnosis. However, without access to the full JSONL files or more detailed logs, it is challenging to provide a more specific solution.

Recommendation

Apply a workaround by implementing a client-side timeout and error event to mitigate the issue and provide a better user experience. This will allow users to distinguish between a hang and a long think, and potentially provide more insight into the root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

After a Skill tool_result arrives, the harness should send the conversation to the API within seconds, and either:

  • produce an assistant event with a usage block (possibly many seconds later for long thinks), or
  • fail visibly with an error event.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING