Token-usage insight and safety prompts for Claude Code: a live status-bar meter, context-window gauge, per-session budgets, and Allow/Deny prompts for risky commands.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
A Visual Studio Code extension that gives you live token-usage insight, budgets,
and safety prompts while you work with Claude Code.
Features
Live context-window gauge in the status bar — how full the current
session's context is right now (last turn's input + cache), scoped to the
workspace you're in.
Live token meter — reads your local session transcripts under
~/.claude/projects/ and shows usage at a glance.
Per-session token budget — set a token target for a session; once it's
crossed, Warden pauses Claude and asks you whether to continue or stop
(Claude never presses on past the target on its own). Choosing Continue
extends the target by one budget increment, so you get another checkpoint
further along instead of a prompt on every tool call.
Pause / Resume — hold or release tool calls in a heavy session with one
command.
Decision prompts — sensitive tools or shell-command patterns (destructive
file deletions, force pushes, schema migrations) show an Allow/Deny prompt so
nothing risky runs unattended.
Live activity feed — every event and decision streams to a Claude
Warden Output channel, the status bar pulses on each decision, and the
dashboard shows a rolling Recent activity table.
Config generator — sets up the integration in
<workspace>/.claude/settings.json for you.
Two ways to measure usage
The status bar shows both, because they answer different questions:
Context window % (primary) — the last turn's input + cache-read +
cache-creation, i.e. how close the session is to overflowing its context. Set
claudeWarden.contextWindowTokens to 1000000 for 1M-context models.
Budget (x / y) — cumulative input + output across the whole session,
gated by claudeWarden.tokenBudget. This is what triggers the
continue-or-stop checkpoint.
Getting started
Install the extension and open your project folder.
Run Claude Warden: Generate Hooks Config from the Command Palette — it
sets up the integration in .claude/settings.json for you.
Start a Claude Code session in that project. The status-bar meter comes
alive, and gated tools show an Allow/Deny prompt.
Settings
Setting
Default
Purpose
claudeWarden.tokenBudget
500000
Token target per session; crossing it pauses Claude and asks you to continue or stop. 0 = no limit.
claudeWarden.contextWindowTokens
200000
Context-window size for the live gauge (use 1000000 for 1M models).
claudeWarden.warnAtPercent
80
Warn once when a session crosses this percent of the budget.
claudeWarden.askForTools
["Bash"]
Tool names (regex allowed) that require an Allow/Deny prompt.
claudeWarden.askForBashPatterns
rm\s+-rf, git\s+push, drop\s+table, migrate
Case-insensitive regexes; a matching command asks first.
claudeWarden.port
43917
Local port for the integration.
claudeWarden.claudeProjectsDir
""
Override for the Claude Code projects directory.
Commands
Claude Warden: Show Dashboard
Claude Warden: Show Activity Log
Claude Warden: Generate Hooks Config
Claude Warden: Reset Session Token Budget
Claude Warden: Pause Claude Code
Claude Warden: Resume Claude Code
Privacy
Everything runs on your machine. The extension reads your local Claude Code
session transcripts to compute usage and communicates only over the local
loopback interface — no data leaves your computer. Review
.claude/settings.json before committing it to source control.
Development
The source, tests (npm test), and simulator scripts for exercising the
extension without a live Claude session live in the
GitHub repository.
Roadmap
Cost estimation (tokens × model pricing) in the dashboard.
Per-project budgets and daily quotas.
A tree view of sessions with drill-down into individual tool calls.
A settings editor that round-trips .claude/settings.json.