claude-code - 💡(How to fix) Fix [BUG] Custom statusLine permanently stops being invoked after a subagent/response completes at project scope — but not at user scope

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…

Error Message

Error Messages/Logs

Fix Action

Fix / Workaround

  • Reproduced on Ubuntu 26.04 desktop (also seen on 24.04) and across different terminal emulators (incl. Ptyxus) → not terminal- or OS-specific.
  • refreshInterval: 10 was 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 statusLine in ~/.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.

Code Example

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.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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 claude process stayed alive (verified with ps).
  • 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):

  1. 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 } }

  2. Start Claude Code there. Confirm the line shows statusline-alive and /tmp/sl-ticks.log grows every ~10 s (tail -f /tmp/sl-ticks.log).

  3. Send a prompt that spawns a subagent/Task (or run several normal turns) and let it complete.

  4. Observe: the line disappears AND /tmp/sl-ticks.log stops growing — while claude is still running (ps aux | grep claude). It returns only after a restart.

  5. 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: 10 was 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 statusLine in ~/.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.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Custom statusLine permanently stops being invoked after a subagent/response completes at project scope — but not at user scope