/context-guru:statusfrom context-guru
Displays a home screen showing proxy status, routing state, cost savings, and top action items. With --stats, writes raw /stats JSON to a snapshot file.
Ships in context-guru. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
If invoked with --stats, skip everything below: resolve the port the same way step 1 does
(settings.py port show, then settings.py config, then the plugin.json default), write the JSON
to a snapshot file, and reply with the path only:
set -o pipefail # a failed curl must fail the pipeline, not write an empty snapshot through jq
OUT="$(mktemp "${TMPDIR:-/tmp}/context-guru-stats-${PORT}.XXXXXX")"
if command -v jq >/dev/null 2>&1; then
curl -fsS "http://127.0.0.1:${PORT}/stats" | jq . >"$OUT"
else
curl -fsS "http://127.0.0.1:${PORT}/stats" >"$OUT"
fi
Reply with $OUT and its size, and nothing else — no narration, no interpretation, not even the
liveness check. This is for someone who wants the JSON itself, not a reading of it; the file holds
the exact bytes jq (or curl) wrote, which a printed copy cannot promise. Do not print the JSON:
Claude Code already shows the tool output to the user, so printing it again shows the same document
twice and costs roughly 3,000-4,000 output tokens for nothing. A failed curl (proxy not up) is still
shown as-is rather than translated into prose. Old snapshots are $TMPDIR's to clean up; do not
delete them yourself.
Otherwise, answer two questions in order, because the second is meaningless if the first is "no":
First get the configured port, because you cannot read it from the environment here —
CLAUDE_PLUGIN_OPTION_* reaches hook environments only, so a shell default would silently report on
8787 while the user runs on something else:
"${CLAUDE_PLUGIN_ROOT}/scripts/settings.py" config
Use its option_port=. Read the fallback per option, not from source=: that command prints an
option_<name>= line only for keys the user actually configured, and reports source=(none) only when
nothing at all is set — so somebody with a partial config gets a real source= and no option_port=
line. Any option the output does not list is unconfigured; use the plugin.json default for that one,
whatever source= says.
The port is the exception, and 8787 is the wrong guess for it. Ports are allocated per project — one project per port, because two projects sharing one proxy made every session start kill and restart it, wiping the in-memory store each time — so the port this project runs on is usually neither 8787 nor anything the user ever typed. One command answers the whole question, in the same order the hooks and the status line use, so you never assemble the chain yourself:
"${CLAUDE_PLUGIN_ROOT}/scripts/settings.py" port install
result=ok port=<n> is the port this directory's install is on, and source= says what established
it — the routing URL, an install record, or a configured option. routed= is a separate fact and
must not be folded into the port: true means this session's traffic really is going through that
proxy; false means the install is there but the environment points elsewhere (not_routed_why=
says where), so report the numbers as that install's, never as "what this project is routed to".
result=unrouted means nothing here is installed at all: report that and its why=, and do not
substitute 8787. Then:
PORT="<port>"
echo "ANTHROPIC_BASE_URL=${ANTHROPIC_BASE_URL:-(unset)}"
curl -fsS --max-time 3 "http://127.0.0.1:${PORT}/healthz" || echo "(no proxy on ${PORT})"
Then check where the routing is configured, in precedence order — later files win:
for f in ~/.claude/settings.json .claude/settings.json .claude/settings.local.json; do
[ -f "$f" ] && "${CLAUDE_PLUGIN_ROOT}/scripts/settings.py" show --file "$f"
done
Report the combinations plainly, because they mean different things:
ANTHROPIC_BASE_URL unset in this session, but present in a settings file — the routing
was added after this session started. It applies to the next session. This is the normal
state right after /context-guru:install, and it is not a fault."${CLAUDE_PLUGIN_ROOT}/scripts/start-proxy.sh", and if that does not work, read
${CONTEXT_GURU_STATE:-${XDG_STATE_HOME:-$HOME/.local/state}/context-guru}/proxy-${PORT}.log
— the same expression the starter itself uses, because CONTEXT_GURU_STATE is a hook variable
and is usually unset in a Bash call. If they want out immediately, that is
/context-guru:uninstall.python3 "${CLAUDE_PLUGIN_ROOT}/scripts/cg.py" home
Print its output exactly as it is, in one code block. It opens with the dollars saved, then today
against yesterday, then the top three things to do. Saved dollars (✓ Saved) and spend you could
still avoid (≈ Estimated) are different things: never add them or call an estimate a saving.
The other questions have their own commands: /context-guru:insights (savings, cache, tools),
/context-guru:session, /context-guru:doctor.
These caveats are not hedging; each one is a way a confident reading would be wrong:
/stats cost figures are list-price estimates. On a Pro/Max subscription the saving lands
in usage limits, not dollars — their bill does not change. Say so rather than quoting a dollar
figure at a subscriber as if it were money back.The home screen (cg.py home) prints preset: <running> (<saved> after a restart) when the preset in
the settings file differs from the one the proxy runs (the preset key of /stats). Pass it on. The
fix is /context-guru:preset-picker, which restarts the proxy after one yes.
start-proxy.sh records what the running proxy was started with, in
$CONTEXT_GURU_STATE/proxy-<port>.fingerprint. Compare it against what the options ask for now:
preset=<x> strategy=<y> idle=<z> upstream=<u> port=<p> bin=<version>
If they differ, the user changed something — most often /plugin configure, or a background proxy
upgrade landed a new bin= — and the running proxy predates it. Say which field differs and
that a new session applies it; the SessionStart hook stops and restarts the proxy when it sees the
difference. Do not restart it from here: this skill runs inside a session that is routed through
that proxy.
Beside it, $CONTEXT_GURU_STATE/proxy-<port>.owner names who that proxy belongs to. Do not compare it
against this project's path yourself — ask, because the answer depends on the routing scope, not on the
path: settings.py owner-token --observed "$(cat "$CONTEXT_GURU_STATE/proxy-<port>.owner")" prints
verdict=ours|theirs.
ours includes the case where the file names a different project: under a machine-wide
(--scope user) install there is one settings file, one port and therefore one proxy shared by every
project on the machine, so the numbers below are the shared proxy's and are this project's too.
theirs is the finding: this project is routed at a proxy another project owns, running their preset
and their strategy, and every number below is theirs. Report that rather than reading the stats — and
do not restart anything, because start-proxy.sh deliberately will not take a proxy from its owner.
The fix is a port of this project's own, which /context-guru:install allocates.
If the fingerprint is absent while a proxy is running, it was started before this was recorded (or by something else). That is not an error and not a pending change — say so rather than guessing, and note that the next cold start records it.
This is where a pending switch is reported, deliberately, and not from the UserPromptSubmit hook: a
python invocation on the critical path of every prompt is a poor price for news that the next session
delivers by itself.
"${CLAUDE_PLUGIN_ROOT}/scripts/settings.py" update-check show — read-only, never fetches. It
reports what the last SessionStart check (at most once every 5 minutes, run synchronously by
whichever session happens to be due — so a release CAN be announced in the very session that
discovers it, not only the next one) already found:
answer=/skipped=/notified=/latest=/installed=.
Read installed= from THIS output, not from skipped= — conflating the two is a real defect this
surface used to have. And keep skipped= and notified= apart: skipped=<tag> means the user
EXPLICITLY declined that tag; notified=<tag> only means a hook once printed a note about it,
which may never have reached the user at all (a SessionStart note competes with whatever they
actually asked that session). If notified= names a tag but skipped= does not, say it was
surfaced but never actually answered — do not report it as declined.
An empty or unknown latest= means no check has succeeded yet, not that the proxy is current. If
latest= names something newer than installed= and it is not the skipped= tag, point at
/context-guru:update — which does its own live check before reporting, rather than trusting this
cached record — instead of re-explaining any of this here.
off, which runs no components, so acted: 0 and saved_tokens: 0 are the expected state, not
a symptom. Look at the keep-alive block instead — that is what actually runs and spends by
default.wrote_instead_of_read above zero is a bug signal, not a saving. It means a keep-alive
ping created a cache entry instead of refreshing one, which costs money for nothing. Report it
as a problem./stats is process-wide, not per-project: if they route several projects to one proxy,
these totals cover all of them.If the numbers are genuinely flat after real use, say that and offer the next step — usually
/context-guru:preset-picker's conservative tier, which adds the offloaders — rather than
reaching for a favourable reading of a flat graph.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
proxy-status, cost-tracking, project-routing, stats-snapshot
19 skills in this plugin
/cache-campaignBuild a cache plan from your own history, compare it with today, and switch it on in shadow or live mode. Manager login needed. Use when a manager asks for a keep-alive plan built from their history./cache-strategy-pickerShow the cache strategy and switch it. Use when asked which one runs, to turn keep-alive pings on or off, or to keep the cache warm./chartDollars saved per day as a bar chart, split by lever, with what is still avoidable drawn apart as an estimate. Pass 14 or 30 as the number of days.npx claudepluginhub rossoctl/context-guru --plugin context-guruOther plugins' skills for the same job