Agent has no signal for "this tool call is taking too long" — silently waits on hangs
Description
Claude Code's agent has no native sense of elapsed time during long-running tool calls. When a Bash invocation (or any other tool) hangs or runs much longer than expected, the agent simply waits for the result with no internal trigger to:
- Notice the hang.
- Warn the user proactively ("this is taking longer than typical").
- Suggest cancellation or backgrounding.
In a recent session, a Bash tool call for a project-specific dry-run hung for ~10 minutes due to file-lock contention with a concurrently-running sweep. The agent sat passively the entire time, with the user staring at a stalled prompt. The user finally interrupted manually; the agent had no awareness that anything unusual was happening.
Suggested behavior
- Surface elapsed wall time to the agent for in-flight tool calls (e.g., as a system reminder when a
Bashcall exceeds the tool's default timeout). The agent can already settimeoutperBashcall, but it doesn't observe time passing within the call. - After a configurable threshold (e.g., 60–120 seconds for typical commands, or
timeout/2), inject a system reminder allowing the agent to check on the user, suggest a kill, or background the process. - Alternatively, default
Bashtorun_in_background=truefor commands flagged "may take a while," surfacing notifications when they complete.
User pain
The silent wait erodes trust — users can't tell whether the agent is thinking, the tool is working, or everything has stalled. Even a "still waiting on the Bash call (8 min elapsed)" heartbeat would help.
Environment
- Claude Code CLI on macOS
- Model: Claude Opus 4.7 (1M context)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗