Skip to content

feat(plugin): Claude Code band with cache state and a Ping button - #651

Merged
OsherElhadad merged 8 commits into
mainfrom
feat/plugin-mods
Oct 21, 2026
Merged

OsherElhadad merged 8 commits into
mainfrom
feat/plugin-mods

Conversation

@OsherElhadad

Copy link
Copy Markdown
Collaborator

Adds the Claude Code mod (hooks module) and /context-guru:ping, per the plugin-features contract §5/§6.

  • band above the prompt: dashboard link, warm/cold + countdown, next request warm vs cold, saved $, subagent chips, Ping (warm only)
  • /context-guru:pane richer pane (savings by category incl. manual pings, cache per thread)
  • cg.py ping [--session] [--thread] [--json] -> POST /api/me/cache/ping; vendored to the Codex plugin copy
  • skills/ping does not pre-approve the command (it spends money; guard test)

Depends on: cg.py cachestate --json (oss-statusline) and the ping endpoint (core-backend). Until both land the band stays hidden (no data).

Tests: claude plugin validate, claude plugin test (6), go test ./context-guru-plugin/. tsc was not available on this host.

Assisted-By: Claude Opus 5.5 [email protected]

Osher Elhadad added 4 commits October 21, 2026 19:14
…ontext-guru:ping

A hooks module (hooks/register.tsx, listed under `modules` beside the command
hooks) draws a band above the prompt: dashboard link, cache warm/cold with a
countdown, next-request cost warm vs cold, saved $, subagent chips, and a Ping
button shown only while the main thread is warm. /context-guru:pane opens a
richer pane. The mod never touches the network: it reads `cg.py cachestate
--json` every 15 s and redraws only when the words change; Ping runs
`cg.py ping`, which POSTs /api/me/cache/ping.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
A skill makes the model load it and run a Bash tool, a full turn on the main
context that adds tokens and saves nothing. /ping is now registered with
$.command.register and answered by a command.run hook returning { text } only:
no `context`, so nothing is recorded for the model and no turn starts (tested).

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
… once

The mod now reads the raw /api/cachestate entry that `cg.py cachestate --json`
prints (plus age_s/stale, or {"error": ...}), takes the saved $ from `money`,
and derives the dashboard link from the routed loopback ANTHROPIC_BASE_URL.
The pane drops the stats-based savings table until stats are cached too.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
Osher Elhadad added 4 commits October 21, 2026 19:36
Go's mux answers a missing route with a plain-text 404. Say "unknown session"
only for a 404 whose JSON doc says so; a 404/405 with no doc says the server
does not support manual pings yet. cg.py, the toast, and the Codex copy.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
…live is off

409 not held / busy / cold, 429 too soon / no spare capacity, and 502 each get
their own message in cg.py, the toast and /ping. The band shows a dim
"keep-alive off" instead of the Ping button when the main thread is warm but
the server says pingable is false (an absent field, an older server, keeps the
button).

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
…er budget)

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
Only error "cold" says cold. "over budget" (and "too costly") get the per-ping
limit message; any other 409 says "ping refused: <error>". The success text is
"saved $x net (ping cost $y)" since saved_usd is already net of the ping.

Assisted-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Osher Elhadad <[email protected]>
@OsherElhadad
OsherElhadad merged commit f1a04bb into main Oct 21, 2026
4 checks passed
@OsherElhadad
OsherElhadad deleted the feat/plugin-mods branch October 21, 2026 20:52
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Oct 21, 2026
amiddavid added a commit that referenced this pull request Oct 21, 2026
…0.2.3) (#657)

chore(plugin): bump the plugins for v0.5.3 (Claude Code 0.5.3, Codex 0.2.3)

Both plugins changed in this release, so installed plugins must update.

- Claude Code plugin: the band with cache state and a Ping button
  (#651), next-request cost on the status line and the context bar
  fix (#653), insights tools leaves out unpriced carry costs (#656),
  and the xhigh preset list without the sweep (#654).
- Codex plugin: the vendored cg.py and cgcache.py from #651, #653 and
  #656.

Assisted-By: Claude
Signed-off-by: DAVID AMID <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant