cc-context-stats 1.15.0 → 1.16.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/README.md CHANGED
@@ -110,13 +110,17 @@ The CLI gives you the full session picture when the status line is not enough.
110
110
  | Model Intelligence | How quickly quality is degrading as context grows |
111
111
  | Zone distribution | Where the session spent most of its time |
112
112
  | Final context composition | How much of the final request was cache, reads, or new input |
113
- | Cache activity trend | When cache creation and cache reads changed over time |
113
+ | Cache activity trend | When cache creation and cache reads changed over time, with TTL countdown |
114
114
 
115
115
  | Status bar view | Context growth | Cumulative graph |
116
116
  |:---:|:---:|:---:|
117
117
  | ![Green statusline](images/1.10/statusline-green.png) | ![Delta graph](images/1.10/1.10-delta.png) | ![Cumulative graph](images/1.10/1.10-cumulative.png) |
118
118
 
119
- | MI view | Status bar warning state |
119
+ | Cumulative graph | Cache graph |
120
+ |:---:|:---:|
121
+ | ![Cumulative graph](images/1.10/1.10-cumulative.png) | ![Cache graph](images/1.16.0/1.16-cache.png) |
122
+
123
+ | MI view | Status bar warning state |
120
124
  |:---:|:---:|
121
125
  | ![Model Intelligence view](images/1.10/1.10.0-model-intelligence.png) | ![Yellow statusline](images/1.10/1.10-statusline.png) |
122
126
 
@@ -127,13 +131,14 @@ Each image shows a different slice of the same session:
127
131
  - `1.10-cumulative.png` shows overall context usage over time.
128
132
  - `1.10.0-model-intelligence.png` shows the MI view as context pressure rises.
129
133
  - `1.10-statusline.png` shows the warning state when the session is getting tight.
134
+ - `1.16-cache.png` shows cache creation and read tokens per request with a TTL countdown.
130
135
 
131
136
  ## Export Report
132
137
 
133
138
  Export a session when you want the timeline, charts, and summary in one Markdown file.
134
139
 
135
140
  ```bash
136
- context-stats export <session_id> --output report.md
141
+ context-stats <session_id> export --output report.md
137
142
  ```
138
143
 
139
144
  The report starts with the command that produced it, then folds the headline facts into an executive snapshot.
@@ -154,7 +159,7 @@ Example output:
154
159
 
155
160
  ## Generate
156
161
 
157
- context-stats export 8bb55603-45b8-4bdf-aa04-d51366610b1a --output report.md
162
+ context-stats 8bb55603-45b8-4bdf-aa04-d51366610b1a export --output report.md
158
163
 
159
164
  ## Executive Snapshot
160
165
  | Signal | Value | Why it matters |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-context-stats",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
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
  "bin": {
@@ -43,8 +43,5 @@
43
43
  ],
44
44
  "engines": {
45
45
  "node": ">=18"
46
- },
47
- "dependencies": {
48
- "cc-context-stats": "^1.15.0"
49
46
  }
50
47
  }
@@ -26,7 +26,7 @@
26
26
 
27
27
  # === CONFIGURATION ===
28
28
  # shellcheck disable=SC2034
29
- VERSION="1.11.1"
29
+ VERSION="1.16.0"
30
30
  COMMIT_HASH="dev" # Will be replaced during installation
31
31
  STATE_DIR=~/.claude/statusline
32
32
  CONFIG_FILE=~/.claude/statusline.conf
@@ -988,17 +988,35 @@ dispatch_python_subcommand() {
988
988
  local subcommand=$1
989
989
  shift
990
990
 
991
+ local py_cmd=""
991
992
  if command -v python3 >/dev/null 2>&1; then
992
- python3 -m claude_statusline.cli.context_stats "$subcommand" "$@"
993
- return $?
993
+ py_cmd="python3"
994
+ elif command -v python >/dev/null 2>&1; then
995
+ py_cmd="python"
996
+ else
997
+ error_exit "Python 3 is required for '$subcommand'."
994
998
  fi
995
999
 
996
- if command -v python >/dev/null 2>&1; then
997
- python -m claude_statusline.cli.context_stats "$subcommand" "$@"
998
- return $?
1000
+ # Check installed package is available and version matches this script
1001
+ local installed_version
1002
+ installed_version=$($py_cmd -c "import claude_statusline; print(claude_statusline.__version__)" 2>/dev/null || echo "")
1003
+
1004
+ if [ -z "$installed_version" ]; then
1005
+ echo -e "${RED}✗${RESET} Python package 'cc-context-stats' is not installed." >&2
1006
+ echo " Install it with: pip3 install cc-context-stats==$VERSION" >&2
1007
+ return 1
1008
+ fi
1009
+
1010
+ if [ "$installed_version" != "$VERSION" ]; then
1011
+ echo -e "${RED}✗${RESET} Python package version mismatch:" >&2
1012
+ echo " Script version: $VERSION" >&2
1013
+ echo " Package version: $installed_version" >&2
1014
+ echo " Run: pip3 install --upgrade cc-context-stats" >&2
1015
+ return 1
999
1016
  fi
1000
1017
 
1001
- error_exit "Python 3 is required for '$subcommand'."
1018
+ $py_cmd -m claude_statusline.cli.context_stats "$subcommand" "$@"
1019
+ return $?
1002
1020
  }
1003
1021
 
1004
1022
  # Render graphs once