Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

cc-statusline-fixed

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cc-statusline-fixed

Claude Code statusline plugin - fixed version with settings.json auth support and 15s timeout for slow DNS

latest
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

cc-statusline-fixed

Claude Code 状态栏插件,为通过第三方 API 端点(如 gaccode)使用 Claude Code 的用户提供余额显示。

效果预览

📁 my-project | 💳 6100/12000 🔥 (2x) | -24↓ | ⚡150t/s | sonnet-4.6 | ctx:25%
  • 📁 当前工作目录
  • 💳 当前积分余额 / 积分上限
  • 🔥 2x 当前时间倍率(高峰期红色显示,优惠期蓝色显示,1x 时不显示)
  • -24↓ 上一轮对话消耗的积分数
  • ⚡150t/s 本次会话平均 token 输出速率(output tokens / API 耗时)
  • sonnet-4.6 当前使用的模型
  • ctx:25% 上下文窗口使用率

与原版的区别

功能原版 cc-statusline-plugin本插件
从环境变量读取 token
~/.claudecode/config 读取 token
~/.claude/settings.json 读取 token
~/.claude/settings.json 读取 API 端点
显示每轮消耗积分
显示 token 输出速率
API 超时时间5 秒15 秒(适配 DNS 较慢的网络环境)

安装

需要 Node.js 16+。

npm install -g cc-statusline-fixed

安装时会自动在 ~/.claude/settings.json 中写入 statusLine 配置。

配置

编辑 ~/.claude/settings.json,加入以下内容:

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "你的 token",
    "ANTHROPIC_BASE_URL": "https://你的API端点"
  },
  "statusLine": {
    "type": "command",
    "command": "cc-statusline"
  }
}

statusLine 部分安装时已自动写入,只需手动补充 env 部分。

gaccode 用户配置示例

{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-ant-oat01-xxxxxxxx",
    "ANTHROPIC_BASE_URL": "https://gaccode.com/claudecode"
  },
  "statusLine": {
    "type": "command",
    "command": "cc-statusline"
  }
}

认证优先级

插件按以下顺序查找认证信息,找到即停止:

  • 环境变量 ANTHROPIC_API_KEY
  • 环境变量 ANTHROPIC_AUTH_TOKEN
  • ~/.claude/settings.jsonenv.ANTHROPIC_AUTH_TOKEN
  • ~/.claudecode/configtoken

验证安装

启动 Claude Code 后,状态栏应显示余额信息。也可以手动测试:

echo '{}' | cc-statusline

常见问题

状态栏显示 ⚠️ No API key or auth token

检查 ~/.claude/settings.json 中是否正确配置了 ANTHROPIC_AUTH_TOKEN

状态栏显示 ⚠️ API unavailable

网络问题或 API 端点不可达。如果你的 DNS 解析较慢,插件已将超时设为 15 秒,通常可以自动恢复。也可以在 /etc/hosts 中添加 API 服务器的 IP 来加速 DNS:

# 以 gaccode 为例(IP 以实际为准)
echo "45.78.77.171 relay01.gaccode.com" | sudo tee -a /etc/hosts

手动重新配置

cc-statusline setup

卸载

npm uninstall -g cc-statusline-fixed

Keywords

claude-code

FAQs

Package last updated on 16 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts