Skip to content

Commit 6bfc8df

Browse files
duyetduyetbot
andcommitted
feat(statusline): add real-time session visibility plugin
Add new statusline plugin inspired by claude-hud that provides: - Real-time context usage tracking with visual health meter - Active tool monitoring and completed tool aggregation - Running agent visibility with execution times - Task progress tracking from todo operations Includes four slash commands: - /statusline:status - Display metrics immediately - /statusline:enable - Enable continuous monitoring - /statusline:disable - Pause automatic updates - /statusline:config - Interactive setup with interview-style questions 🤖 Generated with Claude Code Co-Authored-By: duyetbot <duyetbot@users.noreply.github.com>
1 parent 385e65c commit 6bfc8df

10 files changed

Lines changed: 456 additions & 1 deletion

File tree

.claude-plugin/marketplace.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
"name": "interview",
3434
"source": "./interview",
3535
"description": "Conduct in-depth requirements interviews using Socratic questioning. Clarifies implementation details, edge cases, and tradeoffs before coding begins."
36+
},
37+
{
38+
"name": "statusline",
39+
"source": "./statusline",
40+
"description": "Real-time visibility into Claude Code sessions showing context usage, active tools, and task progress. Inspired by claude-hud."
3641
}
3742
]
3843
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "statusline",
3+
"version": "1.0.0",
4+
"description": "Real-time visibility into Claude Code sessions showing context usage, active tools, and task progress",
5+
"author": {
6+
"name": "duyet"
7+
}
8+
}

statusline/README.md

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Statusline
2+
3+
A Claude Code plugin that provides real-time visibility into your coding session. Track context usage, active tools, running agents, and task progress at a glance.
4+
5+
**Inspired by [claude-hud](https://github.com/jarrodwatts/claude-hud) — enhanced for the claude-plugins ecosystem.**
6+
7+
## Overview
8+
9+
Statusline keeps you informed about what's happening during your Claude Code session without interrupting your workflow. Get immediate feedback on:
10+
11+
| Metric | Purpose |
12+
|--------|---------|
13+
| **Context Health** | Know exactly how much of your token window is in use |
14+
| **Active Tools** | See which tools Claude is using right now |
15+
| **Agent Tracking** | Monitor running agents and their execution time |
16+
| **Task Progress** | Track todo completion in real-time |
17+
18+
## Installation
19+
20+
Add the plugin to your Claude Code instance:
21+
22+
```bash
23+
/plugin install statusline
24+
```
25+
26+
Then enable monitoring:
27+
28+
```bash
29+
/statusline:enable
30+
```
31+
32+
## Quick Start
33+
34+
### View Current Status
35+
Check your session metrics anytime:
36+
```bash
37+
/statusline:status
38+
```
39+
40+
### Continuous Monitoring
41+
Enable automatic status updates (5-second interval by default):
42+
```bash
43+
/statusline:enable
44+
```
45+
46+
### Custom Update Interval
47+
Set a custom monitoring interval (in seconds):
48+
```bash
49+
/statusline:enable 10
50+
```
51+
52+
### Stop Monitoring
53+
Pause background updates while keeping the plugin active:
54+
```bash
55+
/statusline:disable
56+
```
57+
58+
## Commands
59+
60+
| Command | Purpose |
61+
|---------|---------|
62+
| `/statusline:status` | Display current session metrics immediately |
63+
| `/statusline:enable [interval]` | Enable real-time monitoring with optional custom interval |
64+
| `/statusline:disable` | Pause automatic status updates |
65+
66+
## What Each Metric Shows
67+
68+
### Context Window
69+
A visual progress bar showing your token usage with color coding:
70+
- 🟢 Green: 0-60% — Comfortable usage
71+
- 🟡 Yellow: 60-85% — Getting full
72+
- 🔴 Red: 85%+ — Approaching limit
73+
74+
Example:
75+
```
76+
Context: ████░░░░░░ 45% (90,000 / 200,000 tokens)
77+
```
78+
79+
### Active Tools
80+
Lists tools currently in use with operation counts:
81+
```
82+
Active Tools:
83+
• Read (2 instances)
84+
• Bash (1 instance)
85+
• Glob (1 instance)
86+
```
87+
88+
### Completed Tools
89+
Aggregated summary of completed tool operations:
90+
```
91+
Completed: ✓ Glob ×4 | ✓ Bash ×8 | ✓ Read ×12 | ✓ Edit ×3
92+
```
93+
94+
### Running Agents
95+
Shows active agents with elapsed time:
96+
```
97+
Agents Running:
98+
• Explore: Analyzing codebase structure (12s)
99+
• code-reviewer: Reviewing authentication module (5s)
100+
```
101+
102+
### Task Progress
103+
Real-time todo tracking:
104+
```
105+
Tasks: ⏳ 2 pending | 🔄 1 in progress | ✓ 5 completed (5/8 total)
106+
```
107+
108+
### Session Duration
109+
Tracks how long your current session has been active:
110+
```
111+
Duration: 12m 34s
112+
```
113+
114+
## Features
115+
116+
**Real-time Updates** — Status refreshes automatically at your chosen interval
117+
118+
**Non-intrusive** — Displays without interrupting your workflow
119+
120+
**Customizable** — Set monitoring frequency that works for you
121+
122+
**Manual Control** — Check status anytime with `/statusline:status`
123+
124+
**Plugin Integration** — Works seamlessly with other Claude Code plugins
125+
126+
**Token Awareness** — Shows actual token counts from Claude Code
127+
128+
## Use Cases
129+
130+
- **Monitor Context** — Know when you're approaching context limits before running out
131+
- **Track Progress** — See how many tasks have been completed in your session
132+
- **Debug Workflows** — Understand tool and agent activity during complex operations
133+
- **Optimize Sessions** — Identify bottlenecks and adjust your approach
134+
- **Stay Informed** — Keep awareness of background operations
135+
136+
## How It Works
137+
138+
The plugin reads session data from Claude Code's internal state and displays aggregated metrics about:
139+
140+
1. **Token Usage** — Real counts from Claude Code's context window
141+
2. **Tool Activity** — Tracked from tool invocations in your session
142+
3. **Agent Operations** — Monitored from subagent execution
143+
4. **Task Management** — Read from your TodoWrite operations
144+
145+
Updates happen at a regular interval (default 5 seconds) without blocking your work.
146+
147+
## Requirements
148+
149+
- Claude Code v1.0.80+
150+
- Node.js 18+ or Bun (if running custom build)
151+
152+
## Inspiration
153+
154+
This plugin is inspired by [claude-hud](https://github.com/jarrodwatts/claude-hud) but optimized for the claude-plugins marketplace with enhanced integration and customization options.
155+
156+
## Development
157+
158+
Session Monitor is built with:
159+
- TypeScript for type safety
160+
- Claude Code's native APIs
161+
- Minimal dependencies for quick performance
162+
163+
### Source Structure
164+
165+
```
166+
session-monitor/
167+
├── .claude-plugin/
168+
│ └── plugin.json # Plugin manifest
169+
├── commands/
170+
│ ├── status.md # Status command documentation
171+
│ ├── enable.md # Enable command documentation
172+
│ └── disable.md # Disable command documentation
173+
└── README.md # This file
174+
```
175+
176+
## Contributing
177+
178+
Found an issue or have a feature idea? Contributions are welcome! This plugin is part of the [claude-plugins](https://github.com/duyet/claude-plugins) marketplace.
179+
180+
## License
181+
182+
MIT License — see LICENSE file
183+
184+
## Related Plugins
185+
186+
- **[team-agents](../team-agents)** — Coordinated parallel task execution
187+
- **[commit](../commit)** — Semantic Git commit automation
188+
- **[ralph-wiggum](../ralph-wiggum)** — Self-referential development loops
189+
190+
---
191+
192+
**Questions?** Open an issue on the [claude-plugins repository](https://github.com/duyet/claude-plugins/issues)

statusline/commands/config.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# /statusline:config
2+
3+
Configure the statusline plugin with your preferences through interactive questions.
4+
5+
## Usage
6+
7+
```
8+
/statusline:config
9+
```
10+
11+
## What It Does
12+
13+
This command walks you through a series of questions to configure how statusline displays information in your Claude Code session:
14+
15+
- **Display Frequency** — How often to update metrics (1-60 seconds)
16+
- **Display Format** — Compact, standard, or detailed output
17+
- **Metrics to Show** — Choose which metrics are important to you
18+
- **Color Theme** — Terminal-aware theme selection
19+
- **Auto-Start** — Enable monitoring automatically on session start
20+
21+
## Configuration Questions
22+
23+
The interactive setup includes:
24+
25+
1. **Update Interval** — How frequently should statusline refresh?
26+
- Fast (1-3 seconds) for active monitoring
27+
- Standard (5-10 seconds) for balanced view
28+
- Slow (15-60 seconds) for minimal updates
29+
30+
2. **Display Mode** — How should metrics be displayed?
31+
- **Compact** — Single line summary
32+
- **Standard** — Multi-line detailed view (default)
33+
- **Detailed** — Full breakdown with charts
34+
35+
3. **Show Metrics** — Which information matters most?
36+
- Context health
37+
- Active tools
38+
- Running agents
39+
- Task progress
40+
- Session duration
41+
42+
4. **Color Theme** — Terminal color preference?
43+
- Auto (detects terminal)
44+
- Dark background
45+
- Light background
46+
- No colors (plain text)
47+
48+
5. **Auto-Start** — Enable monitoring on session start?
49+
- Enabled (recommended)
50+
- Disabled
51+
52+
## Example Session
53+
54+
```
55+
$ /statusline:config
56+
57+
⚙️ Statusline Configuration Wizard
58+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
59+
60+
Q1: Update Interval?
61+
▶ Standard (5-10 seconds)
62+
○ Fast (1-3 seconds)
63+
○ Slow (15-60 seconds)
64+
65+
Q2: Display Mode?
66+
○ Compact (single line)
67+
▶ Standard (multi-line)
68+
○ Detailed (with charts)
69+
70+
Q3: Show metrics (select multiple)?
71+
☑ Context health
72+
☑ Active tools
73+
☑ Running agents
74+
☑ Task progress
75+
☑ Duration
76+
77+
Q4: Color theme?
78+
▶ Auto (auto-detect)
79+
○ Dark
80+
○ Light
81+
○ None
82+
83+
Q5: Auto-start monitoring?
84+
▶ Enabled
85+
○ Disabled
86+
87+
✓ Configuration saved!
88+
→ Statusline will update every 5 seconds in standard mode
89+
→ Monitoring enabled on session start
90+
→ Use /statusline:status to view metrics anytime
91+
```
92+
93+
## Configuration File
94+
95+
Your settings are saved to `.statusline.config.json` in your project root. You can also manually edit this file if needed.
96+
97+
## Related Commands
98+
99+
- `/statusline:status` — View current metrics immediately
100+
- `/statusline:enable [interval]` — Enable with custom interval
101+
- `/statusline:disable` — Pause monitoring

statusline/commands/disable.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# /statusline:disable
2+
3+
Disable real-time session monitoring and status updates.
4+
5+
## Usage
6+
7+
```
8+
/statusline:disable
9+
```
10+
11+
## What It Does
12+
13+
Stops background session monitoring while keeping the plugin active. This prevents periodic status updates from appearing in your session.
14+
15+
- Stops real-time monitoring
16+
- Plugin remains installed and available
17+
- Status info can still be viewed on-demand with `/statusline:status`
18+
- Monitoring can be re-enabled anytime with `/statusline:enable`
19+
20+
## Notes
21+
22+
- Disabling only pauses automatic updates, not the plugin itself
23+
- You can still manually check session status with `/statusline:status`
24+
- Plugin data and history are preserved when disabled
25+
- No changes to your workflow or active tasks
26+
27+
## Related Commands
28+
29+
- `/statusline:enable` — Resume real-time monitoring
30+
- `/statusline:status` — View metrics without continuous monitoring

statusline/commands/enable.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# /statusline:enable
2+
3+
Enable real-time session monitoring with automatic status updates.
4+
5+
## Usage
6+
7+
```
8+
/statusline:enable [interval]
9+
```
10+
11+
### Parameters
12+
13+
- `interval` (optional) — Update interval in seconds. Default: 5 seconds. Min: 1, Max: 60
14+
15+
## What It Does
16+
17+
Enables continuous monitoring of your session with status updates displayed at regular intervals:
18+
19+
- Real-time context usage tracking
20+
- Active tool monitoring
21+
- Running agent visibility
22+
- Task/todo progress updates
23+
24+
The monitor runs in the background and displays summary updates without interrupting your workflow.
25+
26+
## Examples
27+
28+
Enable with default 5-second updates:
29+
```
30+
/statusline:enable
31+
```
32+
33+
Enable with custom 10-second interval:
34+
```
35+
/statusline:enable 10
36+
```
37+
38+
## Notes
39+
40+
- Monitoring is active by default when the plugin is installed
41+
- Updates respect your Claude Code terminal settings
42+
- You can view the current status anytime with `/statusline:status`
43+
- Use `/statusline:disable` to stop background updates
44+
45+
## Related Commands
46+
47+
- `/statusline:status` — View current metrics immediately
48+
- `/statusline:disable` — Stop background monitoring

0 commit comments

Comments
 (0)