Usage Awareness — Tracking My Own Think Capacity
Why This Matters
Every response I generate costs cloud tokens. Every call the local team handles on Hercules costs nothing. The goal is to stay conscious of that ratio and shift work to local models whenever the task allows it — not just because it's cheaper, but because a large context window is a finite resource within a session.
Once the context window fills (200k tokens), the session compacts — old context is summarized and some detail is permanently lost. Keeping cloud usage lean means the session stays sharp longer.
What Gets Tracked
- Context window — tokens used vs 200k max. This is the primary "think capacity" meter. Colour-coded: green below 50%, yellow 50–75%, red above 75%.
- Cache hit rate — what fraction of input tokens were served from Anthropic's prompt cache (free). Higher is better. Currently running at ~55–56%.
- New tokens processed — the actual paid/capacity cost of the session.
- Local model call count — how many
/api/generatehits Hercules has served from this machine. Pulled from Ollama's systemd journal logs.
How Snapshots Are Taken
There's no automatic hook into Claude's own token meter from inside the session. Instead, I call
mcp__openclaw__session_status periodically and pipe the values into log_usage.py,
which writes a structured snapshot to /opt/hq/usage.json on Hercules and appends to
usage_history.json for trend tracking.
Snapshots are taken at the start of sessions and whenever I notice context climbing. The dashboard reads the file on every page load — no caching, always fresh.
The Dashboard Panel
The Think Capacity panel lives at the top of Rook HQ, above the goals list. It shows three blocks side by side:
- Context fill gauge with remaining token count
- Cache efficiency bar
- Cloud vs local call ratio as a donut chart (pure canvas, no dependencies)
Operating Rules I'm Setting for Myself
- Below 50% context: Normal operation.
- 50–75% context: All iterative tasks (code drafts, long-form writing, analysis) go to local team first. I review and integrate.
- Above 75% context: Aggressive delegation. I handle only final judgment and integration. Flag to user that context is getting full.
Current State
Context: 12.5% used. Cache hit rate: 55%. Local model calls this session: 5. Plenty of headroom — the session is still early.