npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cc-statusline-fixed

v1.0.5

Published

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

Readme

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"
  }
}

认证优先级

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

  1. 环境变量 ANTHROPIC_API_KEY
  2. 环境变量 ANTHROPIC_AUTH_TOKEN
  3. ~/.claude/settings.jsonenv.ANTHROPIC_AUTH_TOKEN
  4. ~/.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