Spend over time: by-day/by-week/by-month/by-project commands (rename :cost to :report, v1.1.0)#1
Merged
Merged
Conversation
…o :report (v1.1.0) Claude Code always namespaces plugin commands, and bare /cost is a built-in alias for /usage, so this plugin's command was only ever reachable as /claude-code-cost:cost (never /cost). Rename the command to :report so the namespaced form reads cleanly, and add four sibling commands for spend over time: /claude-code-cost:report per project + branch (today / week / month) /claude-code-cost:by-day spend per day, dated, most recent first /claude-code-cost:by-week spend per Monday-based week, dated /claude-code-cost:by-month spend per calendar month, dated /claude-code-cost:by-project per project (branches merged) + last active date Every command takes an optional [filter] (substring on project/branch) and --json. cost.mjs now makes a single deduped, point-in-time-priced pass over the JSONL and each mode aggregates from that one event list. The by-* views read the raw logs directly because `budgetclaw status` only emits the pre-rolled today/week/month snapshot with no per-date data; :report keeps the BudgetClaw integration. Tests extended to cover all new modes (50 checks). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a command family for viewing Claude Code spend over time, and renames the single command from
:costto:report./claude-code-cost:report:cost)/claude-code-cost:by-day/claude-code-cost:by-week/claude-code-cost:by-month/claude-code-cost:by-projectEvery command takes an optional
[filter](substring on project/branch) and--json.Why the rename
Claude Code always namespaces plugin commands, and bare
/costis a built-in alias for/usage. The command was therefore only ever reachable as/claude-code-cost:cost, never/cost— so the landing copy that said "run /cost" was wrong.:reportreads cleanly under the mandatoryclaude-code-cost:prefix.How
cost.mjsnow makes a single deduped, point-in-time-priced pass over the JSONL; each mode aggregates from that one event list. Theby-*views read the raw logs directly (BudgetClaw'sstatushas no per-date data);:reportkeeps the BudgetClaw passthrough.Tests
node scripts/test.mjsextended to cover every new mode and the unknown-mode error path (50 checks pass).check-manifests.mjsandclaude plugin validate . --strictgreen.🤖 Generated with Claude Code