[BUG] Custom statusLine permanently stops being invoked after a subagent/response completes at project scope — but not at user scope
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?
A custom statusLine (type: command) in PROJECT settings (.claude/settings.local.json) renders fine at first, then permanently disappears mid-session — usually right after a subagent/Task or an assistant response completes. It never re-renders; only restarting Claude Code brings it back. refreshInterval: 10 is set but does NOT revive it.
The SAME command in USER settings (~/.claude/settings.json) does not disappear under the same workload.
I instrumented the script to log one line per invocation. Evidence:
- Every invocation that ran finished in <30 ms with valid, non-empty output and exit 0 — so it is NOT the script erroring, timing out, or producing empty output.
- When the line vanished, the log simply STOPPED for that session — i.e. Claude Code stopped spawning the command — while the
claudeprocess stayed alive (verified withps). - A ~50x slower statusline (ccstatusline via
npx, ~1.4 s/render) at USER scope did NOT disappear, ruling out script speed/timeout.
So at project scope Claude Code stops invoking the command after subagent/response completion; at user scope it keeps invoking it. Terminal- and OS-independent (persisted across Ubuntu 24.04 → 26.04 desktop and a full terminal change).
What Should Happen?
The statusLine command should keep being invoked for the whole session (including via refreshInterval), at both project and user scope. It must not permanently stop after a subagent/Task or an assistant response completes.
Error Messages/Logs
None — the absence of errors is the signal. The command never errors or exits non-zero; Claude Code just stops calling it. Per-invocation logging shows regular ~10 s ticks (refreshInterval) that abruptly stop the moment a subagent/response completes, while the `claude` process keeps running.
Steps to Reproduce
Minimal repro using a trivial marker command (no custom script, no Node):
- In a project, create
.claude/settings.local.json:
{
"statusLine": {
"type": "command",
"command": "sh -c 'date +%s >> /tmp/sl-ticks.log; echo statusline-alive'",
"refreshInterval": 10
}
}
- Start Claude Code there. Confirm the line shows
statusline-aliveand/tmp/sl-ticks.loggrows every ~10 s (tail -f /tmp/sl-ticks.log). - Send a prompt that spawns a subagent/Task (or run several normal turns) and let it complete.
- Observe: the line disappears AND
/tmp/sl-ticks.logstops growing — whileclaudeis still running (ps aux | grep claude). It returns only after a restart. - Move the SAME block to user settings
~/.claude/settings.json(remove it from the project file), restart, and repeat. The line keeps rendering and the marker log keeps growing.
The bug is intermittent ("after several iterations / after a subagent"), so step 3 may take a few cycles to trigger.
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.158
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
- Reproduced on Ubuntu 26.04 desktop (also seen on 24.04) and across different terminal emulators (incl. Ptyxus) → not terminal- or OS-specific.
refreshInterval: 10was set and did NOT revive the line after it vanished.- Saving any settings file triggers a statusline reload that revives a dead line WITHOUT a full restart (useful workaround, and a hint that the invocation loop can be re-initialized).
- Workaround: define
statusLinein~/.claude/settings.json(user scope) instead of project scope. - Possibly related: #21304 (after Task/subagent), #18955 (after slash commands), #29383, #52637; and closed-not-planned #43826. The new element here is project-scope vs user-scope.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗