feat: add /cfo skill — session cost + AI spend dashboard#34
Open
shivanipods wants to merge 3 commits intogarrytan:mainfrom
Open
feat: add /cfo skill — session cost + AI spend dashboard#34shivanipods wants to merge 3 commits intogarrytan:mainfrom
shivanipods wants to merge 3 commits intogarrytan:mainfrom
Conversation
Adds a new `/cfo` skill that shows: - Current session cost and elapsed time as a banner - 30-day AI spend dashboard for the project (by day, by branch) - Prompt repetition detection with waste estimates - Personalized cost-saving tips based on usage patterns Includes `ai_spend.py`, a ~1000-line stdlib-only Python script (originally by @shivanipods) that reads token usage directly from `~/.claude/projects/` — no API keys, no third-party tracking. Also supports team/org aggregation and manual logging of spend from other AI tools (Cursor, Lovable, ChatGPT, etc.). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace deprecated datetime.utcnow() with timezone-aware datetime.now(timezone.utc) in build_export_payload. Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
Adds a
/cfoskill that answers "what am I spending?" without leaving Claude Code.ai_spend.py --add--export,--team,--org)Reads token usage directly from
~/.claude/projects/transcripts — no API keys, no third-party tracking.What's included
cfo/SKILL.md— skill prompt (4 steps: find script, gather session metrics in one atomic bash call, run dashboard, print banner)cfo/ai_spend.py— ~1000-line stdlib-only Python dashboard script, originally from @shivanipods/claude-session-skillNotes for reviewer
/cfosection is written in third-person to let you adapt it to your voice if you accept the PRjqandpython3(3.10+) — added to the Requirements line in README; both are pre-installed or onebrew install jqaway on macOScfo/subdirectory with aSKILL.mdTest plan
./setupsymlinkscfoalongside the other skills/cforuns and outputs session banner + spend dashboardpython3 cfo/ai_spend.py --helpruns without errors (stdlib only, no pip required)jqis the only new system dependency🤖 Generated with Claude Code