Feature Request - refresh status line on an interval
It would be very helpful if the statusline script could be configured to automatically refresh on an interval. Right now it only updates after you interact with Claude.
As an example, I added a statusline script that will check Github to see the status of the PR associated with the branch I'm working on. I would like that status to update every minute or so, even if there hasn't been any activity in Claude code. I often leave it Claude code idling in a terminal window and hop back to it when I need it. If I haven't interacted with Claude code for a while, the status line can be out of date.
I imagine a refreshIntervalSeconds setting like this:
{
"statusLine": {
"type": "command",
"command": "ruby ~/.claude/statusline.rb",
"refreshIntervalSeconds": 30
}
}
This would cause my statusline script to be run at least every 30 seconds, even if there hasn't been any activity within my Claude code session.
Hey, this is a really interesting idea. I can see how that would be super useful, especially for your use case of monitoring a PR status.
I just looked through the documentation to see if this was possible, and you're spot on about the current behavior. The statusline documentation page says:
The status line is updated when the conversation messages update
So it's definitely tied to activity in the conversation right now. I also checked the changelog and the settings.json reference, and there's no mention of a refresh interval setting like the one you proposed (which seems like a perfect way to implement it, by the way). The most recent changelog entry for the status line (v1.0.85) was just to add cost info to the input JSON.
I was thinking about potential workarounds, maybe with hooks, but all the hook events seem to be tied to specific actions (like PreToolUse, SessionStart, etc.) rather than a timer, so that doesn't look like an option either.
The only thing I could think of is that a constant background refresh might be tricky to implement without adding performance overhead, especially for scripts that make network calls like yours. But being able to configure the interval, like you suggested, would probably put that in the user's control.
Anyway, just wanted to add my +1 to this. It would make the status line a lot more powerful for dynamic information. Hopefully the team sees this
I'm all in favor of a configurable refresh rate in milliseconds. It seems v1.0.88 runs the statusline constantly (I was even able to play a movie in the statusline), but this has definite performance impacts, especially if the status line is called via a tool like npx or uvx.
I love the movie hack.
Was there an update that made the status line refresh on an interval? I've only seen my status line updating after Claude finishes with a prompt. I just did a test with v1.0.89 to show the date with seconds in the status line and it's not updating at all unless I have Claude do something. When I run a prompt, I do see the status line updating from time to time. I'm guessing it runs the status line update every time a hook is executed.
Was there an update that made the status line refresh on an interval?
v1.0.88 continuously called the statusline, then they 'fixed' it by reverting the behavior in v1.0.89. I understand why it was necessary to revert, just wish it was configurable.
I would love this.
+1 for a configurable refresh interval
Use cases where periodic refresh improves Human-Agent Interaction:
- Session duration - Helps maintain awareness of how long an agent has been working, especially during autonomous multi-step tasks.
- Background task status - Builds, test suites, or deployments running via run_in_background. No way to see completion without sending a message.
- Git sync status - Teammates pushing changes or CI completing affects the shared codebase. Stale indicators mean the human can't trust the displayed state.
- System health - Battery, memory, or disk pressure during long autonomous runs. The agent may be working fine, but the system is about to interrupt it.
- External integrations - MCP servers, webhooks, or any external state that changes independently of the conversation. The statusline is the natural place to surface these.
- Cost/token tracking - During long tool chains, usage accumulates but the display lags. Real-time awareness helps humans decide when to intervene or let the agent continue.
The statusline is the human's peripheral awareness of agent state. A configurable refresh interval (default 30s, user-adjustable) would make it a reliable dashboard rather than a snapshot that's often stale.
确认这个问题仍然存在
我在 Claude Code v2.1.19 上也遇到了同样的问题。
我的配置
"statusLine": {
"type": "command",
"command": "~/.claude/statusline-command.sh",
"padding": 1,
"refreshInterval": 1000
}
实际行为
- ✅ 状态栏脚本正常执行
- ✅ 每次有用户交互时,时间会更新
- ❌ 但在空闲时不自动刷新 - 即使设置了
refreshInterval: 1000
我的测试
我使用以下脚本测试过:
#!/bin/bash
current_time=$(date +%H:%M:%S)
current_dir=$(pwd | sed 's|^/Users/build|~|')
git_branch=$(git -c core.autocrlf=false branch --show-current 2>/dev/null | sed 's/^/ on /')
printf '%s | %s%s' "$current_time" "$current_dir" "$git_branch"
直接执行脚本时,时间会正确更新。但在 Claude Code 中,如果不进行任何操作,时间会保持不变,直到有新的输入才会更新。
环境
- macOS (Darwin 25.3.0)
- Claude Code 2.1.19
- Shell: bash/zsh
建议的配置格式
我同意原 issue 提议的配置方式:
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline-command.sh",
"refreshIntervalSeconds": 30
}
}
或者让现有的 refreshInterval(毫秒)配置真正生效。
操作系统: macOS (Darwin 25.3.0) Claude Code 版本: 2.1.19
Is there any progress on this, i would really love this to be fixed
+1! Any updates?
+1