What you pay. What you use. What it's worth.
Early access · Available on GitHub. SpendSense is an open-source Hermes plugin you can try now, directly from this repository. We're refining the experience and verifying compatibility before a formal release and Hermes catalogue submission. New here? Start with the quick-start guide, and back up your Hermes profile data before upgrading an existing installation. Found a bug or have an idea? Open a GitHub issue. Our release checklist tracks what remains.
Spend Sense is a Hermes plugin that shows what your AI usage is actually costing you. It records usage locally as it happens, prices it against published rates, and keeps your subscription plans, prepaid wallets, and API routes in one place — so you always know what you used, what your plan covered, and what the same work would have cost pay-as-you-go.
- Live session view — tokens, rates, cache performance, and estimated savings for the focused session, right inside Hermes Desktop.
- Recorded ledger — every eligible call timestamped and stored locally, independent of open sessions or restarts.
- Plan truth — declared fees and allowances next to observed usage, so renewals, downgrades, and cancellations are evidence-based.
- Private by design — no Spend Sense account, no telemetry, and no usage upload. Everything stays on your machine.
First time installing? The quick-start guide walks through install, first figures, and recovery in one place. The reference details follow.
Old UI after an update, or a release compatibility warning? See Troubleshooting before changing your installation.
| Requirement | Detail |
|---|---|
| Hermes | >= 0.22.5 (per the plugin manifest; newer builds still to be verified) |
| Profile | An isolated Hermes profile for evaluation, with a backup of your plugin data |
Desktop and backend components should be tested together. Backend analytics require the agent component to be active on the relevant Hermes profile.
Install from inside Hermes Desktop using the repository URL below. This places both halves in one step: the agent backend (hooks, ledger, API) into the connected backend, and the Spend Sense UI into the app's local desktop-plugins folder — the UI half is what makes the sidebar entry appear.
- Repository:
https://github.com/WolfMark-Ltd/spendsense - Leave the commit pin empty for the latest code, or pin a validated SHA for a known-good install.
- Choose the profile to install for, then Install. Until catalogue admission the dialog warns the source is unverified — check the repository URL matches before proceeding.
Keep the existing spend-sense plugin ID and /spend-sense route — changing them would orphan existing namespaces and storage. Do not install it over an existing plugin without a verified backup.
For servers and headless setups:
hermes plugins install WolfMark-Ltd/spendsense
hermes plugins enable spend-senseTo upgrade a command-line install, check first with the read-only hermes plugins check-updates, then apply with hermes plugins update spend-sense — only from a verified backup of the profile's plugin data (see Backup, upgrade and recovery).
To validate a source tree before installing (recommended for exact-commit installs):
git clone https://github.com/WolfMark-Ltd/spendsense.git
hermes plugins validate ./spendsense --install-depsReview every validation warning. Note the Desktop app loads its UI from its own local folder, so if your Desktop app runs on another machine, complete the install from inside the app instead.
A Hermes catalogue listing is planned; releases will be pinned by commit SHA with screenshots and disclosures. See RELEASING.md for the release and catalogue-admission checklist.
Spend Sense is local-first: each Hermes records only the usage it sees, and memberships and billing rules live with that install. If you run Hermes on several machines — a laptop and a server, for example — install Spend Sense on each one you want accounted. There is no sync between installs; each holds its own ledger.
| Capability | What you get |
|---|---|
| Live session view | A Desktop chip and pane for the focused session: cost KPI, prompt-token composition, cache gauge with coverage, and a collapsible rate card. Five stable sections keep their positions across live refreshes, with methodology notes tucked into info popovers. |
| Recorded ledger | Eligible backend calls are timestamped and stored locally as they happen, so usage history does not depend on reopening an old session. |
| Usage analytics | Distribution by model and provider, usage over time, parent versus delegated (subagent) work, cache performance, token composition, and a sortable Model Explorer covering every model × route pair — including how much usage could not be priced. |
| Costs in one place | Declared membership fees sit alongside current cost estimates, with optional advanced rules for prepaid wallets, per-route allowances, and custom token rates. |
| Subscription economics | Monthly-equivalent fees compared with the API-equivalent value of usage attributed to each subscription, per currency, with renewal dates, a monthly trend and partial/unavailable states instead of misleading totals. Non-USD fees convert only with a dated rate you supply. |
| Memberships | Discover the provider accounts Hermes is configured for, confirm which plan each account is on, add fee overrides, and mark allowances as exhausted. On request, Spend Sense can read account usage through Hermes itself to prefill plan hints and quota windows. Each card also shows allowance weather: cycle position, provider-reported consumption, and — for USD cost rules with reliable coverage — consumption pace with a projected exhaustion date. |
| Reports | Generate a local 7- or 30-day digest of usage, costs, fees and allowances as Markdown, then review, copy or save it. Nothing is scheduled, uploaded or sent anywhere. |
| Model News | New models, API price changes and subscription updates detected from your local catalogues, with API-equivalent impact estimates from your own usage — plus optional public Spend Sense announcements. |
| Offline-capable pricing | No direct pricing calls of its own: Hermes' local models.dev pricing cache when available, with a bundled offline rate snapshot as fallback. |
If you use more than one AI provider, the true cost of your usage is spread across places that never meet:
- A fixed subscription fee in one app.
- A prepaid balance or allowance in another.
- Pay-as-you-go API charges on a route you only use occasionally.
- Token counts inside Hermes that carry no price at all.
Provider dashboards show their own slice, after the fact. None of them answer the questions that matter while you work:
- What did this session cost — or what would it have cost at API rates?
- Is my subscription actually covering my usage, or am I paying for headroom I never use?
- Which model and route is eating my budget?
- Is prompt caching saving me money, or costing me a write premium?
Spend Sense answers those from the usage Hermes already sees, on your own machine, without sending your usage anywhere.
- Collect. Hermes observer hooks (
post_api_request,post_auxiliary_call,api_request_error) hand Spend Sense accounting metadata for each call: provider, model, route, token buckets, outcome and timestamps. Prompts, responses and credentials are never recorded. - Store locally. Calls go into a profile-scoped SQLite store in the plugin's data directory. Memberships and billing rules live in separate local JSON files and survive plugin upgrades.
- Price. Each recorded call is priced from the best available catalogue — Hermes' models.dev cache first, then the bundled snapshot. The Desktop ledger uses the rates captured at the time; backend analytics use the currently available catalogue. They are related, but they are not the same view and are not presented as one figure.
- Present. The Desktop plugin renders the live pane, the ledger, the Usage analytics, Costs, Memberships, Model News, Reports, Settings and About & Support views from the local backend. Nothing needs to leave your machine for the core views.
Memberships can mark an account API Only, or identify it as a subscription, prepaid credits, or not yet confirmed. API Only hides recurring membership fees from totals while retaining the saved plan and fee revisions for a later switch back. Prepaid top-ups are not recurring membership fees; configure any advanced cost rules separately in Costs. These choices do not change recorded usage or model pricing.
Back up the profile's Spend Sense plugin data before upgrading. Releases older than 0.6.0 may not recognise membership fields; restoring a compatible pre-upgrade backup may be necessary, and edits made after that backup will not be present in it.
Seat quantities are stored separately in membership-seats.json, and
route-to-account relationships in membership-entitlements.json, alongside
memberships.json, billing-profiles.json, budgets.json and fx-rates.json
in the profile's Spend Sense plugin-data directory. Back up all of them together
with the plugin stopped; restore them together to the same profile with the
plugin stopped. If a file was absent when the backup was taken, it should also
be absent after restoration.
The Settings recovery clipboard export includes the raw membership_store,
seat_history and route_entitlements documents as well as the advanced rules
and budget guardrails; retain it securely.
To restore from it, save the seat_history JSON object as
membership-seats.json and the route_entitlements JSON object as
membership-entitlements.json beside the restored memberships.json. The rules
and budgets entries need reshaping before they can be saved as store files, and
billing defaults are not in the export — see the
quick-start guide for the exact
shapes. The clipboard export does not include either usage ledger or provider
credentials. The Desktop-recorded ledger lives outside the plugin-data directory
in Hermes Desktop's app-level storage and is covered by neither the directory
backup nor the export.
The preceding 0.6.0 membership store can still be read and edited after seats are saved: it ignores the separate seat file and does not calculate seat totals. After upgrading again, the newer version reads the saved seat history. Keep the sidecar with the matching profile and membership data throughout a downgrade; do not remove or replace it when using an older version. Version 0.6.0 cannot clear the sidecar when it resets its own user data: if you reset or remove an account while downgraded, handle the matching seat backup explicitly before using the newer version again.
An unmerged earlier PR #30 test build stored seat revisions inside
memberships.json. Those test-build files are rejected rather than silently
migrated or overwritten. With the plugin stopped, make a copy of that file
and run python scripts/recover-inline-seat-history.py COPY OUTPUT, where
OUTPUT is a new file. The export leaves the source untouched and contains
membership_store and seat_history objects; save those objects as
memberships.json and membership-seats.json respectively to restore the
matching profile. Retain the original and back up all profile files first.
Do not overwrite a newer sidecar with an older recovery export.
Discovery reads Hermes' authentication storage in memory and counts the configured credential slots per provider. Credential values are never returned, logged or stored. A slot proves an account is configured — not which plan it is on — so Spend Sense suggests a plan where it can and asks you to confirm it. That human confirmation is deliberate: a wrong plan silently reprices every past month.
A user-triggered native usage read runs hermes usage for a provider. Hermes may then contact that provider using credentials Hermes manages.
A membership card keeps four different kinds of number apart, because adding them together would produce a confident, wrong total:
| Figure | What it is | What it is not |
|---|---|---|
| Membership fee | The effective fee — your override, the plan price, or seats × catalogue unit price | A per-call charge or a verified provider bill |
| Provider-reported usage | Quota or usage Hermes read from the provider | An invoice |
| API-equivalent value | What the same tokens would cost at published API rates | Money you actually spent |
| Metered / incremental cost | Allowance consumed, and extra cash beyond it under your rules | Provider-confirmed billing |
Estimates are estimates. An API-equivalent figure is a comparison price, useful for judging whether a plan is worth keeping — it is not a provider invoice, and Spend Sense never presents it as one. New to these terms? The quick-start guide explains API-equivalent cost, subscription fees and actual provider charges in plain language.
Unpriced usage is reported as unpriced. Unknown is never shown as zero, and known free usage is never mixed into a priced subtotal as if it were priced.
- Renew, downgrade or cancel with evidence. Compare what a plan covered against what the same usage would have cost at API rates before the next fee leaves your account.
- Spot the expensive route early. Model × route analytics show which combination is driving tokens and cost, including delegated subagent work that is easy to miss in a session view.
- Use allowances deliberately. Per-model and shared allowances, prepaid wallets and manual exhaustion marks show what is left — inferred from your rules, and labelled as inferred.
- Trust the cache numbers. Cache hit rate is weighted across calls with known cache activity, and cache economics are shown as a theoretical comparison, not a billing credit.
- Keep your data. Everything is local-first. There is no Spend Sense account, no telemetry and no usage upload.
- Records accounting metadata only: identifiers, route and model, token buckets, outcome and timestamps. No prompts, responses, credentials or telemetry.
- Membership discovery counts credential slots in memory. It does not return or log credential values.
- Spend Sense makes no direct HTTP pricing requests. Automatic Hermes model-options refresh is off by default; when enabled, Hermes may refresh public models.dev metadata or contact configured providers using credentials Hermes manages.
- Model News snapshots your local Hermes pricing cache and bundled plan catalogue to detect newly listed models and rate changes. The first snapshot is a baseline, not news. Nothing is uploaded and no network request is made; everything works offline.
- Spend Sense Live Updates (Settings, off by default) downloads public Model News and subscription-plan JSON feeds over HTTPS when enabled. Requests contain no user IDs, accounts, credentials, model lists, usage totals or tracking tokens; the source IP is visible to the service, and anonymous aggregate request statistics may be produced. On a remote Hermes host, that host makes the request. Disabling Live Updates stops the requests; local news and locally stored memberships continue to work. See the public Model News feed contract and plans feed contract for endpoints and schemas.
- Settings can clear your Memberships, route entitlement relationships, budgets and advanced billing rules for the current profile. A separate, explicitly confirmed action erases the captured backend usage ledger and its reconciliation baseline; Memberships, plans, fees, billing rules, budgets, FX rates, news and display preferences stay. Hermes data, provider credentials and catalogues are left untouched by both.
- Hermes
>= 0.22.5, per the plugin manifest. Compatibility with specific newer builds remains to be verified. - Desktop and backend components should be tested together on an isolated profile. Backend analytics require the agent component to be active on the relevant Hermes profile.
- Coverage depends on what Hermes supplies and what the plugin observed. Cross-gateway attribution also depends on the event-origin information the SDK provides, so treat figures as indicative until the acceptance checks in RELEASING.md are complete.
Set monthly limits for all usage, a provider route or a model × route in Settings. Choose estimated usage value (catalogue-based, including subscription usage) or actual metered spending (requires charge evidence). The two measurements are never combined with one another, subscription fees or allowances. Current Hermes hooks do not provide per-call billed charges, so actual spending remains unavailable where evidence is missing.
A separate session/conversation estimated usage-value limit gives live amber and red status-bar warnings. Overview shows the limits; Costs adds coverage, 7-day/30-day burn rates, cycle-end projection, budget runway and a possible breach date when there is sufficient evidence. Thresholds default to 50%, 80% and 100%. Partial pricing shows a known subtotal and cannot produce an “on track” verdict or forecast. All limits are advisory and local; no agent call is blocked.
See the accounting, API and compatibility notes.
Run the Python tests from a virtual environment — never system Python (on macOS, system pip is blocked by PEP 668, so install into the project environment instead):
python3 -m venv .venv
.venv/bin/python -m pip install fastapi httpx
.venv/bin/python scripts/managed-tests.py pythonWith uv instead: uv venv .venv && uv pip install --python .venv/bin/python fastapi httpx, then run the tests as above.
Use Node.js 22.13 or later on the 22.x line, or Node.js 24 or later. Install the
UI test dependencies with npm ci --prefix test/harness, then run the browserless
JavaScript checks during development:
bash scripts/node-tests.sh browserlessRun Chromium acceptance separately on a test machine with Chrome/Chromium installed, or use the hosted PR checks. Do not run this suite on the production VPS:
bash scripts/node-tests.sh browserThe browser command runs one test file at a time and fails if Chromium is missing or any expected case is skipped. Screenshots are opt-in via the relevant suite's environment variable. Both commands verify per-file completion, not just Node's exit status. When adding a file or changing its test count, update the inventory in scripts/node-tests.mjs.
The shell wrapper uses Python 3.9+ alongside Node. Set SPENDSENSE_PYTHON to
select a different Python interpreter, or use the Python entry point directly
(including on Windows for Python tests):
python3 scripts/managed-tests.py browserless node-runner.test.mjs
.venv/bin/python scripts/managed-tests.py python test_test_guard.py
.venv/bin/python scripts/managed-tests.py allall includes Chromium acceptance. Only use it on a test machine. Agents
should use these managed commands for both full and focused runs. The OS lock
is shared across worktrees under the same user account on the same host.
Contending invocations fail immediately. Builds and lint commands can continue
independently. Raw node --test and python -m unittest bypass this guard and
its cleanup and reporting checks.
Each test file or Python suite has a five-minute deadline. Ctrl-C or TERM stops the current run. On macOS and Linux, the supervisor sends TERM and then KILL if necessary, and checks that the owned groups have no live members. Shared Chromium launches publish their detached group before the browser can start. Nested supervisors publish their registries before launching workers so the outer supervisor can verify their groups even if an intermediate worker dies. Legacy browser tests are supervised through their inherited group. Processes that independently leave a group without registering, including platform-specific browser helpers, are outside this guarantee. On Windows the managed Python runner uses a Job Object, releases its startup gate only after assignment, and checks that the job is empty after termination. Native Windows Chromium acceptance is outside CI.
The OS releases the advisory lock on owner exit. If cleanup is incomplete or the
supervisor dies during a run, the persistent active-run marker blocks new
runs pending inspection. It points to the directory containing the worker ID and any registered
group IDs. Check that both the worker and its owned groups have stopped before
removing the marker. Do not signal a stale PID solely from an old record. Leave
the advisory lock file in place. POSIX supervisor SIGKILL or system failure can
bypass cleanup. Windows enables kill-on-close for assigned job members, but an
abruptly killed supervisor cannot report verification. These mechanisms do not
cap memory or CPU, contain unmanaged commands, or protect against separate user
accounts running tests concurrently.
Some API tests need FastAPI and HTTPX (installed above) and are skipped without them. Hermes catalogue admission additionally requires hermes plugins validate /path/to/plugin --install-deps on the exact commit.
Do not run integration tests against production data.
- Questions, bugs and feature requests: GitHub issues.
- Release notes: GitHub Releases.
- Product support: Contact WolfMark.
Spend Sense is built by WolfMark Ltd and derived from Token & Cost Meter by AFei (IT-dreamer), originally licensed under Apache-2.0. The combined Spend Sense software distribution is licensed under GPL-3.0. That project licence does not replace the original Apache-2.0 licence or attribution for the upstream component. Both licence texts and applicable notices are included in this repository. See LICENSE, NOTICE and Apache-2.0.
The branding assets have separate terms. Representative screenshots of a validated build will be added with the first release.
Cache hit rate is cache-read prompt tokens divided by covered prompt tokens (fresh input, cache reads and cache writes). Nerd Mode uses timestamped backend calls in the chosen period and filters; the live pane uses the current Desktop conversation. Coverage shows how much of each scope has usable cache information. Gateway percentages rounded by Hermes are reconstructed estimates and marked ≈. Unknown and older data are not silently treated as confirmed zeroes.
Hermes v0.22.5 normalises absent provider cache fields to zero before sending its plugin hook and removes raw usage from the hook payload. A zero-read/zero-write hook record therefore cannot prove a cache miss. As an optional upstream enhancement, Hermes could provide, for each cache-read and cache-write counter, an explicit presence/provenance indicator (including confirmed zero versus missing), plus the exact canonical token counts. Spend Sense needs only these accounting fields and would not need prompts, responses or credentials. Historical records cannot be retrospectively disambiguated.
Desktop CSV exports retain cache_saved_usd as the legacy gross cache-read savings field for compatibility. The separate net_cache_savings_usd field includes cache-write premiums and is blank when a complete net value is unavailable; the export keeps that stricter complete-value contract even though the pane shows a measured subtotal.
Theoretical net savings compare covered prompt tokens at uncached input prices with their fresh, cache-read and cache-write prices; cache writes may create a net premium. They are not a refund or invoice. The sidebar gauge and the ledger totals show the measured subtotal — the prompt tokens whose cache split and rates are known — together with the share of prompt tokens it covers. A figure covering part of a conversation is marked ≈ and is never labelled exact. When nothing can be measured, the pane names the reason (no cache evidence, no rate for the route, tiered pricing not modelled, cache-write price missing, cache split not reported) rather than showing a bare dash. A cache-write figure reconstructed from Hermes's rounded hit percentage, on a route that publishes no write price, is valued at the input rate — the same convention the cost estimate uses. That substitution omits any write premium, so a route that charges one would have its theoretical saving overstated by that premium, and a route charging less than input for writes would be understated; the figure is exact only against the card the pane displays, which prices writes at the input rate too. It is not a general guarantee that a missing write price cannot overstate savings: it holds for this ledger because the affected routes record no cache writes at all. A provider-reported cache write still requires its published price, and a provider-reported zero is a measurement rather than missing evidence — the pane says "no cache evidence" for the latter instead of pricing it at zero. Nerd Mode shows the same covered-call subtotal and its coverage. Desktop gateway counters and backend per-call events have different timing and attribution, and rates may differ by source or time; figures should be compared only for the same calls and pricing assumptions.
