shelltime/claude-code-mods/tree/main/plugins/shelltime-statusline
shelltime-statusline
Claude Code 的 ShellTime 提示栏:在终端和桌面应用中显示 Git、模型、会话与每日费用、配额、代理时间和上下文
关于这个 mod
shelltime-statusline
作为 Claude Code 外挂的 ShellTime 提示栏。它会在提示符上方的横条中绘制 ShellTime 提示栏。它既运行在终端中,也运行在 Claude 桌面应用的 Code 标签页中;那里不会绘制 settings.json 中的 statusLine 命令。
在终端中,它与 shelltime cc statusline 显示相同的一行,使用 Claude Code 的主题颜色,因此会跟随 /theme:
🌿 main* | 🤖 Opus 5.5 | 💰 $1.23 | 📊 $12.50 | 🚦 5h:23% 7d:45% | ⏱️ 1h5m | 📈 42%
在桌面应用中,它是一行平面内容,没有边框或内边距,使用在浅色和深色主题下都清晰的色调。配额和上下文会在每个百分比旁显示细条。桌面应用中不显示模型,因为编辑器页脚已经显示了它。
🌿 main* 💰 $1.23 📊 $12.50 🚦 5h ━━── 23% 7d ━━━─ 45% ⏱️ 1h5m 📈 ━━── 42%
| 分段 | 显示内容 | 颜色 | 链接 |
| --- | --- | --- | --- |
| 🌿 | Git 分支;工作树有改动时显示 * | 绿色;仓库外显示灰色 - | |
| 🤖 | 模型(仅终端) | | |
| 💰 | 本次会话费用 | 青色 | shelltime.xyz 上的会话 |
| 📊 | 今天的 Claude Code 费用 | 黄色(桌面端为琥珀色);没有数据时显示灰色 - | 你的编码代理页面 |
| 🚦 | 已使用的 5 小时和 7 天配额 | 绿色,50% 起黄色,80% 起红色;桌面端每个配额桶都有自己的条和颜色 | claude.ai 用量 |
| ⏱️ | 今天的 AI 代理时间 | 品红色;没有数据时显示灰色 - | 你的个人资料 |
| 📈 | 已使用的上下文窗口;桌面端带条 | 绿色,50% 起黄色,80% 起红色 | |
安装
claude plugin marketplace add shelltime/claude-code-mods
claude plugin install shelltime-statusline@shelltime
同一台机器上的桌面会话会加载相同的已安装外挂。
配置
这个外挂不需要配置。它按 CLI 相同的顺序读取 ShellTime CLI 自己的配置文件 ~/.shelltime/config.yaml(也支持 .yml / .toml,并将 config.local.* 合并在上面)。运行一次 shelltime init 后,外挂就会获取你的令牌。文件变更会在下一次刷新时读取。
外挂不需要 shelltime 二进制文件或其守护进程。没有令牌时,它仍会显示 Git、模型、会话费用、配额和上下文。每日费用和代理时间显示 -,也不会向 ShellTime 发送任何内容。
数字的来源
| | shelltime cc statusline | 此外挂 |
| --- | --- | --- |
| git | 守护进程运行 git | 运行相同的 git 命令(GIT_OPTIONAL_LOCKS=0) |
| 模型、会话费用、上下文 | Claude Code 的提示栏 JSON | 相同的数据,直接来自 Claude Code |
| 配额 | 守护进程使用钥匙串中的 OAuth 令牌调用 Anthropic 用量 API | Claude Code 已从上一次 API 响应读取的速率限制。不访问钥匙串,可在任何操作系统上运行 |
| 每日费用、代理时间 | 守护进程查询 ShellTime API | 相同的 GraphQL 查询,最多每 15 s 一次 |
| 会话 → 项目映射 | 发送到 ShellTime API | 相同的请求,每个会话和目录各一次 |
和原生提示栏一样,它会随着对话变化刷新:发送提示时、每次工具调用后,以及一轮结束时。会话空闲时不会轮询。
终端
如果 ~/.claude/settings.json 也有运行 shelltime cc statusline 的 statusLine,终端会显示两行。可以保留两行,也可以移除其中一行。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add shelltime/claude-code-mods claude plugin install shelltime-statusline
原文 / README
shelltime-statusline
The ShellTime statusline as a Claude Code mod. It draws the ShellTime statusline in a band above the prompt. It runs in the terminal and in the Code tab of the Claude desktop app, where the statusLine command from settings.json is not drawn.
In the terminal it is the same line as shelltime cc statusline, in Claude Code's theme colors, so it follows /theme:
🌿 main* | 🤖 Opus 5.5 | 💰 $1.23 | 📊 $12.50 | 🚦 5h:23% 7d:45% | ⏱️ 1h5m | 📈 42%
In the desktop app it is one flat row, with no borders or padding, in tones that read on the light and the dark theme. Quota and context get a thin bar beside each percentage. The model is left out there, since the composer's footer already shows it.
🌿 main* 💰 $1.23 📊 $12.50 🚦 5h ━━── 23% 7d ━━━─ 45% ⏱️ 1h5m 📈 ━━── 42%
| Segment | Shows | Color | Link |
| --- | --- | --- | --- |
| 🌿 | Git branch, with * when the tree is dirty | green, gray - outside a repo | |
| 🤖 | Model (terminal only) | | |
| 💰 | This session's cost | cyan | the session on shelltime.xyz |
| 📊 | Today's Claude Code cost | yellow (amber on desktop), gray - with none | your coding agent page |
| 🚦 | 5-hour and 7-day quota used | green, yellow from 50%, red from 80%; on desktop each bucket has its own bar and color | claude.ai usage |
| ⏱️ | Today's AI agent time | magenta, gray - with none | your profile |
| 📈 | Context window used, with a bar on desktop | green, yellow from 50%, red from 80% | |
Install
claude plugin marketplace add shelltime/claude-code-mods
claude plugin install shelltime-statusline@shelltime
Desktop sessions on the same machine load the same installed plugins.
Configuration
There is nothing to configure in the mod. It reads the ShellTime CLI's own config file, ~/.shelltime/config.yaml (or .yml / .toml, with config.local.* merged over it), in the same order the CLI does. Run shelltime init once and the mod picks up your token. Changes to the file are picked up on the next refresh.
The mod doesn't need the shelltime binary or its daemon. Without a token it still shows git, model, session cost, quota and context. Daily cost and agent time show -, and nothing is sent to ShellTime.
Where the numbers come from
| | shelltime cc statusline | this mod |
| --- | --- | --- |
| git | the daemon runs git | runs the same git commands (GIT_OPTIONAL_LOCKS=0) |
| model, session cost, context | Claude Code's statusline JSON | the same figures, from Claude Code directly |
| quota | the daemon calls Anthropic's usage API with the OAuth token from the Keychain | the rate limits Claude Code already read from its last API response. No Keychain access, works on any OS |
| daily cost, agent time | the daemon queries ShellTime's API | the same GraphQL query, at most once every 15 s |
| session → project mapping | sent to ShellTime's API | the same request, once per session and directory |
Like the native statusline, it refreshes as the conversation changes: when you send a prompt, after each tool call, and when a turn ends. It doesn't poll while the session is idle.
Terminal
If ~/.claude/settings.json also has a statusLine running shelltime cc statusline, the terminal shows both lines. Keep both, or remove one.
