headroom.walls.sh · vscode
Claude Code has a first-party VS Code extension. It wires Claude Code's terminal agent directly into your editor: diffs open in VS Code, files are linked, the terminal runs inline. This page covers installing the extension, the workflow, and how to get Headroom monitoring your usage alongside it.
The Claude Code extension for VS Code is published by Anthropic. It adds:
anthropicnpm install -g @anthropic-ai/claude-codeclaudeThe extension detects the CLI automatically. On first launch, Claude Code installs its statusLine hook (which is what Headroom reads).
~/.claude/. No re-setup needed — just install the extension and open the terminal.The typical workflow once the extension is installed:
claude to start a sessionThe flow is: you stay in VS Code, Claude Code works in the terminal below. You see every edit as a native VS Code diff before it's applied.
Claude Code's settings live at ~/.claude/settings.json — separate from VS Code's settings.json. The key setting for Headroom is the statusLineHook entry, which Claude Code installs automatically on first launch:
{
"hooks": {
"statusLineHook": {
"type": "command",
"command": "node ~/.claude/headroom-hook.mjs"
}
}
}
This hook runs each time Claude Code processes a prompt and writes your current usage to ~/.claude/headroom-usage.json. Headroom reads that file every 15 seconds — the same data Claude Code shows with /usage, surfaced in your menu bar.
→ How the statusLineHook works · Full settings.json reference
Both can be active in VS Code simultaneously. They serve different moments:
| Moment | Reach for |
|---|---|
| Completing the current line as you type | GitHub Copilot |
| "Add error handling to all these endpoints" | Claude Code |
| Reviewing and explaining existing code | Either (Copilot Chat or Claude Code) |
| Debugging a test that's been failing for an hour | Claude Code (loops until tests pass) |
| Writing a new component from a description | Claude Code |
| Quick inline rename / boilerplate | Copilot |
If you use Copilot with Claude models (BYOK), both tools draw from the same Anthropic API quota — your Claude Code 5h/7d windows are shared with Copilot's Claude usage.
→ Full Claude Code vs Copilot comparison
Drop a CLAUDE.md file in your project root and Claude Code reads it as project context — similar to how VS Code reads .vscode/settings.json for editor preferences, but for AI instructions:
# This project - TypeScript, strict mode - Tests with Vitest — run `npm test` - Never edit generated files in `dist/` - Prefer functional patterns; avoid classes
VS Code users often already have .vscode/settings.json in their project — CLAUDE.md is the equivalent for Claude Code's project context.
Inside the Claude Code terminal (the integrated terminal running claude):
| Key | Action |
|---|---|
| Esc | Interrupt Claude Code mid-response (while it's running) |
| Ctrl+C | Cancel current operation |
| ↑ / ↓ | Navigate prompt history |
| Tab | Autocomplete file paths |
| Ctrl+D | Exit Claude Code session |
Pressing Esc early — before Claude Code goes too far down a wrong path — saves session budget. Each model call counts toward your 5h rolling window.
→ Full Claude Code keyboard reference
VS Code fills the screen — you're watching diffs and file trees, not a terminal. Claude Code's session (5h) and weekly (7d) usage meters are invisible unless you run /usage manually. Headroom keeps them in your menu bar, color-coded before a limit stops you mid-session:
Reads the same data the VS Code extension uses. Zero network calls, no API key. macOS 13+, free.
When you're deep in a Claude Code session in VS Code — reviewing diffs, accepting edits, staying in flow — the last thing you want is a surprise rate limit. Headroom shows both meters in your menu bar so you always know where you stand.
→ Claude Code settings.json reference
→ Hooks: PreToolUse, PostToolUse, statusLineHook
→ Claude Code keyboard shortcuts
→ Claude Code vs GitHub Copilot
→ Claude Code vs Windsurf
→ Claude Code vs Cursor