/ 目录 / 演练场 / ccstatusline
● 社区 sirmalloc ⚡ 即开即用

ccstatusline

作者 sirmalloc · sirmalloc/ccstatusline

为 Claude Code CLI 打造真正的状态栏——powerline 风格、可定制组件、工作时实时显示费用/用量。

ccstatusline 用 tmux/powerline 风格状态栏替代裸提示符。组件显示模型、已消耗 token、当前费用、git 分支等。再也不用事后才发现账单有多高。

为什么要用

核心特性

实时演示

实际使用效果

就绪

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "sirmalloc-ccstatusline": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/sirmalloc/ccstatusline"
      ],
      "_inferred": true
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "sirmalloc-ccstatusline": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/sirmalloc/ccstatusline"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "sirmalloc-ccstatusline": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/sirmalloc/ccstatusline"
      ],
      "_inferred": true
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "sirmalloc-ccstatusline": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/sirmalloc/ccstatusline"
      ],
      "_inferred": true
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "sirmalloc-ccstatusline",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/sirmalloc/ccstatusline"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "sirmalloc-ccstatusline": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/sirmalloc/ccstatusline"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add sirmalloc-ccstatusline -- git clone https://github.com/sirmalloc/ccstatusline

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: ccstatusline

实时看到会话费用累积

👤 Claude Code 用户 ⏱ ~15 min intermediate

何时使用: 你曾被意外账单坑过。

步骤
  1. 安装
    Add ccstatusline to your harness config.✓ 已复制
    → 状态栏可见
  2. 配置
    Pin cost + token widgets.✓ 已复制
    → 费用追踪开启
  3. 工作
    See costs grow in real time.✓ 已复制
    → 预算掌握更好

结果: 再也不会收到意外的 Anthropic 账单。

组合

与其他 MCP 搭配,撬动十倍杠杆

sirmalloc-ccstatusline + claude-code-safety-net

状态栏 + 安全钩子 = 更好的日常 UX

Combine sirmalloc-ccstatusline with claude-code-safety-net: Statusline + safety hooks = better daily UX✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
statusline-widgets (见文档) 可配置组件,不是可调用 tool 1 次调用

成本与限制

运行它的成本

API 配额
不适用
每次调用 Token 数
0
费用
免费
提示
选 3–4 个组件即可;太多反而成噪音

安全

权限、密钥、影响范围

凭据存储:
数据出站:

故障排查

常见错误与修复

字形显示异常

安装 Nerd Font;powerline 字形需要它

替代方案

ccstatusline 对比其他方案

替代方案何时用它替代权衡
默认提示符你不在意裸提示符无费用可见性

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills