Skip to content

feat: token budget positioning doc and wtcraft cost command - #11

Closed
zywkloo wants to merge 3 commits into
mainfrom
claude/token-budget-analysis-9r74l
Closed

feat: token budget positioning doc and wtcraft cost command#11
zywkloo wants to merge 3 commits into
mainfrom
claude/token-budget-analysis-9r74l

Conversation

@zywkloo

@zywkloo zywkloo commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • docs/token-budget.md — new positioning doc covering the npm/GitHub token budget tool landscape, competitive analysis, and two primary user narratives (all-free-tier and all-lowest-paid-tier across Claude Code / Codex / Antigravity)
  • wtcraft cost [--all] — new CLI command that reads ~/.claude/projects/**/*.jsonl and aggregates token usage + estimated USD cost per git branch; defaults to active worktree branches, --all shows every recorded branch
  • .gitignore — added to exclude Python build artifacts (__pycache__/, *.egg-info/)

User narratives introduced

Tier Tools Monthly spend Core pain
All free Claude.ai free / Codex trial / Antigravity free (~20 req/day) $0 Quota is scarce — every wasted agent turn costs a day's allowance
All lowest paid Claude Pro + ChatGPT Plus + Antigravity Pro ~$60/mo Rolling windows are independent per tool; parallel agents multiply spend without proportional output

How wtcraft cost works

Reads Claude Code's local JSONL session files — no API key, no proxy. Matches sessions to branches via the gitBranch field already embedded in each record. Pricing table is bundled in _cost.py and covers Sonnet / Opus / Haiku (mid-2026 rates).

The command is intercepted in _cli.py before the bash exec, so it runs in pure Python with no shell-level JSON parsing.

Test plan

  • wtcraft cost — shows only branches for active worktrees in current repo
  • wtcraft cost --all — shows all branches recorded in Claude Code sessions
  • wtcraft help cost — displays usage text
  • wtcraft help — includes cost in command list

https://claude.ai/code/session_01A5oU4c7YSGpwatMA2PK1AE


Generated by Claude Code

claude added 3 commits May 27, 2026 21:04
…user narratives

Integrates npm/GitHub token budget tool landscape research into a new
docs/token-budget.md. Defines two primary user narratives (all-free-tier
and all-lowest-paid-tier across Claude Code / Codex / Antigravity) and
maps wtcraft's layer-2 architecture position against layer-3 observability
tools (CodeBurn, llm-token-tracker) and Anthropic's native Task Budget API.

https://claude.ai/code/session_01A5oU4c7YSGpwatMA2PK1AE
Adds a new `wtcraft cost [--all]` subcommand that reads
~/.claude/projects/**/*.jsonl and aggregates token usage (input, output,
cache_read, cache_write) and estimated USD cost by git branch. No API key
or proxy required — purely local JSONL parsing.

Default view filters to branches visible in the current repo's active
worktrees. --all shows every branch on record.

Implemented in src/wtcraft/_cost.py (Python); _cli.py intercepts the
`cost` argv before delegating to bash, so the shell script needs no JSON
parsing. Help text added to shell script for `wtcraft help cost`.

https://claude.ai/code/session_01A5oU4c7YSGpwatMA2PK1AE
@zywkloo

zywkloo commented May 27, 2026

Copy link
Copy Markdown
Owner Author

as #12 covered this change, we close this

@zywkloo zywkloo closed this May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants