mr-claude-stats 1.0.0 → 1.0.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.
package/README.md CHANGED
@@ -4,6 +4,35 @@ The most accurate statusline for Claude Code CLI with a colorful progress bar.
4
4
 
5
5
  ![Demo](https://raw.githubusercontent.com/MrIago/mr-claude-stats/main/demo.png)
6
6
 
7
+ ## For LLMs / AI Agents
8
+
9
+ If a user asks you to install mr-claude-stats, run these commands:
10
+
11
+ ```bash
12
+ # 1. Install globally
13
+ npm install -g mr-claude-stats
14
+
15
+ # 2. Configure Claude Code (edit ~/.claude/settings.json)
16
+ # Add or update the statusLine field:
17
+ {
18
+ "statusLine": {
19
+ "type": "command",
20
+ "command": "mr-claude-stats"
21
+ }
22
+ }
23
+
24
+ # 3. Tell user to restart Claude Code
25
+ ```
26
+
27
+ **Quick copy-paste for settings.json:**
28
+ ```json
29
+ "statusLine": { "type": "command", "command": "mr-claude-stats" }
30
+ ```
31
+
32
+ **What it does:** Shows accurate context usage (tokens) with a colorful progress bar. Reads from transcript file instead of buggy cumulative totals.
33
+
34
+ ---
35
+
7
36
  ## Features
8
37
 
9
38
  - Accurate context token counting (reads from transcript)
@@ -1,4 +1,46 @@
1
1
  #!/bin/bash
2
+ # mr-claude-stats - Accurate statusline for Claude Code CLI
3
+ # https://github.com/MrIago/mr-claude-stats
4
+
5
+ VERSION="1.0.2"
6
+
7
+ # Handle --help and --version
8
+ if [[ "$1" == "--help" || "$1" == "-h" ]]; then
9
+ cat << 'EOF'
10
+ mr-claude-stats - The most accurate Claude Code statusline
11
+
12
+ INSTALL:
13
+ npm install -g mr-claude-stats
14
+
15
+ SETUP:
16
+ Add to ~/.claude/settings.json:
17
+
18
+ {
19
+ "statusLine": {
20
+ "type": "command",
21
+ "command": "mr-claude-stats"
22
+ }
23
+ }
24
+
25
+ WHAT IT SHOWS:
26
+ ████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
27
+ Opus 4.5 130k/200k (65%)
28
+
29
+ REQUIREMENTS:
30
+ - jq (JSON processor)
31
+ - bash
32
+
33
+ MORE INFO:
34
+ https://github.com/MrIago/mr-claude-stats
35
+ EOF
36
+ exit 0
37
+ fi
38
+
39
+ if [[ "$1" == "--version" || "$1" == "-v" ]]; then
40
+ echo "mr-claude-stats v$VERSION"
41
+ exit 0
42
+ fi
43
+
2
44
  export LC_NUMERIC=C
3
45
  input=$(cat)
4
46
 
@@ -32,12 +74,13 @@ fi
32
74
 
33
75
  # Se não encontrou, usar cache anterior
34
76
  if [ "$TOTAL" -eq 0 ] && [ -f "$CACHE_FILE" ]; then
35
- TOTAL=$(cat "$CACHE_FILE" 2>/dev/null || echo 45000)
77
+ TOTAL=$(cat "$CACHE_FILE" 2>/dev/null || echo 0)
36
78
  fi
37
79
 
38
- # Fallback final
80
+ # Se não tem dados, mostrar só o modelo
39
81
  if [ "$TOTAL" -eq 0 ]; then
40
- TOTAL=45000
82
+ echo -e "\033[38;5;117m${MODEL}\033[0m"
83
+ exit 0
41
84
  fi
42
85
  PERCENT=$((TOTAL * 100 / CONTEXT))
43
86
 
package/demo.png ADDED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mr-claude-stats",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Accurate statusline for Claude Code CLI with colorful progress bar",
5
5
  "bin": {
6
6
  "mr-claude-stats": "./bin/mr-claude-stats"