Show the Claude Code agent state from the v3 statusline workspace
in the VS Code status bar. The extension spawns the claude-statusline busd
consumer binary as a child process and pipes its stdout into a status bar item.
Status bar item only. No editor, no side panel, no webview.
How it works
- On activation the extension spawns the
claude-statuslinebinary (it implements theConsumertrait and already subscribes to busd). - Each line the binary prints is parsed by
parseLine(a pure function insrc/parseLine.ts). - The status bar text is updated to the current state (IDLE / THINKING /
EXECUTING / ERROR) with the
[session:...]tag and elapsed/cost detail carried through verbatim.
Prerequisites
The claude-statusline binary must be reachable on $PATH (or its absolute
path configured in settings). Build it from this workspace:
cargo build --release -p claude-statusline
# binary lives at target/release/claude-statusline
Also required: a running claude-busd instance. See the top-level
v3 README.
Build the extension
cd v3/vscode-extension
npm install
npm run compile # emits out/extension.js + out/test/*.test.js
npm test # runs parseLine unit tests
Package & install
# One-time: install vsce globally.
npm install -g @vscode/vsce
# Produce a .vsix from v3/vscode-extension/
cd v3/vscode-extension
vsce package
# -> claude-statusline-0.1.0.vsix
# Install it into VS Code
code --install-extension claude-statusline-0.1.0.vsix
To distribute internally, copy the .vsix to teammates and run
code --install-extension claude-statusline-0.1.0.vsix on their machines
(Extensions -> "Install from VSIX..." works too).
Configuration
Open VS Code Settings (Cmd+, / Ctrl+,) and search for "claude statusline".
The extension contributes two settings:
| Setting | Default | Description |
|---|---|---|
claudeStatusline.binaryPath |
claude-statusline |
Absolute path or $PATH lookup for the binary. Set this to e.g. /Users/me/gitlab/ai/claude-code/statusline/v3/target/release/claude-statusline if you don't want it on $PATH. |
claudeStatusline.statusBarText |
Claude: $(loading~spin) |
Placeholder text shown while waiting for the first line of stdout. |
Example settings.json:
{
"claudeStatusline.binaryPath": "/Users/me/gitlab/ai/claude-code/statusline/v3/target/release/claude-statusline"
}
Troubleshooting
- Status bar shows
$(warning) Claude: exited (1)-- the binary path is wrong or the busd socket is unreachable. Hover the status bar item for details. - Status bar stuck on the placeholder --
claude-busdis not running, or this user is not subscribed. Checkclaude-busdlogs.
Development
npm run watch-- incremental TypeScript compile on save.npm test--node --testagainst the compiledout/test/parseLine.test.js.- The activation path (spawning the binary, wiring events) is not unit- tested; it's exercised manually by launching VS Code with the extension loaded.