@the-bearded-bear/claude-craft 7.9.0 → 7.10.0-next.79ddea4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/Tools/StatusLine/README.md +135 -96
- package/Tools/StatusLine/settings.json +2 -2
- package/Tools/StatusLine/statusline.conf.example +60 -35
- package/Tools/StatusLine/statusline.sh +463 -131
- package/Tools/StatusLine/tests/statusline.bats +241 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
A comprehensive framework for AI-assisted development with [Claude Code](https://claude.ai/code). Install standardized rules, agents, and commands for your projects across multiple technology stacks.
|
|
8
8
|
|
|
9
|
-
## What's New in v7.
|
|
9
|
+
## What's New in v7.10
|
|
10
10
|
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
11
|
+
- **Status Line v2.0** — fixed `settings.json` format, native `context_window` %, single jq call (7→1), git cache, 13 toggles, agent name, vim mode, burn rate, progress bar styles, compact/detailed modes, `--version`/`--help`, 27 bats tests
|
|
12
|
+
- **Multi-account tool v2** — `doctor` command, `--json` output, exit codes, `.claude-profile` auto-switch, bash/zsh completions, 23 bats tests
|
|
13
13
|
- See [CHANGELOG](CHANGELOG.md) for full details
|
|
14
14
|
|
|
15
15
|
> See [CHANGELOG.md](CHANGELOG.md) for previous versions.
|
|
@@ -1,160 +1,199 @@
|
|
|
1
|
-
# Claude Code Status Line
|
|
1
|
+
# Claude Code Status Line v2.0
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A customizable status line for Claude Code displaying contextual information.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Preview
|
|
6
6
|
|
|
7
|
+
**Compact mode** (default, 1 line):
|
|
7
8
|
```
|
|
8
|
-
🔑 pro | 🧠 Opus | 🌿 main +2~1 | 📁
|
|
9
|
+
🔑 pro | 🧠 Opus | 🌿 main +2~1 | 📁 my-project | 📊 42% | ⏱️ 5h: 23% | 📅 Sem: 45% | 💰 $0.42 | 🕐 14:32
|
|
9
10
|
```
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
**Detailed mode** (2 lines):
|
|
13
|
+
```
|
|
14
|
+
🔑 pro | 🧠 Opus | 🌿 main +2~1 | 📁 my-project | @agent | NORMAL
|
|
15
|
+
📊 [▓▓▓▓░░░░░░] 42% | 💰 $0.42 ($0.12/min) | +156 -23 | ⏱️ 5h: 23% | 📅 Sem: 45% | 🕐 14:32
|
|
16
|
+
```
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
18
|
+
### Elements
|
|
19
|
+
|
|
20
|
+
| Emoji | Element | Description |
|
|
21
|
+
|-------|---------|-------------|
|
|
22
|
+
| 🔑 | Profile | Active Claude account (via `CLAUDE_CONFIG_DIR`) |
|
|
23
|
+
| 🧠/🎵/🍃 | Model | Opus / Sonnet / Haiku |
|
|
24
|
+
| 🌿 | Git | Branch + status (+staged ~modified ?untracked) |
|
|
25
|
+
| 📁 | Project | Project directory name |
|
|
26
|
+
| @ | Agent | Current agent name (when using agents) |
|
|
27
|
+
| | Vim mode | NORMAL / INSERT (when vim mode enabled) |
|
|
28
|
+
| 📊 | Context | % context window used (percentage, bar, or both) |
|
|
29
|
+
| ⏱️ | Session | % session limit used (via ccusage) |
|
|
30
|
+
| 📅 | Weekly | % weekly limit used (via ccusage) |
|
|
31
|
+
| 💰 | Cost | Session cost in USD (+ optional burn rate $/min) |
|
|
32
|
+
| 🕐 | Time | Current time |
|
|
24
33
|
|
|
25
34
|
## Installation
|
|
26
35
|
|
|
27
|
-
### 1.
|
|
36
|
+
### 1. Copy the script
|
|
28
37
|
|
|
29
38
|
```bash
|
|
30
39
|
mkdir -p ~/.claude
|
|
31
40
|
cp statusline.sh ~/.claude/statusline.sh
|
|
41
|
+
cp statusline.conf.example ~/.claude/statusline.conf
|
|
32
42
|
chmod +x ~/.claude/statusline.sh
|
|
33
43
|
```
|
|
34
44
|
|
|
35
|
-
### 2.
|
|
45
|
+
### 2. Configure Claude Code
|
|
36
46
|
|
|
37
|
-
|
|
47
|
+
Merge into your `~/.claude/settings.json`:
|
|
38
48
|
|
|
39
49
|
```json
|
|
40
50
|
{
|
|
41
51
|
"statusLine": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
52
|
+
"type": "command",
|
|
53
|
+
"command": "~/.claude/statusline.sh"
|
|
44
54
|
}
|
|
45
55
|
}
|
|
46
56
|
```
|
|
47
57
|
|
|
48
|
-
### 3.
|
|
58
|
+
### 3. Install dependencies
|
|
49
59
|
|
|
50
60
|
```bash
|
|
51
|
-
# jq
|
|
61
|
+
# jq is required for JSON parsing
|
|
52
62
|
# macOS
|
|
53
63
|
brew install jq
|
|
54
64
|
|
|
55
65
|
# Linux (Debian/Ubuntu)
|
|
56
66
|
sudo apt install jq
|
|
57
67
|
|
|
58
|
-
# ccusage (
|
|
68
|
+
# ccusage (optional — for session/weekly usage tracking)
|
|
59
69
|
npm install -g ccusage
|
|
60
70
|
```
|
|
61
71
|
|
|
62
|
-
### 4.
|
|
63
|
-
|
|
64
|
-
Voir `Tools/MultiAccount/` pour gérer plusieurs comptes Claude Code.
|
|
65
|
-
|
|
66
|
-
## Personnalisation
|
|
67
|
-
|
|
68
|
-
### Configurer les limites d'utilisation
|
|
69
|
-
|
|
70
|
-
Copie le fichier de configuration exemple et ajuste les valeurs selon ton abonnement :
|
|
72
|
+
### 4. Verify
|
|
71
73
|
|
|
72
74
|
```bash
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Édite `~/.claude/statusline.conf` :
|
|
75
|
+
# Check version
|
|
76
|
+
bash ~/.claude/statusline.sh --version
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
# Test with sample JSON
|
|
79
|
+
echo '{"model":{"display_name":"Opus","id":"claude-opus-4-6"},"context_window":{"used_percentage":42},"cost":{"total_cost_usd":0.5},"workspace":{"current_dir":"/tmp/test","project_dir":"/tmp/test"}}' | bash ~/.claude/statusline.sh
|
|
80
|
+
```
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
WEEKLY_COST_LIMIT=150.00 # En dollars
|
|
82
|
+
## Configuration
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
USAGE_WARN_THRESHOLD=60 # Jaune à partir de 60%
|
|
87
|
-
USAGE_CRIT_THRESHOLD=80 # Rouge à partir de 80%
|
|
84
|
+
Edit `~/.claude/statusline.conf` (copied from `statusline.conf.example`):
|
|
88
85
|
|
|
89
|
-
|
|
90
|
-
SESSION_CACHE_TTL=60 # Rafraîchissement toutes les 60s
|
|
91
|
-
WEEKLY_CACHE_TTL=300 # Rafraîchissement toutes les 5min
|
|
86
|
+
### Element Toggles
|
|
92
87
|
|
|
93
|
-
|
|
94
|
-
SHOW_SESSION_LIMIT=true
|
|
95
|
-
SHOW_WEEKLY_LIMIT=true
|
|
88
|
+
Every element can be shown or hidden independently:
|
|
96
89
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
```bash
|
|
91
|
+
SHOW_PROFILE=true # 🔑 Profile name
|
|
92
|
+
SHOW_MODEL=true # 🧠 Model name
|
|
93
|
+
SHOW_GIT=true # 🌿 Git branch + status
|
|
94
|
+
SHOW_PROJECT=true # 📁 Project name
|
|
95
|
+
SHOW_CONTEXT=true # 📊 Context percentage
|
|
96
|
+
SHOW_COST=true # 💰 Session cost
|
|
97
|
+
SHOW_TIME=true # 🕐 Current time
|
|
98
|
+
SHOW_AGENT=true # @ Agent name (auto)
|
|
99
|
+
SHOW_VIM_MODE=true # Vim mode (auto)
|
|
100
|
+
SHOW_SESSION_LIMIT=true # ⏱️ Session usage %
|
|
101
|
+
SHOW_WEEKLY_LIMIT=true # 📅 Weekly usage %
|
|
102
|
+
SHOW_BURN_RATE=false # $/min (opt-in)
|
|
103
|
+
SHOW_LINES_CHANGED=false # +N -M lines (opt-in)
|
|
100
104
|
```
|
|
101
105
|
|
|
102
|
-
###
|
|
103
|
-
|
|
104
|
-
Édite `~/.claude/statusline.sh` :
|
|
106
|
+
### Display Mode
|
|
105
107
|
|
|
106
108
|
```bash
|
|
107
|
-
|
|
108
|
-
CONTEXT_CRIT_THRESHOLD=80 # Rouge à partir de 80%
|
|
109
|
+
STATUSLINE_MODE=compact # compact (1 line) or detailed (2 lines)
|
|
109
110
|
```
|
|
110
111
|
|
|
111
|
-
###
|
|
112
|
-
|
|
113
|
-
Commente ou décommente les sections dans la partie "CONSTRUCTION DE LA STATUS LINE" du script.
|
|
112
|
+
### Context Bar Style
|
|
114
113
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
### La status line ne s'affiche pas
|
|
122
|
-
|
|
123
|
-
1. Vérifie que le script est exécutable : `ls -la ~/.claude/statusline.sh`
|
|
124
|
-
2. Teste manuellement : `echo '{"model":{"display_name":"Test"}}' | ~/.claude/statusline.sh`
|
|
125
|
-
3. Vérifie les logs Claude Code
|
|
126
|
-
|
|
127
|
-
### Le coût affiche toujours $0.00
|
|
114
|
+
```bash
|
|
115
|
+
CONTEXT_BAR_STYLE=percentage # "42%"
|
|
116
|
+
# CONTEXT_BAR_STYLE=bar # "[▓▓▓▓░░░░░░]"
|
|
117
|
+
# CONTEXT_BAR_STYLE=both # "[▓▓▓▓░░░░░░] 42%"
|
|
118
|
+
```
|
|
128
119
|
|
|
129
|
-
|
|
130
|
-
- Le coût peut mettre quelques secondes à se mettre à jour
|
|
120
|
+
### Usage Limits
|
|
131
121
|
|
|
132
|
-
|
|
122
|
+
Adjust for your Claude subscription plan:
|
|
133
123
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
124
|
+
```bash
|
|
125
|
+
# Pro ($20/month)
|
|
126
|
+
SESSION_COST_LIMIT=25.00
|
|
127
|
+
WEEKLY_COST_LIMIT=150.00
|
|
138
128
|
|
|
139
|
-
|
|
129
|
+
# Max 5x ($100/month)
|
|
130
|
+
SESSION_COST_LIMIT=125.00
|
|
131
|
+
WEEKLY_COST_LIMIT=750.00
|
|
140
132
|
|
|
141
|
-
|
|
142
|
-
|
|
133
|
+
# Max 20x ($200/month) — default
|
|
134
|
+
SESSION_COST_LIMIT=500.00
|
|
135
|
+
WEEKLY_COST_LIMIT=3000.00
|
|
136
|
+
```
|
|
143
137
|
|
|
144
|
-
###
|
|
138
|
+
### Alert Thresholds
|
|
145
139
|
|
|
146
|
-
|
|
147
|
-
|
|
140
|
+
```bash
|
|
141
|
+
CONTEXT_WARN_THRESHOLD=60 # Yellow at 60%
|
|
142
|
+
CONTEXT_CRIT_THRESHOLD=80 # Red at 80%
|
|
143
|
+
USAGE_WARN_THRESHOLD=60
|
|
144
|
+
USAGE_CRIT_THRESHOLD=80
|
|
145
|
+
```
|
|
148
146
|
|
|
149
|
-
|
|
147
|
+
### Cache TTL
|
|
150
148
|
|
|
151
149
|
```bash
|
|
152
|
-
#
|
|
153
|
-
|
|
150
|
+
SESSION_CACHE_TTL=60 # Session usage cache (seconds)
|
|
151
|
+
WEEKLY_CACHE_TTL=300 # Weekly usage cache (seconds)
|
|
152
|
+
GIT_CACHE_TTL=5 # Git status cache (seconds)
|
|
153
|
+
```
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
npx ccusage blocks --live
|
|
155
|
+
## Troubleshooting
|
|
157
156
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
### Status line not showing
|
|
158
|
+
|
|
159
|
+
1. Verify the script is executable: `ls -la ~/.claude/statusline.sh`
|
|
160
|
+
2. Check settings.json format — must use `"type": "command"`:
|
|
161
|
+
```bash
|
|
162
|
+
cat ~/.claude/settings.json | jq '.statusLine'
|
|
163
|
+
# Expected: { "type": "command", "command": "~/.claude/statusline.sh" }
|
|
164
|
+
```
|
|
165
|
+
3. Test manually: `echo '{"model":{"display_name":"Test"}}' | ~/.claude/statusline.sh`
|
|
166
|
+
4. Verify jq is installed: `which jq`
|
|
167
|
+
|
|
168
|
+
### Cost always shows $0.00
|
|
169
|
+
|
|
170
|
+
Claude Code provides `cost.total_cost_usd` natively. If it shows 0, the session may have just started.
|
|
171
|
+
|
|
172
|
+
### Session/Weekly limits not showing
|
|
173
|
+
|
|
174
|
+
- Install ccusage globally: `npm install -g ccusage`
|
|
175
|
+
- Verify it works: `ccusage daily --json`
|
|
176
|
+
- Values only appear when usage > 0%
|
|
177
|
+
- Cache may delay display (60s session, 5min weekly)
|
|
178
|
+
|
|
179
|
+
### Context % seems incorrect
|
|
180
|
+
|
|
181
|
+
v2.0 reads `context_window.used_percentage` natively from Claude Code.
|
|
182
|
+
Falls back to transcript size estimation only if native value is unavailable.
|
|
183
|
+
|
|
184
|
+
## What's New in v2.0
|
|
185
|
+
|
|
186
|
+
- **Fixed settings.json format** — uses correct `"type": "command"` format
|
|
187
|
+
- **Native context window** — reads `context_window.used_percentage` from Claude Code
|
|
188
|
+
- **Single jq call** — 7 separate jq invocations replaced by 1 (performance)
|
|
189
|
+
- **Cross-platform** — `stat` helper works on both Linux and macOS
|
|
190
|
+
- **Git cache** — git status cached for 5s to reduce overhead
|
|
191
|
+
- **Progress bar** — context can display as `[▓▓▓▓░░░░░░]`
|
|
192
|
+
- **Detailed mode** — 2-line layout with identity + metrics
|
|
193
|
+
- **Agent name** — shows `@agent-name` when using agents
|
|
194
|
+
- **Vim mode** — shows NORMAL/INSERT when vim mode is enabled
|
|
195
|
+
- **Burn rate** — optional $/min display
|
|
196
|
+
- **Lines changed** — optional +N -M from Claude Code
|
|
197
|
+
- **Full toggles** — every element individually toggleable
|
|
198
|
+
- **--version / --help** flags
|
|
199
|
+
- **Global ccusage preferred** — avoids slow `npx --yes` downloads
|
|
@@ -1,75 +1,100 @@
|
|
|
1
1
|
# =============================================================================
|
|
2
|
-
# Claude Code Status Line
|
|
2
|
+
# Claude Code Status Line v2.0 — Configuration
|
|
3
3
|
# =============================================================================
|
|
4
4
|
#
|
|
5
|
-
#
|
|
6
|
-
# selon votre abonnement Claude (Pro, Max, etc.)
|
|
5
|
+
# Copy to ~/.claude/statusline.conf and adjust values for your plan.
|
|
7
6
|
#
|
|
8
|
-
# Installation:
|
|
9
7
|
# cp statusline.conf.example ~/.claude/statusline.conf
|
|
10
8
|
#
|
|
11
9
|
# =============================================================================
|
|
12
10
|
|
|
13
11
|
# =============================================================================
|
|
14
|
-
#
|
|
12
|
+
# SESSION LIMITS (approximate 5h window)
|
|
15
13
|
# =============================================================================
|
|
16
|
-
#
|
|
17
|
-
# estimations basées sur votre expérience d'utilisation.
|
|
14
|
+
# Claude Code doesn't expose real limits. These are estimates based on usage.
|
|
18
15
|
#
|
|
19
|
-
#
|
|
20
|
-
# - Pro ($20/
|
|
21
|
-
# - Max 5x ($100/
|
|
22
|
-
# - Max 20x ($200/
|
|
16
|
+
# Recommended values by plan (in USD):
|
|
17
|
+
# - Pro ($20/month) : SESSION=25, WEEKLY=150
|
|
18
|
+
# - Max 5x ($100/month) : SESSION=125, WEEKLY=750
|
|
19
|
+
# - Max 20x ($200/month): SESSION=500, WEEKLY=3000
|
|
23
20
|
#
|
|
24
|
-
# En dollars (recommandé - plus stable que les tokens)
|
|
25
21
|
SESSION_COST_LIMIT=500.00
|
|
26
22
|
|
|
27
|
-
# OU en tokens (décommenter si préféré, commenter SESSION_COST_LIMIT)
|
|
28
|
-
# SESSION_TOKEN_LIMIT=500000
|
|
29
|
-
|
|
30
23
|
# =============================================================================
|
|
31
|
-
#
|
|
24
|
+
# WEEKLY LIMITS
|
|
32
25
|
# =============================================================================
|
|
33
|
-
# Estimation de votre quota hebdomadaire selon votre plan
|
|
34
|
-
#
|
|
35
|
-
# En dollars
|
|
36
26
|
WEEKLY_COST_LIMIT=3000.00
|
|
37
27
|
|
|
38
|
-
# OU en tokens
|
|
39
|
-
# WEEKLY_TOKEN_LIMIT=3000000
|
|
40
|
-
|
|
41
28
|
# =============================================================================
|
|
42
|
-
#
|
|
29
|
+
# ALERT THRESHOLDS (percentage)
|
|
43
30
|
# =============================================================================
|
|
44
|
-
#
|
|
45
|
-
# -
|
|
46
|
-
# -
|
|
47
|
-
# -
|
|
31
|
+
# Color changes based on percentage used:
|
|
32
|
+
# - Green : < WARN threshold
|
|
33
|
+
# - Yellow : WARN — CRIT
|
|
34
|
+
# - Red : > CRIT threshold
|
|
35
|
+
|
|
36
|
+
# Context window thresholds
|
|
37
|
+
CONTEXT_WARN_THRESHOLD=60
|
|
38
|
+
CONTEXT_CRIT_THRESHOLD=80
|
|
48
39
|
|
|
40
|
+
# Usage (session/weekly) thresholds
|
|
49
41
|
USAGE_WARN_THRESHOLD=60
|
|
50
42
|
USAGE_CRIT_THRESHOLD=80
|
|
51
43
|
|
|
52
44
|
# =============================================================================
|
|
53
45
|
# CACHE (performance)
|
|
54
46
|
# =============================================================================
|
|
55
|
-
#
|
|
56
|
-
# (ccusage peut être lent à démarrer via npx)
|
|
47
|
+
# TTL in seconds to avoid repeated calls to ccusage
|
|
57
48
|
|
|
58
|
-
#
|
|
49
|
+
# Session usage cache (refreshed more often)
|
|
59
50
|
SESSION_CACHE_TTL=60
|
|
60
51
|
|
|
61
|
-
#
|
|
52
|
+
# Weekly usage cache (changes less frequently)
|
|
62
53
|
WEEKLY_CACHE_TTL=300
|
|
63
54
|
|
|
55
|
+
# Git status cache (branch + staged/unstaged counts)
|
|
56
|
+
GIT_CACHE_TTL=5
|
|
57
|
+
|
|
64
58
|
# =============================================================================
|
|
65
|
-
#
|
|
59
|
+
# ELEMENT TOGGLES
|
|
66
60
|
# =============================================================================
|
|
67
|
-
#
|
|
68
|
-
# Mettre à "false" pour masquer un indicateur
|
|
61
|
+
# Set to "false" to hide an element from the status line
|
|
69
62
|
|
|
63
|
+
SHOW_PROFILE=true
|
|
64
|
+
SHOW_MODEL=true
|
|
65
|
+
SHOW_GIT=true
|
|
66
|
+
SHOW_PROJECT=true
|
|
67
|
+
SHOW_CONTEXT=true
|
|
68
|
+
SHOW_COST=true
|
|
69
|
+
SHOW_TIME=true
|
|
70
|
+
SHOW_AGENT=true
|
|
71
|
+
SHOW_VIM_MODE=true
|
|
70
72
|
SHOW_SESSION_LIMIT=true
|
|
71
73
|
SHOW_WEEKLY_LIMIT=true
|
|
72
74
|
|
|
73
|
-
#
|
|
75
|
+
# Opt-in elements (disabled by default)
|
|
76
|
+
SHOW_BURN_RATE=false
|
|
77
|
+
SHOW_LINES_CHANGED=false
|
|
78
|
+
|
|
79
|
+
# =============================================================================
|
|
80
|
+
# DISPLAY MODE
|
|
81
|
+
# =============================================================================
|
|
82
|
+
# compact : Single line (default)
|
|
83
|
+
# detailed : Two lines — identity on top, metrics below
|
|
84
|
+
|
|
85
|
+
STATUSLINE_MODE=compact
|
|
86
|
+
|
|
87
|
+
# =============================================================================
|
|
88
|
+
# CONTEXT BAR STYLE
|
|
89
|
+
# =============================================================================
|
|
90
|
+
# percentage : "42%" (default)
|
|
91
|
+
# bar : "[▓▓▓▓░░░░░░]"
|
|
92
|
+
# both : "[▓▓▓▓░░░░░░] 42%"
|
|
93
|
+
|
|
94
|
+
CONTEXT_BAR_STYLE=percentage
|
|
95
|
+
|
|
96
|
+
# =============================================================================
|
|
97
|
+
# LABELS
|
|
98
|
+
# =============================================================================
|
|
74
99
|
SESSION_LABEL="⏱️ 5h"
|
|
75
100
|
WEEKLY_LABEL="📅 Sem"
|