claude-statusline 2.1.2

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.
Files changed (48) hide show
  1. package/LICENSE +203 -0
  2. package/README.md +362 -0
  3. package/bin/claude-statusline +22 -0
  4. package/dist/core/cache.d.ts +67 -0
  5. package/dist/core/cache.js +223 -0
  6. package/dist/core/cache.js.map +1 -0
  7. package/dist/core/config.d.ts +190 -0
  8. package/dist/core/config.js +192 -0
  9. package/dist/core/config.js.map +1 -0
  10. package/dist/core/security.d.ts +27 -0
  11. package/dist/core/security.js +154 -0
  12. package/dist/core/security.js.map +1 -0
  13. package/dist/env/context.d.ts +92 -0
  14. package/dist/env/context.js +295 -0
  15. package/dist/env/context.js.map +1 -0
  16. package/dist/git/native.d.ts +35 -0
  17. package/dist/git/native.js +141 -0
  18. package/dist/git/native.js.map +1 -0
  19. package/dist/git/status.d.ts +65 -0
  20. package/dist/git/status.js +256 -0
  21. package/dist/git/status.js.map +1 -0
  22. package/dist/index.bundle.js +11 -0
  23. package/dist/index.d.ts +9 -0
  24. package/dist/index.js +396 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/metafile.prod.json +473 -0
  27. package/dist/ui/symbols.d.ts +31 -0
  28. package/dist/ui/symbols.js +308 -0
  29. package/dist/ui/symbols.js.map +1 -0
  30. package/dist/ui/width.d.ts +29 -0
  31. package/dist/ui/width.js +261 -0
  32. package/dist/ui/width.js.map +1 -0
  33. package/dist/utils/runtime.d.ts +31 -0
  34. package/dist/utils/runtime.js +82 -0
  35. package/dist/utils/runtime.js.map +1 -0
  36. package/docs/ARCHITECTURE.md +336 -0
  37. package/docs/FEATURE_COMPARISON.md +178 -0
  38. package/docs/MIGRATION.md +354 -0
  39. package/docs/README.md +101 -0
  40. package/docs/eval-01-terminal-widths.md +519 -0
  41. package/docs/guide-01-configuration.md +277 -0
  42. package/docs/guide-02-troubleshooting.md +416 -0
  43. package/docs/guide-03-performance.md +183 -0
  44. package/docs/prd-01-typescript-perf-optimization.md +480 -0
  45. package/docs/research-01-sandbox-detection.md +169 -0
  46. package/docs/research-02-competitive-analysis.md +226 -0
  47. package/docs/research-03-platform-analysis.md +142 -0
  48. package/package.json +89 -0
@@ -0,0 +1,277 @@
1
+ # Configuration Guide
2
+
3
+ Complete guide to configuring claude-statusline for your workflow.
4
+
5
+ ## Quick Setup
6
+
7
+ ### Option A: Complete Example with All Options
8
+ ```bash
9
+ # Copy the full example with all options documented
10
+ cp .claude-statusline.json.example ~/.claude/.claude-statusline.json
11
+ ```
12
+
13
+ ### Option B: Minimal Example with Just Essentials
14
+ ```bash
15
+ # Copy minimal example for quick setup
16
+ cp .claude-statusline.json.example.min ~/.claude/.claude-statusline.json
17
+ ```
18
+
19
+ ### Edit Your Configuration
20
+ ```bash
21
+ nano ~/.claude/.claude-statusline.json
22
+ ```
23
+
24
+ ## Runtime Selection for Maximum Performance
25
+
26
+ ### Understanding the Performance Difference
27
+
28
+ claude-statusline can run on either Node.js or Bun runtimes, with significant performance differences:
29
+
30
+ | Runtime | Response Time | Performance | When to Use |
31
+ |---------|---------------|------------|-------------|
32
+ | **Bun** | ~5ms | Excellent (5x faster) | Recommended for best performance |
33
+ | **Node.js** | ~28ms | Good | Good fallback, widely available |
34
+
35
+ > **Important**: Even when installed with `bun install -g`, the executable's shebang defaults to Node.js. To get Bun's performance benefits, you must explicitly specify it in your Claude Code configuration.
36
+
37
+ ### Claude Code Configuration Options
38
+
39
+ #### Option 1: Maximum Performance (Recommended)
40
+ Use Bun runtime explicitly:
41
+
42
+ ```json
43
+ // ~/.claude/settings.json
44
+ {
45
+ "statusLine": {
46
+ "type": "command",
47
+ "command": "bun claude-statusline"
48
+ }
49
+ }
50
+ ```
51
+
52
+ #### Option 2: Standard Configuration
53
+ Uses Node.js runtime (default shebang):
54
+
55
+ ```json
56
+ // ~/.claude/settings.json
57
+ {
58
+ "statusLine": {
59
+ "type": "command",
60
+ "command": "claude-statusline"
61
+ }
62
+ }
63
+ ```
64
+
65
+ ### Installation vs Runtime
66
+
67
+ **Installation Method ≠ Runtime Used:**
68
+ - `bun install -g claude-statusline` - Just downloads the package
69
+ - `bun claude-statusline` - Actually uses Bun runtime for execution
70
+ - `claude-statusline` - Uses Node.js runtime (via shebang)
71
+
72
+ Both configurations work perfectly. The Bun runtime is 5x faster but requires Bun to be installed. Node.js is more widely available and still provides instant response times.
73
+
74
+ ## Configuration Search Order
75
+
76
+ 1. `./.claude-statusline.json` (project-specific)
77
+ 2. `~/.claude/.claude-statusline.json` (global) ← **Recommended**
78
+ 3. Environment variables (legacy)
79
+
80
+ > **Note**: The `~/.claude/` directory is the standard location for Claude Code configurations and hooks. This keeps all your Claude settings organized in one place and follows modern CLI best practices.
81
+
82
+ ## Configuration Options
83
+
84
+ ### Core Settings
85
+
86
+ | Option | Type | Default | Description |
87
+ |--------|------|---------|-------------|
88
+ | `cacheTTL` | number | `300` | Cache duration in seconds for git operations |
89
+ | `maxLength` | number | `1000` | Maximum input length (security) |
90
+ | `rightMargin` | number | `15` | Right margin for Claude telemetry compatibility |
91
+
92
+ ### Feature Toggles
93
+
94
+ | Option | Type | Default | Description |
95
+ |--------|------|---------|-------------|
96
+ | `noEmoji` | boolean | `false` | Force ASCII mode instead of Nerd Font symbols |
97
+ | `noGitStatus` | boolean | `false` | Disable git status indicators completely |
98
+ | `noContextWindow` | boolean | `false` | Disable context window usage display |
99
+ | `envContext` | boolean | `false` | Show Node.js, Python, Docker versions |
100
+ | `truncate` | boolean | `false` | Enable smart truncation for long statuslines |
101
+ | `debugWidth` | boolean | `false` | Show terminal width detection debug info |
102
+
103
+ ### Advanced Settings
104
+
105
+ | Option | Type | Default | Description |
106
+ |--------|------|---------|-------------|
107
+ | `forceWidth` | number | `null` | Override terminal width detection (testing only) |
108
+ | `noSoftWrap` | boolean | `false` | Disable soft-wrapping completely |
109
+ | `softWrap` | boolean | `false` | Legacy soft-wrapping (not needed with `truncate: true`) |
110
+
111
+ ### Symbol Customization
112
+
113
+ #### Nerd Font Symbols (Default)
114
+ ```json
115
+ "symbols": {
116
+ "git": "", // Git icon
117
+ "model": "󰚩", // AI model icon
118
+ "contextWindow": "⚡︎", // Context window usage
119
+ "staged": "+", // Staged changes
120
+ "conflict": "×", // Merge conflicts
121
+ "stashed": "⚑", // Stashed changes
122
+ "ahead": "⇡", // Ahead of upstream
123
+ "behind": "⇣", // Behind upstream
124
+ "diverged": "⇕", // Both ahead and behind
125
+ "renamed": "»", // Renamed files
126
+ "deleted": "✘" // Deleted files
127
+ }
128
+ ```
129
+
130
+ #### ASCII Symbols (when `noEmoji: true`)
131
+ ```json
132
+ "asciiSymbols": {
133
+ "git": "@", // Git icon
134
+ "model": "*", // AI model icon
135
+ "contextWindow": "#", // Context window usage
136
+ "staged": "+", // Staged changes
137
+ "conflict": "C", // Merge conflicts
138
+ "stashed": "$", // Stashed changes
139
+ "ahead": "A", // Ahead of upstream
140
+ "behind": "B", // Behind upstream
141
+ "diverged": "D", // Both ahead and behind
142
+ "renamed": ">", // Renamed files
143
+ "deleted": "X" // Deleted files
144
+ }
145
+ ```
146
+
147
+ ## Complete Example Configuration
148
+
149
+ ### JSON Format
150
+ ```json
151
+ {
152
+ "$schema": "https://raw.githubusercontent.com/shrwnsan/claude-statusline/main/config-schema.json",
153
+ "cacheTTL": 300,
154
+ "maxLength": 1000,
155
+ "noEmoji": false,
156
+ "noGitStatus": false,
157
+ "envContext": true,
158
+ "truncate": true,
159
+ "softWrap": false,
160
+ "rightMargin": 15,
161
+ "debugWidth": false,
162
+ "symbols": {
163
+ "git": "@",
164
+ "model": "*",
165
+ "staged": "+",
166
+ "conflict": "×",
167
+ "stashed": "⚑",
168
+ "ahead": "↑",
169
+ "behind": "↓",
170
+ "diverged": "⇕",
171
+ "renamed": "»",
172
+ "deleted": "✘"
173
+ }
174
+ }
175
+ ```
176
+
177
+ ### YAML Format (more minimal syntax)
178
+ ```yaml
179
+ cacheTTL: 300
180
+ maxLength: 1000
181
+ noEmoji: false
182
+ noGitStatus: false
183
+ envContext: true
184
+ truncate: true
185
+ softWrap: false
186
+ rightMargin: 15
187
+ debugWidth: false
188
+ symbols:
189
+ git: "@"
190
+ model: "*"
191
+ staged: "+"
192
+ conflict: "×"
193
+ stashed: "⚑"
194
+ ahead: "↑"
195
+ behind: "↓"
196
+ diverged: "⇕"
197
+ renamed: "»"
198
+ deleted: "✘"
199
+ ```
200
+
201
+ > **Note**: The `$schema` property in JSON provides VS Code/other editors with autocompletion and validation. It's JSON-specific and not used in YAML files.
202
+
203
+ ## Environment Variables (Legacy Support)
204
+
205
+ Environment variables are still supported for backward compatibility. These work in both bash v1.0 and TypeScript v2.0:
206
+
207
+ ### Bash v1.0 & TypeScript v2.0 (Legacy)
208
+ - `CLAUDE_CODE_STATUSLINE_NO_EMOJI=1` - Force ASCII mode
209
+ - `CLAUDE_CODE_STATUSLINE_NO_GITSTATUS=1` - Disable git indicators
210
+ - `CLAUDE_CODE_STATUSLINE_ENV_CONTEXT=1` - Show Node.js, Python, Docker versions
211
+ - `CLAUDE_CODE_STATUSLINE_TRUNCATE=1` - Enable smart truncation
212
+
213
+ ### TypeScript v2.0 Only (New Features)
214
+ - `CLAUDE_CODE_STATUSLINE_NO_SOFT_WRAP=1` - Disable soft-wrapping
215
+ - `CLAUDE_CODE_STATUSLINE_DEBUG_WIDTH=1` - Enable width debugging
216
+ - `CLAUDE_CODE_STATUSLINE_NO_CONTEXT_WINDOW=1` - Disable context window usage display
217
+
218
+ > **Note**: Environment variables are considered legacy. Configuration files are recommended for better organization and more options.
219
+
220
+ ## Popular Configurations
221
+
222
+ ### Minimal Setup (Quick Start)
223
+ ```json
224
+ {
225
+ "envContext": true,
226
+ "truncate": true
227
+ }
228
+ ```
229
+
230
+ ### Developer Setup
231
+ ```json
232
+ {
233
+ "envContext": true,
234
+ "truncate": true,
235
+ "noEmoji": false,
236
+ "debugWidth": false
237
+ }
238
+ ```
239
+
240
+ ### ASCII-Only Setup
241
+ ```json
242
+ {
243
+ "noEmoji": true,
244
+ "envContext": true,
245
+ "truncate": true,
246
+ "symbols": {
247
+ "git": "@",
248
+ "model": "*",
249
+ "staged": "+",
250
+ "conflict": "C",
251
+ "stashed": "$",
252
+ "ahead": "A",
253
+ "behind": "B",
254
+ "diverged": "D",
255
+ "renamed": ">",
256
+ "deleted": "X"
257
+ }
258
+ }
259
+ ```
260
+
261
+ ### Performance-Optimized Setup
262
+ ```json
263
+ {
264
+ "cacheTTL": 600,
265
+ "noGitStatus": false,
266
+ "envContext": false,
267
+ "truncate": true
268
+ }
269
+ ```
270
+
271
+ ## File Formats Supported
272
+
273
+ - `.claude-statusline.json` - JSON format (recommended for editor support)
274
+ - `.claude-statusline.yaml` - YAML format (more minimal syntax)
275
+ - `.claude-statusline.yml` - YAML format (deprecated, use `.yaml` instead)
276
+
277
+ Both formats support exactly the same configuration options.
@@ -0,0 +1,416 @@
1
+ # Troubleshooting Guide
2
+
3
+ This document provides comprehensive troubleshooting guidance for Claude Statusline.
4
+
5
+ ## Quick Diagnostics
6
+
7
+ ### Basic Health Check
8
+
9
+ ```bash
10
+ # Check if script is executable
11
+ ls -la /path/to/claude-statusline
12
+
13
+ # Test script syntax
14
+ bash -n /path/to/claude-statusline
15
+
16
+ # Test basic functionality
17
+ echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline
18
+ ```
19
+
20
+ ### Claude Code Integration Check
21
+
22
+ ```bash
23
+ # Check settings.json configuration
24
+ cat ~/.claude/settings.json | grep -A 5 statusLine
25
+
26
+ # Test with Claude Code input format
27
+ echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test Model"}}' | /path/to/claude-statusline
28
+
29
+ # Check if symlink exists and is valid
30
+ ls -la ~/.claude/statusline.sh
31
+ readlink ~/.claude/statusline.sh
32
+ ```
33
+
34
+ ## Common Issues and Solutions
35
+
36
+ ### Issue: Statusline Not Appearing
37
+
38
+ **Symptoms**: Claude Code shows default statusline or no statusline
39
+
40
+ **Diagnostic Steps**:
41
+ ```bash
42
+ # 1. Check settings.json configuration
43
+ grep -A 5 statusLine ~/.claude/settings.json
44
+
45
+ # 2. Verify script path is correct
46
+ ls -la /path/to/claude-statusline
47
+
48
+ # 3. Test script manually
49
+ echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline
50
+
51
+ # 4. Check script permissions
52
+ chmod +x /path/to/claude-statusline
53
+ ```
54
+
55
+ **Solutions**:
56
+ 1. **Update path in settings.json**:
57
+ ```json
58
+ {
59
+ "statusLine": {
60
+ "type": "command",
61
+ "command": "/correct/path/to/claude-statusline",
62
+ "padding": 0
63
+ }
64
+ }
65
+ ```
66
+
67
+ 2. **Create/update symlink**:
68
+ ```bash
69
+ ln -sf /path/to/claude-statusline ~/.claude/statusline.sh
70
+ ```
71
+
72
+ 3. **Restart Claude Code** after making changes
73
+
74
+ ### Issue: Nerd Font Symbols Not Displaying
75
+
76
+ **Symptoms**: Square boxes, question marks, or missing symbols
77
+
78
+ **Diagnostic Steps**:
79
+ ```bash
80
+ # Test terminal font support
81
+ echo " 󰚩 ⚑ ✘ ⇡ ⇣"
82
+
83
+ # Check if Nerd Fonts are installed
84
+ fc-list | grep -i nerd
85
+
86
+ # Test with ASCII mode
87
+ CLAUDE_CODE_STATUSLINE_NO_EMOJI=1 echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline
88
+ ```
89
+
90
+ **Solutions**:
91
+ 1. **Install Nerd Fonts**:
92
+ ```bash
93
+ # Using Homebrew (macOS)
94
+ brew install font-jetbrains-mono-nerd-font
95
+
96
+ # Or download from https://www.nerdfonts.com/
97
+ ```
98
+
99
+ 2. **Configure Terminal Font**:
100
+ - Terminal/iTerm2: Preferences → Profiles → Text → Font
101
+ - VS Code: Settings → `terminal.integrated.fontFamily`
102
+ - Alacritty: Edit `alacritty.yml` `font.family`
103
+
104
+ 3. **Force ASCII Mode**:
105
+ ```bash
106
+ export CLAUDE_CODE_STATUSLINE_NO_EMOJI=1
107
+ ```
108
+
109
+ ### Issue: Performance Problems
110
+
111
+ **Symptoms**: Laggy updates, slow response, high CPU usage
112
+
113
+ **Diagnostic Steps**:
114
+ ```bash
115
+ # Measure execution time
116
+ start=$(($(date +%s%N)/1000000))
117
+ echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline > /dev/null
118
+ end=$(($(date +%s%N)/1000000))
119
+ duration=$((end - start))
120
+ echo "Execution time: ${duration}ms"
121
+
122
+ # Check cache directory
123
+ ls -la /tmp/.claude-statusline-cache/
124
+
125
+ # Test with minimal features
126
+ CLAUDE_CODE_STATUSLINE_NO_GITSTATUS=1 CLAUDE_CODE_STATUSLINE_NO_EMOJI=1 \
127
+ echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline
128
+ ```
129
+
130
+ **Solutions**:
131
+ 1. **Clear Cache**:
132
+ ```bash
133
+ rm -rf /tmp/.claude-statusline-cache/
134
+ ```
135
+
136
+ 2. **Disable Features**:
137
+ ```bash
138
+ export CLAUDE_CODE_STATUSLINE_NO_GITSTATUS=1
139
+ export CLAUDE_CODE_STATUSLINE_NO_EMOJI=1
140
+ ```
141
+
142
+ 3. **Check Git Repository Status**:
143
+ ```bash
144
+ # Test git operations in current directory
145
+ git status --porcelain
146
+ git rev-list --count --left-right @{upstream}...HEAD
147
+ ```
148
+
149
+ ### Issue: Git Status Not Showing
150
+
151
+ **Symptoms**: No git indicators despite being in a git repository
152
+
153
+ **Diagnostic Steps**:
154
+ ```bash
155
+ # Check if in git repository
156
+ git status
157
+
158
+ # Test git commands manually
159
+ git branch --show-current
160
+ git status --porcelain
161
+
162
+ # Check if git status disabled
163
+ echo $CLAUDE_CODE_STATUSLINE_NO_GITSTATUS
164
+ ```
165
+
166
+ **Solutions**:
167
+ 1. **Enable git status**:
168
+ ```bash
169
+ unset CLAUDE_CODE_STATUSLINE_NO_GITSTATUS
170
+ ```
171
+
172
+ 2. **Check git repository**:
173
+ ```bash
174
+ # Ensure you're in a git repository
175
+ cd /path/to/git/repo
176
+ git status
177
+ ```
178
+
179
+ 3. **Check git configuration**:
180
+ ```bash
181
+ # Check if git is properly configured
182
+ git config --list
183
+ ```
184
+
185
+ ### Issue: Environment Context Not Showing
186
+
187
+ **Symptoms**: Node.js, Python, or Docker versions not displayed despite enabling
188
+
189
+ **Diagnostic Steps**:
190
+ ```bash
191
+ # Check if tools are available
192
+ command -v node && node --version
193
+ command -v python3 && python3 --version
194
+ command -v docker && docker --version
195
+
196
+ # Check cache files
197
+ ls -la /tmp/.claude-statusline-cache/*_version
198
+
199
+ # Test environment context explicitly
200
+ CLAUDE_CODE_STATUSLINE_ENV_CONTEXT=1 \
201
+ echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline
202
+ ```
203
+
204
+ **Solutions**:
205
+ 1. **Install Missing Tools**:
206
+ ```bash
207
+ # Install Node.js
208
+ curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
209
+ sudo apt-get install -y nodejs
210
+
211
+ # Install Python
212
+ sudo apt-get install python3
213
+
214
+ # Install Docker
215
+ curl -fsSL https://get.docker.com -o get-docker.sh
216
+ sudo sh get-docker.sh
217
+ ```
218
+
219
+ 2. **Clear Tool Cache**:
220
+ ```bash
221
+ rm -f /tmp/.claude-statusline-cache/*_version
222
+ rm -f /tmp/.claude-statusline-cache/*_version.time
223
+ ```
224
+
225
+ 3. **Enable Environment Context**:
226
+ ```bash
227
+ export CLAUDE_CODE_STATUSLINE_ENV_CONTEXT=1
228
+ ```
229
+
230
+ ### Issue: Width Management Problems
231
+
232
+ **Symptoms**: Text cutoff, improper wrapping, or overflow
233
+
234
+ **Diagnostic Steps**:
235
+ ```bash
236
+ # Check terminal width
237
+ tput cols
238
+ echo $COLUMNS
239
+
240
+ # Test with width override
241
+ export COLUMNS=80
242
+ echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline
243
+
244
+ # Test with smart truncation enabled
245
+ CLAUDE_CODE_STATUSLINE_TRUNCATE=1 \
246
+ echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Sonnet 4.5"}}' | /path/to/claude-statusline
247
+ ```
248
+
249
+ **Solutions**:
250
+ 1. **Adjust Terminal Width**:
251
+ - Increase terminal width to 80+ characters for optimal experience
252
+ - Use 100+ characters for full feature display
253
+
254
+ 2. **Enable Smart Truncation**:
255
+ ```bash
256
+ export CLAUDE_CODE_STATUSLINE_TRUNCATE=1
257
+ ```
258
+
259
+ 3. **Check Terminal Settings**:
260
+ - Ensure terminal reports correct dimensions
261
+ - Check for custom terminal configurations
262
+
263
+ ## Debug Mode
264
+
265
+ ### Enabling Debug Logging
266
+
267
+ **TypeScript v2.0 (Node.js/Bun)**:
268
+ ```bash
269
+ # Enable debug logging
270
+ DEBUG=claude-statusline:* claude-statusline
271
+
272
+ # Or with verbose flag
273
+ claude-statusline --verbose
274
+ ```
275
+
276
+ **Bash v1.0 (Legacy)**:
277
+ For debugging statusline behavior, use bash built-in debugging:
278
+ ```bash
279
+ # Enable execution tracing for one run
280
+ bash -x /path/to/claude-statusline <<< '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}'
281
+
282
+ # Or enable for session
283
+ set -x; /path/to/claude-statusline <<< '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}'; set +x
284
+ ```
285
+
286
+ Use `bash -x` for execution tracing and `bash -n` for syntax validation.
287
+
288
+ **Note**: Previous versions supported `CLAUDE_STATUSLINE_LOG_LEVEL` environment variable, but this has been removed in favor of standard bash debugging tools.
289
+
290
+ **Debugging Script Issues**:
291
+ ```bash
292
+ # Run with bash debugging
293
+ bash -x /path/to/claude-statusline
294
+
295
+ # Check for syntax errors
296
+ bash -n /path/to/claude-statusline
297
+ ```
298
+
299
+ ## Performance Profiling
300
+
301
+ ### Detailed Performance Analysis
302
+
303
+ ```bash
304
+ # Create performance test script
305
+ cat > test_performance.sh << 'EOF'
306
+ #!/bin/bash
307
+
308
+ iterations=10
309
+ total=0
310
+
311
+ echo "Testing performance over $iterations iterations..."
312
+
313
+ for i in $(seq 1 $iterations); do
314
+ start=$(($(date +%s%N)/1000000))
315
+ echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline > /dev/null
316
+ end=$(($(date +%s%N)/1000000))
317
+ duration=$((end - start))
318
+ total=$((total + duration))
319
+ echo "Iteration $i: ${duration}ms"
320
+ done
321
+
322
+ average=$((total / iterations))
323
+ echo "Average: ${average}ms"
324
+ echo "Min: $(echo $durations | tr ' ' '\n' | sort -n | head -1)ms"
325
+ echo "Max: $(echo $durations | tr ' ' '\n' | sort -n | tail -1)ms"
326
+
327
+ # Store durations for analysis
328
+ echo $durations > performance_data.txt
329
+ EOF
330
+
331
+ chmod +x test_performance.sh
332
+ ./test_performance.sh
333
+ ```
334
+
335
+ ### Cache Performance Testing
336
+
337
+ ```bash
338
+ # Test first run (cache miss)
339
+ rm -rf /tmp/.claude-statusline-cache/
340
+ echo "First run (cache miss):"
341
+ time echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline > /dev/null
342
+
343
+ # Test subsequent runs (cache hit)
344
+ echo "Subsequent runs (cache hit):"
345
+ for i in {1..5}; do
346
+ time echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline > /dev/null
347
+ done
348
+ ```
349
+
350
+ ## Getting Help
351
+
352
+ ### Collect Debug Information
353
+
354
+ ```bash
355
+ # Create debug report
356
+ cat > debug_report.txt << EOF
357
+ === Claude Statusline Debug Report ===
358
+ Date: $(date)
359
+ User: $(whoami)
360
+ System: $(uname -a)
361
+
362
+ === Script Information ===
363
+ Path: $(which claude-statusline 2>/dev/null || echo "Not found")
364
+ Version: $(claude-statusline --version 2>/dev/null || echo "Unknown")
365
+ Permissions: $(ls -la /path/to/claude-statusline)
366
+
367
+ === Environment ===
368
+ Shell: $SHELL
369
+ Terminal: $TERM
370
+ Claude Statusline Variables:
371
+ CLAUDE_CODE_STATUSLINE_NO_EMOJI: $CLAUDE_CODE_STATUSLINE_NO_EMOJI
372
+ CLAUDE_CODE_STATUSLINE_NO_GITSTATUS: $CLAUDE_CODE_STATUSLINE_NO_GITSTATUS
373
+ CLAUDE_CODE_STATUSLINE_ENV_CONTEXT: $CLAUDE_CODE_STATUSLINE_ENV_CONTEXT
374
+ CLAUDE_CODE_STATUSLINE_TRUNCATE: $CLAUDE_CODE_STATUSLINE_TRUNCATE
375
+ CLAUDE_STATUSLINE_LOG_LEVEL: $CLAUDE_STATUSLINE_LOG_LEVEL
376
+
377
+ === Git Status ===
378
+ Current Directory: $(pwd)
379
+ Git Repository: $(git rev-parse --git-dir 2>/dev/null || echo "Not a git repository")
380
+ Git Branch: $(git branch --show-current 2>/dev/null || echo "N/A")
381
+ Git Status: $(git status --porcelain 2>/dev/null | wc -l) changes
382
+
383
+ === Tool Availability ===
384
+ Node.js: $(command -v node >/dev/null && node --version || echo "Not found")
385
+ Python: $(command -v python3 >/dev/null && python3 --version || echo "Not found")
386
+ Docker: $(command -v docker >/dev/null && docker --version || echo "Not found")
387
+
388
+ === Cache Status ===
389
+ Cache Directory: /tmp/.claude-statusline-cache/
390
+ Cache Contents: $(ls -la /tmp/.claude-statusline-cache/ 2>/dev/null || echo "No cache directory")
391
+
392
+ === Test Run ===
393
+ Test Output:
394
+ $(echo '{"workspace":{"current_dir":"'"$PWD"'"},"model":{"display_name":"Test"}}' | /path/to/claude-statusline 2>&1)
395
+ EOF
396
+
397
+ echo "Debug report saved to debug_report.txt"
398
+ ```
399
+
400
+ ### Reporting Issues
401
+
402
+ When reporting issues, include:
403
+ 1. **Debug report** (from above)
404
+ 2. **Expected vs actual output**
405
+ 3. **Steps to reproduce**
406
+ 4. **Your environment** (OS, terminal, Claude Code version)
407
+
408
+ ### Community Support
409
+
410
+ - **GitHub Issues**: https://github.com/yourusername/claude-statusline/issues
411
+ - **Discussions**: https://github.com/yourusername/claude-statusline/discussions
412
+ - **Documentation**: https://github.com/yourusername/claude-statusline/blob/main/docs/README.md
413
+
414
+ ---
415
+
416
+ **Note**: This troubleshooting guide covers the most common issues. If you encounter problems not covered here, please create an issue on GitHub with your debug information.