ascoders / ascoders/weekly

【开源自荐】Claude Statistics:macOS 菜单栏原生应用,实时监控 Claude Code 的 Token 用量与费用

Open
#528 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
31.1k
Forks
3.3k
PR merge metrics
No merged PRs in 30d

Description

**项目地址:** https://github.com/sj719045032/claude-statistics
**下载:** https://github.com/sj719045032/claude-statistics/releases
**协议:** MIT

用 Claude Code 重度开发了一段时间之后,我一直有几个痛点解决不了:不知道每天花了多少钱、不知道还剩多少 quota、也无法快速回顾之前的会话内容。于是做了 **Claude Statistics** —— 一个原生 macOS 菜单栏应用,专门为 Claude Code 用户设计。

**核心功能:**

- **统计分析**:按日/周/月/年汇总 Token 用量和费用,交互式图表一眼看清支出趋势,支持多模型拆分(Opus / Sonnet / Haiku)和 Cache Token 明细
- **会话管理**:自动从 `~/.claude/projects/` 发现并解析所有会话,支持按项目路径、话题、内容搜索,直接在 App 内查看完整对话记录(含工具调用详情)
- **订阅用量监控**:实时拉取 Anthropic 用量 API,展示 5 小时 / 7 天用量窗口、速率限制进度条和重置倒计时,杜绝被限速打断
- **会话操作**:一键在常用终端(Ghostty / iTerm2 / Warp 等)中恢复或新建 Claude Code 会话
- **Claude Code 状态栏集成**:可作为 Claude Code 的 status line provider,在终端直接显示当前用量

**特点:**

- 纯本地运行,解析本地 JSONL 记录和 macOS Keychain 中的 OAuth Token,不上传任何数据
- SwiftUI + AppKit 混合架构,常驻菜单栏,无 Dock 图标
- 支持 Sparkle 自动更新,内置定价文件可自定义

**安装:**

下载 DMG 拖入 Applications 即可。因未做 Apple 公证,首次启动需执行:

```bash
xattr -cr /Applications/Claude\ Statistics.app
```

macOS 14+ 可用,欢迎试用和反馈!

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository file, test, or entry point is named. The issue is a self-promotion post describing an external macOS application, with no requested change or completion criterion to implement.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, swift
Domain
content, desktop
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.