/tokensaver:tokensaver-reviewfrom tokensaver
Runs a local multi-lens code review pipeline: collects all changes, fans out parallel single-lens review subagents, verifies citations, and synthesizes a ranked report.
Ships in tokensaver. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A fully local code-review pipeline: diff metadata → proportional lens selection → parallel single-lens reviewers that self-fetch the bundle → mechanical citation verification → dedup → synthesized report. No servers, no knowledge base.
For CLI examples, resolve the installed plugin root from the skill location if CLAUDE_PLUGIN_ROOT is unset. Select the current host explicitly: claude for Claude Code, codex for Codex. In Bash use TOKENSAVER_HOST=codex node "$CLAUDE_PLUGIN_ROOT/scripts/tokensaver.mjs" <command> (substitute claude on Claude Code). In PowerShell use $env:TOKENSAVER_HOST = "codex" (or "claude"), then node "$env:CLAUDE_PLUGIN_ROOT/scripts/tokensaver.mjs" <command>. A quoted absolute script path works in either shell. Do not use Bash variable expansion in PowerShell. Use this invocation for every command below; the command arguments stay the same.
node "$CLAUDE_PLUGIN_ROOT/scripts/tokensaver.mjs" review-diff --meta # auto-detects base
node "$CLAUDE_PLUGIN_ROOT/scripts/tokensaver.mjs" review-diff --meta --base dev # explicit base
You get JSON: ok, baseName, files.byCategory, suggestedLenses. Do NOT run plain review-diff yourself — the reviewers fetch their own copy; the 60k bundle never enters your context.
ok: false with cannot spawn git first: use raw Git via the host shell to find the merge-base, changed files and changed-line count (default base: origin/HEAD, else main, else master). Include committed, staged, unstaged and untracked changes. Select lenses using the rules below, then continue with the raw-Git reviewer fallback.ok: false results, or no changed files → report the reason and stop.On Claude Code: launch one tokensaver:review Task per lens in a single message. Each Task prompt is:
Lens: <lens name> — <lens text below>
Fetch the diff bundle with: node "<absolute plugin root>/scripts/tokensaver.mjs" review-diff --base <baseName from step 1>
On Codex: use the available collaboration tools. Inspect their schema and concurrency limit first. Launch one spawn_agent per lens within the available slots; wait for that batch, then reuse completed agents with followup_task for remaining lenses when slots cannot be released. Collect every lens result before synthesis. If collaboration tools are unavailable, run the selected lenses sequentially on the main agent and disclose that fallback. Example for a runtime supporting these fields:
spawn_agent({
task_name: "review_cross_file_consistency", // convert lens hyphens to underscores
fork_turns: "none", // required by runtimes that restrict model overrides with history forks
model: "gpt-6-luna", // cheap tier — omit if your catalog rejects it (the error lists valid models)
reasoning_effort: "high", // lenses need real reasoning; subagents inherit the session effort otherwise (usually medium)
message: "You are a single-lens code reviewer in a parallel review pipeline. First read <absolute plugin root>/agents/review.md — it defines your protocol and output format. Your ONLY lens: <lens name> — <lens text below>. Fetch the diff bundle with: node \"<absolute plugin root>/scripts/tokensaver.mjs\" review-diff --base <baseName from step 1> — if it errors with 'cannot spawn git' (Codex's Windows sandbox blocks node child processes), run the raw git commands yourself via exec instead: `git merge-base HEAD <baseName>` to get the merge-base, `git diff <mergeBase>...HEAD -- .` for committed changes, `git diff` for unstaged, `git diff --cached` for staged, `git status --porcelain` for untracked files (read those directly)."
})
Lenses (skip those not in suggestedLenses, and say which you skipped):
Small code changes (at most 80 added/deleted lines across at most 3 files) use correctness, cross-file-consistency and type-safety. Larger changes use all seven lenses. Agent instructions and skills count as configuration, even when written in Markdown.
any, unchecked casts, implicit mixed), narrowing gaps, runtime/type mismatches.Concatenate all finding lines from the reviewers into a temp file, then:
node "$CLAUDE_PLUGIN_ROOT/scripts/tokensaver.mjs" review-verify <tmpfile>
The JSON gives each finding a citation status (verified, verified:file-only, or unverifiable:<reason>) and duplicateOf for possible duplicates at the same location. verified only means that the cited file and line exist: it does not validate the bug. Inspect the relevant code before retaining a finding. Merge a duplicate only when it describes the same defect; retain distinct problems at the same line. For invalid citations, check whether the finding can be located in the actual code; otherwise list it as unconfirmed with the reason.
## Review — <base> vs current changes
### Blockers / Major
- findings, ordered by severity then file
### Minor / Nits
- findings
### Dropped
- N unverifiable citations (wrong file/line), M duplicates merged
### Coverage
- Lenses run: ... | skipped: ... (reason: no matching file category)
N findings across M files.
spawn_agent rejects unknown model slugs with an error that lists the valid catalog — retry with the cheapest tier listed, or omit model entirely (the subagent then inherits your model).EPERM on any execFile/spawn) — so tokensaver.mjs review-diff fails even though git itself works from the shell. The fallback is baked into the prompts above: reviewers run the same git commands via exec directly. review-verify is pure filesystem and works normally.- **sev** \file:line` (lens) ...` lines reach the verifier; everything else is dropped.unverifiable:line-out-of-range can mean the reviewer cited the diff hunk line. Locate and inspect the real code before correcting a citation; never guess a line number.origin/HEAD or a main/master branch; on a repo with neither, ask the user for --base.[bundle truncated] (rare, >60k chars), note it in Coverage.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub brucee/tokensaver --plugin tokensaver5 skills in this plugin
/tokensaverWhat the tokenSaver plugin does, its tools, commands and configuration. Use when the user asks about tokenSaver itself, its features, or how to control it./tokensaver-savingsHow tokenSaver measures savings — the equivalent-calls model, pricing table, persisted state files, and how to read them. Use when the user asks about the savings numbers, the status line figures, or the state files./tokensaver-settingsChange tokenSaver settings — enable/disable the plugin features, the status line, hook behavior. Use when the user asks to turn something on/off, change plugin behavior, or asks what settings exist./tokensaver-statusCheck tokenSaver's health — version, data dir, settings, lifetime savings, and the doctor self-check for broken installs. Use when the user asks if the plugin is working, reports that hooks/tools/savings stopped, or wants diagnostics.Other plugins' skills for the same job