@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 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
9
+ ## What's New in v7.10
10
10
 
11
- - **Multi-account tool v2** — chmod 0700 security, `doctor` command, `--json` output, standardized exit codes, `.claude-profile` auto-switch, bash/zsh completions, 23 bats tests
12
- - **5-language i18n** — 29 new keys across en/fr/es/de/pt for doctor, permissions, JSON output
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
- Affiche une status line personnalisée dans Claude Code avec des informations contextuelles.
3
+ A customizable status line for Claude Code displaying contextual information.
4
4
 
5
- ## Aperçu
5
+ ## Preview
6
6
 
7
+ **Compact mode** (default, 1 line):
7
8
  ```
8
- 🔑 pro | 🧠 Opus | 🌿 main +2~1 | 📁 mon-projet | 📊 45% | ⏱️ 5h: 23% | 📅 Sem: 45% | 💰 $0.42 | 🕐 14:32
9
+ 🔑 pro | 🧠 Opus | 🌿 main +2~1 | 📁 my-project | 📊 42% | ⏱️ 5h: 23% | 📅 Sem: 45% | 💰 $0.42 | 🕐 14:32
9
10
  ```
10
11
 
11
- ### Éléments affichés
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
- | Emoji | Info | Description |
14
- |-------|------|-------------|
15
- | 🔑 | Profil | Compte Claude actif (via `CLAUDE_CONFIG_DIR`) |
16
- | 🧠/🎵/🍃 | Modèle | Opus/Sonnet/Haiku |
17
- | 🌿 | Git | Branche + status (+staged ~modified ?untracked) |
18
- | 📁 | Projet | Nom du répertoire projet |
19
- | 📊 | Contexte | % utilisé (vert < 60%, jaune < 80%, rouge ≥ 80%) |
20
- | ⏱️ | Session | % limite session 5h utilisée (via ccusage) |
21
- | 📅 | Hebdo | % limite hebdomadaire utilisée (via ccusage) |
22
- | 💰 | Coût | Coût session en USD |
23
- | 🕐 | Heure | Heure actuelle |
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. Copier le script
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. Configurer Claude Code
45
+ ### 2. Configure Claude Code
36
46
 
37
- Fusionne avec ton `~/.claude/settings.json` existant :
47
+ Merge into your `~/.claude/settings.json`:
38
48
 
39
49
  ```json
40
50
  {
41
51
  "statusLine": {
42
- "enabled": true,
43
- "script": "~/.claude/statusline.sh"
52
+ "type": "command",
53
+ "command": "~/.claude/statusline.sh"
44
54
  }
45
55
  }
46
56
  ```
47
57
 
48
- ### 3. Installer les dépendances
58
+ ### 3. Install dependencies
49
59
 
50
60
  ```bash
51
- # jq est requis pour parser le JSON
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 (optionnel, pour tracking avancé des coûts)
68
+ # ccusage (optional for session/weekly usage tracking)
59
69
  npm install -g ccusage
60
70
  ```
61
71
 
62
- ### 4. Configurer les profils multiples (optionnel)
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
- cp statusline.conf.example ~/.claude/statusline.conf
74
- ```
75
-
76
- Édite `~/.claude/statusline.conf` :
75
+ # Check version
76
+ bash ~/.claude/statusline.sh --version
77
77
 
78
- ```bash
79
- # Limites de session (approximation 5h)
80
- SESSION_COST_LIMIT=25.00 # En dollars
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
- # Limites hebdomadaires
83
- WEEKLY_COST_LIMIT=150.00 # En dollars
82
+ ## Configuration
84
83
 
85
- # Seuils d'alerte
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
- # Cache (évite les appels répétés à ccusage)
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
- # Affichage (true/false)
94
- SHOW_SESSION_LIMIT=true
95
- SHOW_WEEKLY_LIMIT=true
88
+ Every element can be shown or hidden independently:
96
89
 
97
- # Labels personnalisés
98
- SESSION_LABEL="⏱️ 5h"
99
- WEEKLY_LABEL="📅 Sem"
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
- ### Modifier les seuils de contexte
103
-
104
- Édite `~/.claude/statusline.sh` :
106
+ ### Display Mode
105
107
 
106
108
  ```bash
107
- CONTEXT_WARN_THRESHOLD=60 # Jaune à partir de 60%
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
- ### Ajouter/retirer des éléments
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
- ### Changer les emojis
116
-
117
- Modifie la fonction `get_model_emoji()` ou les lignes d'output.
118
-
119
- ## Troubleshooting
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
- - Installe ccusage : `npm install -g ccusage`
130
- - Le coût peut mettre quelques secondes à se mettre à jour
120
+ ### Usage Limits
131
121
 
132
- ### Les limites 5h/Hebdo ne s'affichent pas
122
+ Adjust for your Claude subscription plan:
133
123
 
134
- - ccusage doit être installé : `npm install -g ccusage`
135
- - Vérifie que npx fonctionne : `npx ccusage daily --json`
136
- - Les données apparaissent seulement s'il y a de l'usage (> 0%)
137
- - Le cache peut retarder l'affichage (60s pour session, 5min pour hebdo)
124
+ ```bash
125
+ # Pro ($20/month)
126
+ SESSION_COST_LIMIT=25.00
127
+ WEEKLY_COST_LIMIT=150.00
138
128
 
139
- ### Les pourcentages semblent incorrects
129
+ # Max 5x ($100/month)
130
+ SESSION_COST_LIMIT=125.00
131
+ WEEKLY_COST_LIMIT=750.00
140
132
 
141
- Les limites sont des estimations que tu définis dans `statusline.conf`.
142
- Ajuste `SESSION_COST_LIMIT` et `WEEKLY_COST_LIMIT` selon ton expérience d'utilisation.
133
+ # Max 20x ($200/month) default
134
+ SESSION_COST_LIMIT=500.00
135
+ WEEKLY_COST_LIMIT=3000.00
136
+ ```
143
137
 
144
- ### Le contexte % semble incorrect
138
+ ### Alert Thresholds
145
139
 
146
- L'estimation est basée sur la taille du fichier transcript (~4MB = 100%).
147
- Ajuste `max_size` dans la fonction `get_context_percent()` si nécessaire.
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
- ## Commandes utiles
147
+ ### Cache TTL
150
148
 
151
149
  ```bash
152
- # Voir l'usage du jour avec ccusage
153
- npx ccusage daily
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
- # Monitoring live
156
- npx ccusage blocks --live
155
+ ## Troubleshooting
157
156
 
158
- # Usage par projet
159
- npx ccusage daily --instances
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,6 +1,6 @@
1
1
  {
2
2
  "statusLine": {
3
- "enabled": true,
4
- "script": "~/.claude/statusline.sh"
3
+ "type": "command",
4
+ "command": "~/.claude/statusline.sh"
5
5
  }
6
6
  }
@@ -1,75 +1,100 @@
1
1
  # =============================================================================
2
- # Claude Code Status Line - Configuration des limites d'utilisation
2
+ # Claude Code Status Line v2.0 Configuration
3
3
  # =============================================================================
4
4
  #
5
- # Copier ce fichier vers ~/.claude/statusline.conf et ajuster les valeurs
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
- # LIMITES DE SESSION (approximation période 5h)
12
+ # SESSION LIMITS (approximate 5h window)
15
13
  # =============================================================================
16
- # Note: Claude Code n'expose pas les vraies limites, ces valeurs sont des
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
- # Valeurs recommandées par plan (en dollars):
20
- # - Pro ($20/mois) : SESSION=25, WEEKLY=150
21
- # - Max 5x ($100/mois) : SESSION=125, WEEKLY=750
22
- # - Max 20x ($200/mois): SESSION=500, WEEKLY=3000
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
- # LIMITES HEBDOMADAIRES
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
- # SEUILS D'ALERTE (pourcentage)
29
+ # ALERT THRESHOLDS (percentage)
43
30
  # =============================================================================
44
- # Couleur de l'indicateur selon le pourcentage utilisé:
45
- # - Vert : < USAGE_WARN_THRESHOLD
46
- # - Jaune : USAGE_WARN_THRESHOLD - USAGE_CRIT_THRESHOLD
47
- # - Rouge : > USAGE_CRIT_THRESHOLD
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
- # Durée du cache en secondes pour éviter les appels répétés à ccusage
56
- # (ccusage peut être lent à démarrer via npx)
47
+ # TTL in seconds to avoid repeated calls to ccusage
57
48
 
58
- # Cache pour l'usage de session (rafraîchi plus souvent)
49
+ # Session usage cache (refreshed more often)
59
50
  SESSION_CACHE_TTL=60
60
51
 
61
- # Cache pour l'usage hebdomadaire (change moins vite)
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
- # AFFICHAGE
59
+ # ELEMENT TOGGLES
66
60
  # =============================================================================
67
- # Activer/désactiver l'affichage des limites
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
- # Labels personnalisés (avec emoji)
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"