claude-simple-status 1.3.1 → 1.3.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/package.json +1 -1
- package/statusline.mjs +4 -3
package/package.json
CHANGED
package/statusline.mjs
CHANGED
|
@@ -46,7 +46,7 @@ const CACHE_STALE_AGE = 300; // seconds - when to show "--" instead of old value
|
|
|
46
46
|
const GIT_BRANCH_CACHE = join(tmpdir(), 'claude-statusline-branches.json');
|
|
47
47
|
const GIT_BRANCH_MAX_AGE = 30; // seconds
|
|
48
48
|
const CONTEXT_HISTORY_FILE = join(tmpdir(), 'claude-statusline-context.json');
|
|
49
|
-
const CONTEXT_COMPACT_THRESHOLD =
|
|
49
|
+
const CONTEXT_COMPACT_THRESHOLD = 83; // % at which autocompact typically fires
|
|
50
50
|
const CONTEXT_MAX_SAMPLES = 20; // rolling window of turn deltas
|
|
51
51
|
const QUOTA_HISTORY_FILE = join(tmpdir(), 'claude-statusline-quota-history.json');
|
|
52
52
|
const QUOTA_MAX_READINGS = 30; // ~1h of data at 120s refresh intervals
|
|
@@ -233,8 +233,9 @@ function getContextVelocity(projectDir, contextUsed) {
|
|
|
233
233
|
history[projectDir] = entry;
|
|
234
234
|
try { writeFileSync(CONTEXT_HISTORY_FILE, JSON.stringify(history)); } catch {}
|
|
235
235
|
|
|
236
|
-
// Need at least
|
|
237
|
-
|
|
236
|
+
// Need at least 5 turn deltas to estimate — fewer gives noisy results
|
|
237
|
+
// (especially right after compaction when early turns inflate context quickly)
|
|
238
|
+
if (entry.deltas.length < 5) return null;
|
|
238
239
|
|
|
239
240
|
// Weighted average: recent deltas matter more
|
|
240
241
|
let weightSum = 0;
|