Agent Skills
› Alfredvc/claude-metadata
› api-usage
api-usage
GitHub用于查询项目 Claude API 的 Token 用量和费用明细。当用户询问 API 成本、支出或使用情况时触发,通过运行脚本展示格式化后的终端输出。
Trigger Scenarios
询问 API 费用
查询 Token 使用量
查看 Claude Code 花费
Install
npx skills add Alfredvc/claude-metadata --skill api-usage -g -y
SKILL.md
Frontmatter
{
"name": "api-usage",
"description": "Show Claude API token usage and cost breakdown for a project. Use when the user asks about API costs, spending, token usage, or how much Claude Code has cost.",
"allowed-tools": "Bash(python3 *)",
"argument-hint": [
"project_dir"
],
"user-invocable": true
}
Run the api-usage script for the given project directory (default: current working directory):
python3 scripts/api_usage.py [project_dir]
- If the user doesn't specify a directory, use the current project root.
- Pass
--no-subdirsif the user only wants the main project, not worktrees or sub-dirs. - Pass
--allto scan every Claude project at once. - Present the output as-is — it's already formatted for the terminal.
Version History
- 8de4631 Current 2026-07-25 07:25


