Cost Track
技能 已验证 活跃Auto-capture per-session token usage from the Claude Code session jsonl and persist to the cost-tracking namespace
To provide a transparent and automated way to track the token usage and associated costs of Claude Code sessions for better budget management and reporting.
功能
- Auto-capture per-session token usage
- Persist usage to AgentDB
- Calculate USD cost based on model pricing
- Support for environment variable overrides
- Dry-run capability
使用场景
- Capturing spend after a meaningful chunk of work
- Persisting final tally at session end
- Periodically capturing costs during long sessions
- Providing data for cost reporting and optimization tools
非目标
- Directly managing LLM provider accounts or billing
- Real-time alerting for budget overruns (this is a producer for other skills)
- Providing detailed analysis of *why* tokens were used
工作流
- Run the tracker script from the project root
- Script auto-discovers session jsonl or uses TRACK_SESSION env var
- Calculate cost using defined pricing
- Persist structured record to AgentDB cost-tracking namespace
- Inspect markdown summary and verify persistence
实践
- Cost Tracking
- Session Management
先决条件
- Claude Code environment
- Access to session jsonl files
- AgentDB namespace configured
Code Execution
- info:ValidationWhile the script's operations are well-defined, explicit input validation using a schema library is not evident for environment variables or session data parsing.
- info:LoggingThe script provides markdown output for successful runs and can suppress it with `TRACK_QUIET=1`, but detailed audit logging to a specific file is not explicitly mentioned.
安装
请先添加 Marketplace
/plugin marketplace add ruvnet/ruflo/plugin install ruflo-cost-tracker@ruflo质量评分
已验证类似扩展
Guard
100保护 Claude Code 会话免受上下文溢出影响,通过运行一个后台守护进程来监控会话大小并在压缩命中之前自动进行修剪。当用户说“guard”、“protect session”、“context getting long”、“prevent compaction”、“session management”或正在运行需要持续上下文保护的代理团队时使用。
Session Export
100将 Claude Code 会话导出为干净、可读的 markdown 格式的会话记录。当用户想要导出会话、创建会话记录、将会话历史记录保存到文件或说“导出此会话”时使用。
Validate Plugin
100Validate a Claude Code plugin structure, frontmatter, and MCP tool references
Running Claude Code Via Litellm Copilot
100当通过本地 LiteLLM 代理将 Claude Code 路由到 GitHub Copilot 时使用,以减少直接的 Anthropic 支出,配置 ANTHROPIC_BASE_URL 或 ANTHROPIC_MODEL 覆盖,或对 Copilot 代理设置失败进行故障排除,例如 model-not-found、无 localhost 流量或 GitHub 401/403 身份验证错误。
Create Command
100Interactive assistant for creating new Claude commands with proper structure, patterns, and MCP tool integration
Rule Effectiveness Analysis
100Analyze which rules are actively used vs inert. Detect coverage gaps. Recommend pruning to reduce token consumption.