savings

Solid

Report rtk and jcodemunch token savings for the current session.

AI & Automation 11 stars 3 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
36
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

<!-- rig-generated --> # savings — Session Savings Report Report token savings from rtk and jcodemunch usage during this session. ## Procedure 1. Run `rtk gain --format json` to get current savings data. If rtk is not available, skip rtk reporting. 2. Gather the session cache files (aggregate, do not pick one): - Use `Bash(ls /tmp/rig-session-*.json)` to list candidates (or the Glob tool with pattern `/tmp/rig-session-*.json`). - For each candidate path, use the **Read tool** (not `cat` or `grep`) to load the JSON and check the `cwd` field. Collect ALL files whose `cwd` matches the current project directory (`$CLAUDE_PROJECT_DIR` or `pwd`) — hooks running from subagent contexts or under different session ids write separate cache files keyed by (cwd, session id), and each holds part of this session's tool-call counters. - Anchor staleness to session start: session-start recaptures the metrics baseline every session, so the most recent matching file **with a non-null `metricsBaseline`** (highest `updatedAt` among those) provides the session-start anchor via its `metricsBaseline.capturedAt` — subagent-context fragments never run session-start and carry a null baseline, so they cannot anchor. Discard matching files whose `updatedAt` predates the anchor, and as an outer bound discard any file older than 24 hours — files from earlier sessions today (same cwd, different session ids) hold a previous...

Details

Author
franklywatson
Repository
franklywatson/claude-rig
Created
5 months ago
Last Updated
3 days ago
Language
TypeScript
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category