A customizable and modular statusline for Claude Code based on a configurable plugin system. Display the information you care about: directory, Git branch, Node version, Claude Code tokens, and more!
- π Dynamic plugin system: Plugins loaded on-demand from config
- βοΈ JSON configuration: Easy customization via
config.json - π Zero-config required: Works out-of-the-box with sensible defaults
- π Directory Plugin: Displays current directory
- π Git Plugin: Shows branch and modification status
- β¬’ Node Version Plugin: Displays Node.js version
- π΅ Claude Tokens Plugin: Shows token usage (count + percentage)
- π€ Claude Version Plugin: Displays Claude Code version
- π¨ ANSI colors for elegant display
- β‘ Written in TypeScript with fast execution
- π Automatic updates in Claude Code
- β Visible error handling: Failed plugins show as
β plugin-name
- Node.js (version 18+)
- pnpm
- Git
- Claude Code
-
Clone or copy this project to your working directory
-
Install dependencies:
pnpm install- Compile the TypeScript project:
pnpm buildThis will generate JavaScript files in the dist/ folder.
- Configure Claude Code to use this statusline by creating or modifying
.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "node dist/index.js",
"padding": 0
}
}Or with absolute path:
{
"statusLine": {
"type": "command",
"command": "node /path/to/statusline/dist/index.js",
"padding": 0
}
}The statusline uses a dynamic plugin system where plugins are loaded on-demand:
- Default configuration: Each plugin loads its own
default.jsonwith default values - User configuration: Optional
config.jsonfile at project root to enable/customize plugins - Dynamic loading: Only plugins listed in
config.jsonare loaded into memory - Automatic merging: Plugins merge their defaults with user overrides
You don't need to create config.json to use the statusline - it works out-of-the-box!
Create a config.json at the project root:
{
"separator": " | ",
"plugins": [
{ "name": "directory" },
{ "name": "git" },
{ "name": "node-version" },
{ "name": "claude-tokens" },
{ "name": "claude-version" }
]
}How it works:
- Plugin order = array position (first in array = first displayed)
- Enabled plugins = plugins present in the array
- Disabled plugins = simply omit them from the array
Override any plugin setting by adding fields:
{
"plugins": [
{
"name": "directory",
"prefix": "π",
"options": { "showFullPath": true }
},
{
"name": "git",
"color": "cyan",
"options": { "dirtyColor": "red" }
}
]
}Global options:
separator(string): Text displayed between plugins (default:" ")
Per-plugin options:
name(required): Plugin nameprefix: Custom prefixcolor: Text color ("blue","green","cyan","yellow","magenta","red","gray")options: Plugin-specific options (see plugin docs)
The plugin system is fully dynamic:
- Load config: System reads
config.jsonto see which plugins are needed - Dynamic import: Only listed plugins are loaded via
import() - Merge config: Plugin loads its
default.jsonand merges with user config - Execute: Plugin runs its logic and returns results
- Error handling: If a plugin fails to load,
β plugin-nameappears in statusline
Example:
Plugin's default (from src/plugins/directory/default.json):
{
"name": "directory",
"prefix": "π",
"color": "blue",
"options": { "showFullPath": false }
}Your override (in root config.json):
{
"name": "directory",
"prefix": "π",
"options": { "showFullPath": true }
}Result after merge:
{
"name": "directory",
"prefix": "π", β overridden
"color": "blue", β kept from default
"options": { "showFullPath": true } β overridden
}π Directory
Displays the current directory name or full path.
- Default:
π statusline - Options:
showFullPath, custom prefix/color - Full documentation β
π Git
Shows Git branch and modification statistics (file count + line changes).
- Default:
main !3 +45/-12(when modified) - Options:
showFileCount,showLineStats,dirtyColor - Full documentation β
β¬’ Node Version
Displays the current Node.js version.
- Default:
β¬’ 18.0.0 - Options:
format(short/full) - Full documentation β
π΅ Claude Tokens
Shows Claude Code token usage with count and percentage.
- Default:
π΅ 59.1k/200k (29.6%) - Options:
showPercentage,showCount,format(compact/full) - Full documentation β
π€ Claude Version
Displays the current Claude Code version.
- Default:
π€ 2.0.37 - Options: Custom prefix/color
- Full documentation β
Want to create your own plugin? See the Plugin Development Guide for detailed instructions.
Key benefits of the dynamic system:
- π No registration needed: Just drop your plugin in
src/plugins/folder - π Add to config: Enable it by adding to
config.json - π Hot-swappable: Change plugin list without touching source code
- β Error-safe: Invalid plugins show
βwithout crashing
To enable a plugin: Add it to the plugins array in your config.json
To disable a plugin: Simply remove it from the array (or don't include it)
Example - only directory and git:
{
"plugins": [{ "name": "directory" }, { "name": "git" }]
}The order in the plugins array determines display order:
{
"plugins": [
{ "name": "git" }, // First
{ "name": "directory" } // Second
]
}Result: main π statusline
π statusline main β¬’ 18.0.0 π΅ 59.1k/200k (29.6%)
π my-project β¬’ 18.0.0 π΅ 45.2k/200k (22.6%)
π my-project main β¬’ 18.0.0 π΅ 59.1k/200k (29.6%)
π my-project main !3 +45/-12 β¬’ 18.0.0 π΅ 59.1k/200k (29.6%)
(3 modified files, 45 lines added, 12 lines deleted)
π statusline main !3 +45/-12
With this configuration:
{
"separator": " | ",
"plugins": [
{ "name": "directory" },
{ "name": "git" },
{ "name": "claude-tokens", "options": { "showCount": false } }
]
}Result:
π statusline | main !3 +45/-12 | π΅ 29.6%
In your terminal, the statusline will appear with the following colors:
- Directory: Bright blue with π prefix
- Git branch: Green (configurable with
color) - Git modifications: Yellow
!N +X/-Yformat (configurable withdirtyColor) - Node version: Green with β¬’ prefix
- Claude tokens: Cyan with π΅ prefix
All colors are customizable per-plugin in your config.json.
statusline/
βββ .claude/
β βββ settings.json # Claude Code configuration
βββ src/
β βββ types/
β β βββ plugin.ts # Plugin interfaces and types
β βββ lib/
β β βββ constant.ts # ANSI color constants
β β βββ merge.ts # Deep merge utility
β β βββ plugin-manager.ts # Plugin manager
β βββ plugins/
β β βββ README.md # π Plugin Development Guide
β β βββ directory/
β β β βββ README.md # π Directory plugin documentation
β β β βββ default.json # β Default configuration
β β β βββ index.ts # Directory plugin
β β βββ git/
β β β βββ README.md # π Git plugin documentation
β β β βββ default.json # β Default configuration
β β β βββ index.ts # Git plugin
β β βββ node-version/
β β β βββ README.md # π Node version plugin documentation
β β β βββ default.json # β Default configuration
β β β βββ index.ts # Node version plugin
β β βββ claude-tokens/
β β β βββ README.md # π Claude tokens plugin documentation
β β β βββ default.json # β Default configuration
β β β βββ index.ts # Claude tokens plugin
β β β βββ transcript-parser.ts # Transcript parsing utility
β β βββ claude-version/
β β βββ README.md # π Claude version plugin documentation
β β βββ default.json # β Default configuration
β β βββ index.ts # Claude version plugin
β βββ index.ts # Main entry point
βββ dist/ # Compiled JavaScript files (generated by pnpm build)
β βββ types/
β βββ lib/
β βββ plugins/
β β βββ directory/
β β β βββ default.json # β Default config (copied)
β β βββ git/
β β β βββ default.json # β Default config (copied)
β β βββ node-version/
β β β βββ default.json # β Default config (copied)
β β βββ claude-tokens/
β β β βββ default.json # β Default config (copied)
β β βββ claude-version/
β β βββ default.json # β Default config (copied)
β βββ index.js
βββ config.json # User configuration (optional - for overrides)
βββ config.json.example # Customization examples
βββ LICENSE # MIT License
βββ package.json
βββ tsconfig.json
βββ README.md
pnpm dev: Run statusline in development mode (via tsx)pnpm build: Compile TypeScript to JavaScriptpnpm watch: Compile in watch mode
In production (with compiled files):
After compiling with pnpm build, test with:
echo '{"workspace":{"current_dir":"'$(pwd)'"}}' | node dist/index.jsOr with a specific directory:
echo '{"workspace":{"current_dir":"/path/to/project"}}' | node dist/index.jsIn development (without compilation):
To test quickly without compiling:
echo '{"workspace":{"current_dir":"'$(pwd)'"}}' | pnpm devTo develop and test quickly, you have two options:
Option 1: Watch mode (recommended)
- Start watch mode for automatic TypeScript compilation:
pnpm watch- In another terminal, test with the compiled version:
echo '{"workspace":{"current_dir":"'$(pwd)'"}}' | node dist/index.jsOption 2: Use tsx directly
Test directly without compilation:
echo '{"workspace":{"current_dir":"'$(pwd)'"}}' | pnpm devNote: Don't forget to rebuild (pnpm build) before committing or using the statusline in production with Claude Code.
Edit the src/lib/constant.ts file to customize ANSI colors:
export const colors = {
reset: "\x1b[0m",
bright: "\x1b[1m",
cyan: "\x1b[36m",
blue: "\x1b[34m",
green: "\x1b[32m",
yellow: "\x1b[33m",
// Add your own colors
} as const;Creating your own plugin is straightforward with the dynamic loading system!
For detailed step-by-step instructions, see the Plugin Development Guide.
Quick overview:
- Create
src/plugins/my-plugin/default.jsonwith defaults - Create
src/plugins/my-plugin/index.tswith your plugin logic usingexport default - Add
{ "name": "my-plugin" }to yourconfig.json - Done! The plugin is automatically loaded β¨
No manual registration needed - the system dynamically loads plugins from the config!
See the guide for complete examples and best practices!
Some prefix ideas to use:
- π Folder
- π Git branch
- β¨ Clean
β οΈ Warning- π Rocket
- π» Code
- π― Target
The statusline receives a JSON object via stdin from Claude Code:
interface ClaudeCodeInput {
yolo;
workspace?: {
current_dir?: string;
};
model?: {
display_name?: string;
};
}You can extend the interface to use other information provided by Claude Code.
- Check that
.claude/settings.jsonfile exists and is properly configured - Make sure you've compiled the project:
pnpm build - Verify that
dist/folder exists and containsindex.js - Test the statusline manually to see errors:
echo '{}' | node dist/index.js
- Check that your terminal supports ANSI codes
- Some terminals require specific configurations for colors
- Make sure you've compiled the project:
pnpm build - Check that all files are present in
dist/ - Reinstall dependencies:
pnpm install
- Don't forget to recompile after each modification:
pnpm build - Or use watch mode during development:
pnpm watch
- TypeScript: Main language
- Node.js: Runtime for production execution
- tsx: Development tool for testing without compilation
- pnpm: Package manager
- Git: Git integration to display branch
MIT
Created for Claude Code