cc-context-stats 1.3.0 → 1.5.0
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/.claude/settings.local.json +33 -1
- package/.github/workflows/ci.yml +4 -2
- package/CHANGELOG.md +17 -0
- package/README.md +33 -11
- package/RELEASE_NOTES.md +9 -0
- package/assets/logo/favicon.svg +16 -0
- package/assets/logo/logo-black.svg +23 -0
- package/assets/logo/logo-full.svg +30 -0
- package/assets/logo/logo-icon.svg +26 -0
- package/assets/logo/logo-mark.svg +26 -0
- package/assets/logo/logo-white.svg +23 -0
- package/assets/logo/logo-wordmark.svg +7 -0
- package/install.sh +21 -2
- package/package.json +7 -3
- package/pyproject.toml +6 -4
- package/scripts/context-stats.sh +194 -26
- package/scripts/statusline-full.sh +57 -2
- package/scripts/statusline-git.sh +50 -1
- package/scripts/statusline-minimal.sh +50 -1
- package/scripts/statusline.js +50 -4
- package/scripts/statusline.py +44 -3
- package/src/claude_statusline/__init__.py +1 -1
- package/src/claude_statusline/cli/context_stats.py +106 -34
- package/src/claude_statusline/cli/statusline.py +5 -4
- package/src/claude_statusline/core/config.py +7 -0
- package/src/claude_statusline/formatters/layout.py +52 -0
- package/src/claude_statusline/graphs/renderer.py +44 -24
- package/src/claude_statusline/graphs/statistics.py +34 -0
- package/src/claude_statusline/ui/__init__.py +1 -0
- package/src/claude_statusline/ui/icons.py +93 -0
- package/src/claude_statusline/ui/waiting.py +62 -0
- package/tests/bash/test_statusline_full.bats +30 -0
- package/tests/node/statusline.test.js +44 -3
- package/tests/python/test_icons.py +152 -0
- package/tests/python/test_layout.py +110 -0
- package/tests/python/test_statusline.py +62 -3
- package/tests/python/test_waiting.py +127 -0
- package/PUBLISHING_GUIDE.md +0 -69
- package/npm-publish.sh +0 -33
- package/publish.sh +0 -24
- package/show_raw_claude_code_api.js +0 -11
|
@@ -79,7 +79,39 @@
|
|
|
79
79
|
"Skill(pre-commit)",
|
|
80
80
|
"Bash(npm run format:check:*)",
|
|
81
81
|
"Bash(bash:*)",
|
|
82
|
-
"Bash(git tag:*)"
|
|
82
|
+
"Bash(git tag:*)",
|
|
83
|
+
"Bash(git pull:*)",
|
|
84
|
+
"Bash(git rebase:*)",
|
|
85
|
+
"Bash(git stash:*)",
|
|
86
|
+
"Bash(npm whoami:*)",
|
|
87
|
+
"Bash(git filter-branch:*)",
|
|
88
|
+
"Bash(gh issue view:*)",
|
|
89
|
+
"Bash(head:*)",
|
|
90
|
+
"Bash(/Users/montimage/buildspace/luongnv89/cc-context-stats/.venv/bin/python -m pytest:*)",
|
|
91
|
+
"Bash(/Users/montimage/buildspace/luongnv89/cc-context-stats/.venv/bin/python3 -m pytest:*)",
|
|
92
|
+
"Bash(/Users/montimage/buildspace/luongnv89/cc-context-stats/.venv/bin/python3.14 -m pytest:*)",
|
|
93
|
+
"Bash(/Users/montimage/buildspace/luongnv89/cc-context-stats/venv/bin/python3 -m pytest:*)",
|
|
94
|
+
"Bash(/Users/montimage/buildspace/luongnv89/cc-context-stats/venv/bin/pip install:*)",
|
|
95
|
+
"Bash(.test_venv/bin/pip install:*)",
|
|
96
|
+
"Bash(.test_venv/bin/python3.14 -m pytest:*)",
|
|
97
|
+
"Bash(.venv/bin/pip install:*)",
|
|
98
|
+
"Bash(.venv/bin/python3.14 -m pytest:*)",
|
|
99
|
+
"Bash(.venv/bin/context-stats:*)",
|
|
100
|
+
"Bash(npx jest:*)",
|
|
101
|
+
"Bash(gh workflow:*)",
|
|
102
|
+
"Bash(git -C /Users/montimage/buildspace/luongnv89/cc-context-stats status)",
|
|
103
|
+
"Bash(git -C /Users/montimage/buildspace/luongnv89/cc-context-stats diff)",
|
|
104
|
+
"Bash(git -C /Users/montimage/buildspace/luongnv89/cc-context-stats log --oneline -5)",
|
|
105
|
+
"Bash(git -C /Users/montimage/buildspace/luongnv89/cc-context-stats add tests/python/test_statusline.py)",
|
|
106
|
+
"Bash(git -C /Users/montimage/buildspace/luongnv89/cc-context-stats commit -m \"$\\(cat <<''EOF''\nfix: resolve Windows CI failures caused by Unicode encoding in Python tests\n\nSet PYTHONUTF8=1 for subprocess calls and use explicit utf-8 encoding\nfor read_text\\(\\) to handle Unicode characters \\(emojis/icons\\) on Windows\nwhere the default cp1252 encoding cannot decode them.\nEOF\n\\)\")",
|
|
107
|
+
"Bash(git -C /Users/montimage/buildspace/luongnv89/cc-context-stats push)",
|
|
108
|
+
"Bash(COLUMNS=200 cat tests/fixtures/json/valid_full.json | scripts/statusline-full.sh 2>&1)",
|
|
109
|
+
"Bash(export COLUMNS=200 && cat tests/fixtures/json/valid_full.json | scripts/statusline-full.sh 2>&1)",
|
|
110
|
+
"Bash(gh release:*)",
|
|
111
|
+
"Read(//Users/montimage/.claude/**)",
|
|
112
|
+
"Bash(git checkout:*)",
|
|
113
|
+
"Bash(npm publish:*)",
|
|
114
|
+
"Bash(npm view:*)"
|
|
83
115
|
]
|
|
84
116
|
}
|
|
85
117
|
}
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -110,10 +110,12 @@ jobs:
|
|
|
110
110
|
cache-dependency-path: 'requirements-dev.txt'
|
|
111
111
|
|
|
112
112
|
- name: Install dependencies
|
|
113
|
-
run:
|
|
113
|
+
run: |
|
|
114
|
+
pip install -r requirements-dev.txt
|
|
115
|
+
pip install -e .
|
|
114
116
|
|
|
115
117
|
- name: Run pytest with coverage
|
|
116
|
-
run: pytest tests/python/ -v --cov=scripts --cov-report=xml --cov-report=term
|
|
118
|
+
run: pytest tests/python/ -v --cov=scripts --cov=src --cov-report=xml --cov-report=term
|
|
117
119
|
|
|
118
120
|
- name: Upload coverage to Codecov
|
|
119
121
|
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **NPM Package** - `cc-context-stats` now available on npm for JavaScript/Node.js environments
|
|
13
|
+
- Install via `npm install -g cc-context-stats` or `yarn global add cc-context-stats`
|
|
14
|
+
- Provides same functionality as Python package for Node.js users
|
|
15
|
+
- **Enhanced Documentation** - Updated README with npm installation instructions and badges
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Package Metadata** - Synchronized package descriptions across npm and PyPI for consistency
|
|
20
|
+
- **Keywords** - Aligned keywords across npm and Python packages for better discoverability
|
|
21
|
+
- **Installation Section** - Moved shell script installation to the top of README as the recommended method
|
|
22
|
+
- **Install Script Documentation** - Enhanced `install.sh` with comprehensive header documentation including:
|
|
23
|
+
- Features overview (real-time monitoring, live dashboard, zone detection)
|
|
24
|
+
- Requirements (curl, jq)
|
|
25
|
+
- Installation destinations and file descriptions
|
|
26
|
+
|
|
10
27
|
## [1.2.0] - 2025-01-08
|
|
11
28
|
|
|
12
29
|
### Added
|
package/README.md
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="assets/logo/logo-full.svg" alt="cc-context-stats" width="320"/>
|
|
3
|
+
|
|
4
|
+
<h3>Know your zone. Ship with confidence.</h3>
|
|
5
|
+
|
|
6
|
+
<p>Real-time context monitoring for Claude Code — so you always know when you're sharp and when to wrap up.</p>
|
|
2
7
|
|
|
3
8
|
[](https://pypi.org/project/cc-context-stats/)
|
|
4
|
-
[](https://www.npmjs.com/package/cc-context-stats)
|
|
10
|
+
[](https://pypi.org/project/cc-context-stats/)
|
|
11
|
+
[](https://www.npmjs.com/package/cc-context-stats)
|
|
5
12
|
[](https://opensource.org/licenses/MIT)
|
|
6
13
|
|
|
14
|
+
</div>
|
|
15
|
+
|
|
7
16
|
**Never run out of context unexpectedly** - monitor your session context in real-time.
|
|
8
17
|
|
|
9
18
|

|
|
@@ -27,6 +36,28 @@ When working with Claude Code on complex tasks, you can easily burn through your
|
|
|
27
36
|
|
|
28
37
|
## Installation
|
|
29
38
|
|
|
39
|
+
### Shell Script
|
|
40
|
+
|
|
41
|
+
For the quickest setup:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
curl -fsSL https://raw.githubusercontent.com/luongnv89/cc-context-stats/main/install.sh | bash
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### NPM
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install -g cc-context-stats
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Or with yarn:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
yarn global add cc-context-stats
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Python
|
|
60
|
+
|
|
30
61
|
```bash
|
|
31
62
|
pip install cc-context-stats
|
|
32
63
|
```
|
|
@@ -137,14 +168,6 @@ show_session=true # Show session ID
|
|
|
137
168
|
autocompact=true # Show autocompact buffer indicator
|
|
138
169
|
```
|
|
139
170
|
|
|
140
|
-
## Shell Script Installation
|
|
141
|
-
|
|
142
|
-
For users who prefer shell scripts:
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
curl -fsSL https://raw.githubusercontent.com/luongnv89/cc-context-stats/main/install.sh | bash
|
|
146
|
-
```
|
|
147
|
-
|
|
148
171
|
## How It Works
|
|
149
172
|
|
|
150
173
|
Context Stats hooks into Claude Code's state files to track token usage across your sessions. Data is stored locally in `~/.claude/statusline/` and never sent anywhere.
|
|
@@ -171,7 +194,6 @@ The `claude-statusline` command still works. The main change is `token-graph` is
|
|
|
171
194
|
## Related
|
|
172
195
|
|
|
173
196
|
- [Claude Code Documentation](https://docs.anthropic.com/en/docs/claude-code)
|
|
174
|
-
- [Dex Horthy on Context Windows](https://twitter.com/daborhty) - The "dumb zone" concept
|
|
175
197
|
- [Blog: Building this project](https://medium.com/@luongnv89/closing-the-gap-between-mvp-and-production-with-feature-dev-an-official-plugin-from-anthropic-444e2f00a0ad)
|
|
176
198
|
|
|
177
199
|
## License
|
package/RELEASE_NOTES.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
## What's Changed
|
|
2
|
+
|
|
3
|
+
### Refactoring
|
|
4
|
+
- **Remove icon and pacman display options from statusline** — Simplify the statusline by removing `icon_mode` config option (`standard`/`pacman`/`off`), activity icons, and pacman meter visualization. Activity tier detection and text labels are preserved for context-stats. Net removal of ~413 lines across 10 files (#13) @luongnv89
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
- **Eliminate watch mode flickering via double-buffered rendering** — Replace cursor-home + line-by-line overwrites with full-frame buffering that writes the entire screen in a single `sys.stdout.write()` call, eliminating visible flicker during watch mode refreshes
|
|
8
|
+
|
|
9
|
+
**Full Changelog**: https://github.com/luongnv89/cc-context-stats/compare/v1.4.0...v1.5.0
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16">
|
|
2
|
+
<!-- Favicon — ultra-minimal gauge -->
|
|
3
|
+
<rect width="16" height="16" rx="3" fill="#000000"/>
|
|
4
|
+
<!-- Gauge arc -->
|
|
5
|
+
<path d="M 2.5 12 A 6 6 0 1 1 13.5 12" stroke="#1a1a1a" stroke-width="1.8" fill="none" stroke-linecap="round"/>
|
|
6
|
+
<!-- Green segment -->
|
|
7
|
+
<path d="M 2.5 12 A 6 6 0 0 1 4.6 6.4" stroke="#22C55E" stroke-width="1.8" fill="none" stroke-linecap="round"/>
|
|
8
|
+
<!-- Yellow segment -->
|
|
9
|
+
<path d="M 4.6 6.4 A 6 6 0 0 1 11.4 6.4" stroke="#F59E0B" stroke-width="1.8" fill="none" stroke-linecap="round"/>
|
|
10
|
+
<!-- Red segment -->
|
|
11
|
+
<path d="M 11.4 6.4 A 6 6 0 0 1 13.5 12" stroke="#EF4444" stroke-width="1.8" fill="none" stroke-linecap="round"/>
|
|
12
|
+
<!-- Needle -->
|
|
13
|
+
<line x1="8" y1="8" x2="5.2" y2="5.2" stroke="#FFFFFF" stroke-width="1" stroke-linecap="round"/>
|
|
14
|
+
<!-- Pivot -->
|
|
15
|
+
<circle cx="8" cy="8" r="1" fill="#22C55E"/>
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 64" width="320" height="64">
|
|
2
|
+
<!-- Black version for light backgrounds -->
|
|
3
|
+
|
|
4
|
+
<!-- Gauge track arc (light gray) -->
|
|
5
|
+
<path d="M 12 50 A 22 22 0 1 1 52 50" stroke="#E5E7EB" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
6
|
+
<!-- Green zone -->
|
|
7
|
+
<path d="M 12 50 A 22 22 0 0 1 18.2 30.4" stroke="#16A34A" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
8
|
+
<!-- Yellow zone -->
|
|
9
|
+
<path d="M 18.2 30.4 A 22 22 0 0 1 45.8 30.4" stroke="#D97706" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
10
|
+
<!-- Red zone -->
|
|
11
|
+
<path d="M 45.8 30.4 A 22 22 0 0 1 52 50" stroke="#DC2626" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
12
|
+
<!-- Needle -->
|
|
13
|
+
<line x1="32" y1="38" x2="21" y2="27" stroke="#000000" stroke-width="2.5" stroke-linecap="round"/>
|
|
14
|
+
<!-- Pivot -->
|
|
15
|
+
<circle cx="32" cy="38" r="3" fill="#16A34A"/>
|
|
16
|
+
|
|
17
|
+
<!-- Divider -->
|
|
18
|
+
<line x1="68" y1="12" x2="68" y2="52" stroke="#D1D5DB" stroke-width="1"/>
|
|
19
|
+
|
|
20
|
+
<!-- Wordmark black -->
|
|
21
|
+
<text x="82" y="30" font-family="'SF Mono', 'Fira Mono', 'Courier New', monospace" font-size="18" font-weight="700" fill="#000000" letter-spacing="-0.5">cc-context</text>
|
|
22
|
+
<text x="82" y="50" font-family="'SF Mono', 'Fira Mono', 'Courier New', monospace" font-size="14" font-weight="500" fill="#16A34A" letter-spacing="2">stats</text>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 64" width="320" height="64">
|
|
2
|
+
<!-- Background -->
|
|
3
|
+
<rect width="320" height="64" rx="12" fill="#000000"/>
|
|
4
|
+
|
|
5
|
+
<!-- Mark: Gauge icon (left, inset) -->
|
|
6
|
+
<!-- Gauge track arc -->
|
|
7
|
+
<path d="M 12 50 A 22 22 0 1 1 52 50" stroke="#1a1a1a" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
8
|
+
<!-- Green zone -->
|
|
9
|
+
<path d="M 12 50 A 22 22 0 0 1 18.2 30.4" stroke="#22C55E" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
10
|
+
<!-- Yellow zone -->
|
|
11
|
+
<path d="M 18.2 30.4 A 22 22 0 0 1 45.8 30.4" stroke="#F59E0B" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
12
|
+
<!-- Red zone -->
|
|
13
|
+
<path d="M 45.8 30.4 A 22 22 0 0 1 52 50" stroke="#EF4444" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
14
|
+
<!-- Needle -->
|
|
15
|
+
<line x1="32" y1="38" x2="21" y2="27" stroke="#FFFFFF" stroke-width="2.5" stroke-linecap="round"/>
|
|
16
|
+
<!-- Pivot -->
|
|
17
|
+
<circle cx="32" cy="38" r="3" fill="#22C55E"/>
|
|
18
|
+
|
|
19
|
+
<!-- Divider line -->
|
|
20
|
+
<line x1="68" y1="12" x2="68" y2="52" stroke="#1f1f1f" stroke-width="1"/>
|
|
21
|
+
|
|
22
|
+
<!-- Wordmark: "cc-context" on top row, "stats" accent -->
|
|
23
|
+
<!-- Primary text -->
|
|
24
|
+
<text x="82" y="30" font-family="'SF Mono', 'Fira Mono', 'Courier New', monospace" font-size="18" font-weight="700" fill="#FFFFFF" letter-spacing="-0.5">cc-context</text>
|
|
25
|
+
<!-- Accent text with green highlight -->
|
|
26
|
+
<text x="82" y="50" font-family="'SF Mono', 'Fira Mono', 'Courier New', monospace" font-size="14" font-weight="500" fill="#22C55E" letter-spacing="2">stats</text>
|
|
27
|
+
|
|
28
|
+
<!-- Subtle border accent on right -->
|
|
29
|
+
<rect x="308" y="16" width="2" height="32" rx="1" fill="#22C55E" opacity="0.6"/>
|
|
30
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
|
2
|
+
<!-- App icon — square with padding and rounded corners -->
|
|
3
|
+
<rect width="512" height="512" rx="96" fill="#000000"/>
|
|
4
|
+
|
|
5
|
+
<!-- Gauge track (background) -->
|
|
6
|
+
<path d="M 96 352 A 176 176 0 1 1 416 352" stroke="#111111" stroke-width="38" fill="none" stroke-linecap="round"/>
|
|
7
|
+
|
|
8
|
+
<!-- Green zone (0-40%) -->
|
|
9
|
+
<path d="M 96 352 A 176 176 0 0 1 145.6 194.8" stroke="#22C55E" stroke-width="38" fill="none" stroke-linecap="round"/>
|
|
10
|
+
|
|
11
|
+
<!-- Yellow zone (40-80%) -->
|
|
12
|
+
<path d="M 145.6 194.8 A 176 176 0 0 1 366.4 194.8" stroke="#F59E0B" stroke-width="38" fill="none" stroke-linecap="round"/>
|
|
13
|
+
|
|
14
|
+
<!-- Red zone (80-100%) -->
|
|
15
|
+
<path d="M 366.4 194.8 A 176 176 0 0 1 416 352" stroke="#EF4444" stroke-width="38" fill="none" stroke-linecap="round"/>
|
|
16
|
+
|
|
17
|
+
<!-- Needle at ~55% -->
|
|
18
|
+
<line x1="256" y1="256" x2="168" y2="168" stroke="#FFFFFF" stroke-width="20" stroke-linecap="round"/>
|
|
19
|
+
|
|
20
|
+
<!-- Pivot dot -->
|
|
21
|
+
<circle cx="256" cy="256" r="24" fill="#22C55E"/>
|
|
22
|
+
|
|
23
|
+
<!-- Label dots at zone boundaries -->
|
|
24
|
+
<circle cx="96" cy="352" r="8" fill="#6B7280"/>
|
|
25
|
+
<circle cx="416" cy="352" r="8" fill="#6B7280"/>
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
|
|
2
|
+
<!-- Background square with rounded corners -->
|
|
3
|
+
<rect width="64" height="64" rx="12" fill="#000000"/>
|
|
4
|
+
|
|
5
|
+
<!-- Gauge track arc (background) -->
|
|
6
|
+
<path d="M 12 44 A 22 22 0 1 1 52 44" stroke="#1a1a1a" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
7
|
+
|
|
8
|
+
<!-- Gauge fill: green zone (0-40%) -->
|
|
9
|
+
<path d="M 12 44 A 22 22 0 0 1 18.2 24.4" stroke="#22C55E" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
10
|
+
|
|
11
|
+
<!-- Gauge fill: yellow zone (40-80%) -->
|
|
12
|
+
<path d="M 18.2 24.4 A 22 22 0 0 1 45.8 24.4" stroke="#F59E0B" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
13
|
+
|
|
14
|
+
<!-- Gauge fill: red zone (80-100%) -->
|
|
15
|
+
<path d="M 45.8 24.4 A 22 22 0 0 1 52 44" stroke="#EF4444" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
16
|
+
|
|
17
|
+
<!-- Needle at ~55% (in dumb zone) -->
|
|
18
|
+
<line x1="32" y1="32" x2="21" y2="21" stroke="#FFFFFF" stroke-width="2.5" stroke-linecap="round"/>
|
|
19
|
+
|
|
20
|
+
<!-- Needle pivot center dot -->
|
|
21
|
+
<circle cx="32" cy="32" r="3" fill="#22C55E"/>
|
|
22
|
+
|
|
23
|
+
<!-- Tick marks at zone boundaries -->
|
|
24
|
+
<line x1="12" y1="44" x2="14.5" y2="41.5" stroke="#6B7280" stroke-width="1.5" stroke-linecap="round"/>
|
|
25
|
+
<line x1="52" y1="44" x2="49.5" y2="41.5" stroke="#6B7280" stroke-width="1.5" stroke-linecap="round"/>
|
|
26
|
+
</svg>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 64" width="320" height="64">
|
|
2
|
+
<!-- White version for dark backgrounds — no bg rect -->
|
|
3
|
+
|
|
4
|
+
<!-- Gauge track arc (dim white) -->
|
|
5
|
+
<path d="M 12 50 A 22 22 0 1 1 52 50" stroke="rgba(255,255,255,0.15)" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
6
|
+
<!-- Green zone -->
|
|
7
|
+
<path d="M 12 50 A 22 22 0 0 1 18.2 30.4" stroke="#22C55E" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
8
|
+
<!-- Yellow zone -->
|
|
9
|
+
<path d="M 18.2 30.4 A 22 22 0 0 1 45.8 30.4" stroke="#F59E0B" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
10
|
+
<!-- Red zone -->
|
|
11
|
+
<path d="M 45.8 30.4 A 22 22 0 0 1 52 50" stroke="#EF4444" stroke-width="5" fill="none" stroke-linecap="round"/>
|
|
12
|
+
<!-- Needle -->
|
|
13
|
+
<line x1="32" y1="38" x2="21" y2="27" stroke="#FFFFFF" stroke-width="2.5" stroke-linecap="round"/>
|
|
14
|
+
<!-- Pivot -->
|
|
15
|
+
<circle cx="32" cy="38" r="3" fill="#22C55E"/>
|
|
16
|
+
|
|
17
|
+
<!-- Divider -->
|
|
18
|
+
<line x1="68" y1="12" x2="68" y2="52" stroke="rgba(255,255,255,0.2)" stroke-width="1"/>
|
|
19
|
+
|
|
20
|
+
<!-- Wordmark white -->
|
|
21
|
+
<text x="82" y="30" font-family="'SF Mono', 'Fira Mono', 'Courier New', monospace" font-size="18" font-weight="700" fill="#FFFFFF" letter-spacing="-0.5">cc-context</text>
|
|
22
|
+
<text x="82" y="50" font-family="'SF Mono', 'Fira Mono', 'Courier New', monospace" font-size="14" font-weight="500" fill="#22C55E" letter-spacing="2">stats</text>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 220 48" width="220" height="48">
|
|
2
|
+
<!-- Background transparent -->
|
|
3
|
+
<!-- Primary text -->
|
|
4
|
+
<text x="0" y="28" font-family="'SF Mono', 'Fira Mono', 'Courier New', monospace" font-size="22" font-weight="700" fill="#000000" letter-spacing="-0.5">cc-context</text>
|
|
5
|
+
<!-- Accent -->
|
|
6
|
+
<text x="0" y="44" font-family="'SF Mono', 'Fira Mono', 'Courier New', monospace" font-size="14" font-weight="500" fill="#22C55E" letter-spacing="2">stats</text>
|
|
7
|
+
</svg>
|
package/install.sh
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
#
|
|
3
|
-
# Claude Code
|
|
4
|
-
# Installs and configures
|
|
3
|
+
# Claude Code Context Stats Installer
|
|
4
|
+
# Installs and configures context monitoring for Claude Code
|
|
5
|
+
#
|
|
6
|
+
# Features:
|
|
7
|
+
# - Real-time context usage monitoring (status line integration)
|
|
8
|
+
# - Live dashboard with context-stats CLI tool
|
|
9
|
+
# - Automatic detection of Smart Zone, Dumb Zone, and Wrap Up Zone
|
|
10
|
+
# - Local data storage in ~/.claude/statusline/
|
|
5
11
|
#
|
|
6
12
|
# Usage:
|
|
7
13
|
# Local: ./install.sh
|
|
8
14
|
# Remote: curl -fsSL https://raw.githubusercontent.com/luongnv89/cc-context-stats/main/install.sh | bash
|
|
9
15
|
#
|
|
16
|
+
# Requirements:
|
|
17
|
+
# - curl (for remote installation)
|
|
18
|
+
# - jq (for JSON configuration, optional but recommended)
|
|
19
|
+
#
|
|
20
|
+
# What gets installed:
|
|
21
|
+
# - ~/.claude/statusline.sh - Status line command
|
|
22
|
+
# - ~/.local/bin/context-stats - CLI tool for live context monitoring
|
|
23
|
+
# - ~/.claude/statusline.conf - Configuration file
|
|
24
|
+
# - ~/.claude/settings.json - Claude Code settings updated
|
|
25
|
+
#
|
|
10
26
|
|
|
11
27
|
set -e
|
|
12
28
|
|
|
@@ -208,6 +224,9 @@ show_delta=true
|
|
|
208
224
|
|
|
209
225
|
# Show session_id in status line
|
|
210
226
|
show_session=true
|
|
227
|
+
|
|
228
|
+
# Disable rotating text animations
|
|
229
|
+
reduced_motion=false
|
|
211
230
|
EOF
|
|
212
231
|
echo -e "${GREEN}✓${RESET} Created config file: $CONFIG_FILE"
|
|
213
232
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-context-stats",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "Monitor your Claude Code session context in real-time - track token usage and never run out of context",
|
|
5
5
|
"main": "scripts/statusline.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest",
|
|
@@ -15,9 +15,13 @@
|
|
|
15
15
|
"keywords": [
|
|
16
16
|
"claude",
|
|
17
17
|
"claude-code",
|
|
18
|
+
"context",
|
|
19
|
+
"tokens",
|
|
20
|
+
"monitoring",
|
|
18
21
|
"statusline",
|
|
19
22
|
"terminal",
|
|
20
|
-
"cli"
|
|
23
|
+
"cli",
|
|
24
|
+
"dashboard"
|
|
21
25
|
],
|
|
22
26
|
"author": "luongnv89",
|
|
23
27
|
"license": "MIT",
|
package/pyproject.toml
CHANGED
|
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cc-context-stats"
|
|
7
|
-
version = "1.
|
|
8
|
-
description = "
|
|
7
|
+
version = "1.5.0"
|
|
8
|
+
description = "Monitor your Claude Code session context in real-time - track token usage and never run out of context"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
11
11
|
requires-python = ">=3.9"
|
|
@@ -15,11 +15,13 @@ authors = [
|
|
|
15
15
|
keywords = [
|
|
16
16
|
"claude",
|
|
17
17
|
"claude-code",
|
|
18
|
+
"context",
|
|
18
19
|
"tokens",
|
|
19
|
-
"context-window",
|
|
20
20
|
"monitoring",
|
|
21
|
-
"
|
|
21
|
+
"statusline",
|
|
22
|
+
"terminal",
|
|
22
23
|
"cli",
|
|
24
|
+
"dashboard",
|
|
23
25
|
]
|
|
24
26
|
classifiers = [
|
|
25
27
|
"Development Status :: 4 - Beta",
|