文件历史

7 次代码提交

作者 SHA1 备注 提交日期
jorgelaranjo 46817ecf1c fix(security): require opt-in for extra command
Require CLAUDE_HUD_ALLOW_EXTRA_CMD before executing --extra-cmd, tighten cache file permissions, and document the local command trust boundary. Maintainer follow-up removed generated dist artifacts from the PR and added extra opt-in parsing coverage. Verified locally with npm ci, npm test, and node --test tests/extra-cmd.test.js. Fixes #618.
2026-06-18 15:51:43 -04:00
Jarrod Watts 786a55bdb5 fix: stabilize context fallback and todo rendering (#579)
Fixes context fallback for streaming zero frames and guards todo rendering when content is missing.\n\nCloses #576.\nCloses #577.
2026-05-29 13:48:40 +10:00
梁康达 8e4364a1ec fix(context): keep live zero-percent usage data
Narrow suspicious zero-frame fallback so cached context is only restored when current usage is empty, and align tests with the stale-cache and reset edge cases this protects.
2026-04-30 10:58:17 +08:00
梁康达 13b803eb15 fix(context): treat nonzero token totals with zero usage as suspicious
Restore cached context when Claude reports used_percentage as 0 despite nonzero input/output totals, and add regression tests for the new suspicious-zero branches.
2026-04-29 16:47:00 +08:00
roryc bd82fdce7c fix(context): handle post-compact context reset
Use Claude Code compact_boundary transcript metadata to distinguish a real post-/compact zero frame from the suspicious-zero context glitch covered by the cache fallback. When compactMetadata.postTokens is available, synthesize the transition percent so the context bar drops immediately after compaction.

Security review found no new network, dependency, script, generated artifact, persistence, shell, env/token, path, link, or terminal escape risk. Added maintainer regression coverage for main() compact metadata wiring and repeated post-compact cache refresh.

Tested locally on the updated PR branch with npm test: 504 pass, 1 skipped. GitHub reported no checks for the fork branch.
2026-04-24 14:10:56 +10:00
Jarrod Watts 0a6ef27a99 fix: tighten context cache fallback trigger 2026-04-20 21:05:25 +10:00
梁康达 c39811d605 fix(context): add session-scoped cache fallback for zero-usage frames
Claude Code occasionally reports context window usage as 0 despite
accumulated tokens, causing the statusline to display incorrect data.
Cache the last known-good context snapshot per session and restore it
when a suspicious zero frame is detected, with TTL-throttled writes
and periodic stale-entry cleanup.
2026-04-20 21:05:25 +10:00