add-skill
Free建立符合官方規格的 Claude Code skill:蒐集需求、產出正確格式的 SKILL.md、驗證命名與描述規則、套用 Progressive Disclosure 結構。適合在新增 skill 或 slash command 時使用。
The English summary is being prepared. Showing the original description.
追蹤並計算當前 session 的 Token 使用量和花費(USD)。產出前後對比報告,幫助使用者了解 workspace 優化的實際效益。
The English summary is being prepared. Showing the original description.
See how to installReview the instructions the agent will receive before you install.
| 模型 | Input ($/1M tokens) | Output ($/1M tokens) | Cache Read ($/1M) | Cache Write ($/1M) |
|---|---|---|---|---|
| Opus 4.8 | $5.00 | $25.00 | $0.50 | $6.25 |
| Sonnet 4.6 | $3.00 | $15.00 | $0.30 | $3.75 |
| Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 |
來源:Models overview、Pricing。 Cache Read = 0.1× input、Cache Write(5m) = 1.25× input。Opus 4.8 fast mode 為 premium 定價,不在此表。
在 session 中執行 /cost-tracker,系統將:
統計當前 session 的 Token 使用量
計算花費(USD)
產出前後對比
花費 = (input_tokens × input_price / 1M)
+ (output_tokens × output_price / 1M)
+ (cache_read_tokens × cache_read_price / 1M)
+ (cache_write_tokens × cache_write_price / 1M)
依據 CLAUDE.md 的 Advisor 模式,各角色的 Token 分配比例:
| 角色 | 模型 | 預估 Token 佔比 |
|---|---|---|
| 搜尋探索 | Haiku | ~30% |
| 程式碼實作 + 測試 | Sonnet | ~55% |
| 架構審查 + 顧問 | Opus | ~15% |
### Session Cost Report
| 指標 | 數值 |
|------|------|
| Total Input Tokens | xxx |
| Total Output Tokens | xxx |
| Cache Read Tokens | xxx |
| Cache Write Tokens | xxx |
| **Total Cost (USD)** | $x.xx |
#### 模型分層花費
| 模型 | Tokens | Cost (USD) | 佔比 |
|------|--------|-----------|------|
| Haiku | xxx | $x.xx | xx% |
| Sonnet | xxx | $x.xx | xx% |
| Opus | xxx | $x.xx | xx% |
#### 優化效益
| 指標 | 全 Opus | Advisor 分層 | 節省 |
|------|---------|-------------|------|
| 預估花費 | $x.xx | $x.xx | -xx% |
import { query } from "@anthropic-ai/claude-agent-sdk";
let sessionCost = 0;
const modelBreakdown: Record<string, { tokens: number; cost: number }> = {};
for await (const message of query({ prompt: "your task" })) {
if (message.type === "result") {
sessionCost += message.total_cost_usd;
for (const [model, usage] of Object.entries(message.modelUsage)) {
if (!modelBreakdown[model]) modelBreakdown[model] = { tokens: 0, cost: 0 };
modelBreakdown[model].tokens += usage.inputTokens + usage.outputTokens;
modelBreakdown[model].cost += usage.costUSD;
}
}
}
console.log(`Session total: $${sessionCost.toFixed(4)}`);
for (const [model, data] of Object.entries(modelBreakdown)) {
console.log(` ${model}: ${data.tokens} tokens, $${data.cost.toFixed(4)}`);
}
/usage 是累積值:它顯示從 session 開始到當下的總量,不是「本次操作」的增量。/usage,需確認 SDK 版本行為。No reviews yet. Tell others what you thought.
No login needed. Share how it worked for you, ask a question, or note where it did not run.
No comments yet. Be the first to write one.
建立符合官方規格的 Claude Code skill:蒐集需求、產出正確格式的 SKILL.md、驗證命名與描述規則、套用 Progressive Disclosure 結構。適合在新增 skill 或 slash command 時使用。
The English summary is being prepared. Showing the original description.
啟動 Agent Team 模式,多個 worker 平行處理任務並共享發現。適用於大型重構、codebase 遷移、全面審查。
The English summary is being prepared. Showing the original description.
分析 claude.com/blog 的新文章,提取可操作洞察並更新 workspace 設定。手動調用。
The English summary is being prepared. Showing the original description.
分析當前專案的 Claude Code session 資料,產出 context 效率報告(模型用量、工具效率、委派比例、TodoWrite 使用率)。搭配 context-management.md 使用。
The English summary is being prepared. Showing the original description.
系統性 debug 工作流:捕捉錯誤、分析日誌、關聯跨系統 pattern,產出有根因與修復驗證的報告。適用於 bug、test 失敗、生產異常。
The English summary is being prepared. Showing the original description.
對 staged changes 執行三維度平行審查(安全、效能、風格),合成優先排序的發現摘要。
The English summary is being prepared. Showing the original description.