[FEATURE] Expose Vim Mode State in Statusline JSON
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I use Vim mode in Claude Code with a custom statusline script. The statusLine.command JSON payload exposes model, cost, context, and workspace data—but not the Vim mode state.
Current Behavior
The Vim mode indicator is rendered by Claude Code's internal UI and cannot be customized:
🤖 Opus | 📁 my-project | main | $0.42 ← customizable via statusLine.command
-- INSERT -- ▐▐ plan mode on ← hardcoded, not exposed
The statusLine.command JSON payload includes session, model, cost, and workspace data, but no Vim mode state:
{
"session_id": "...",
"model": { "id": "...", "display_name": "..." },
"workspace": { "current_dir": "...", "project_dir": "..." },
"cost": { "total_cost_usd": 0.42, "total_duration_ms": 45000 },
"context_window": { ... }
// vi_mode: missing
}
Proposed Solution
Add a vi_mode object to the statusLine.command JSON payload:
{
"vi_mode": {
"enabled": true,
"mode": "insert"
}
}
This lets users render the Vim mode in their statusline script with custom styling, or omit it entirely.
Alternative Solutions
There's no workaround—the indicator is rendered by Claude Code's internal UI, not exposed to statusline scripts.
Priority
Low - Nice to have
Feature Category
CLI commands and flags
Use Case Example
Example scenario:
- I use Claude Code with Vim mode and a custom statusline script
- I want to style my Vim mode indicator to match my statusline aesthetic
- With this feature, I could render the mode in my script with custom colors/icons
- This would save me time because I wouldn't need to live with the hardcoded
-- INSERT --styling
Additional Context
Related Issues
This follows the established pattern of exposing internal state to statusline.sh scripts:
This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗