Skip to content

v1.2.14

Choose a tag to compare

@github-actions github-actions released this 20 Aug 13:01
· 5 commits to main since this release
b30767b

Added

  • hooks.autocompactNudge — warn before autocompact silently drops raw context. New opt-in (default false) Stop hook hooks/mnemo-autocompact-nudge.sh blocks once per severity level as the session closes in on the point Claude Code compacts (warn ~50k / critical ~10k tokens remaining) and recommends /mn:review --full. The window follows Claude Code's own chain — env CLAUDE_CODE_AUTO_COMPACT_WINDOW, settings.autoCompactWindow, then its per-model ~/.claude.json cache read by the active model's key — validated to the [100k, 1M] range Claude Code accepts, then clamped to the model's context window, because a configured value is a ceiling request and not the threshold: a 460k setting on a 200k session never takes effect. With nothing configured the standard 200k window applies only where it is provable — when Claude Code's 1M-access cache shows the account has no large-context access — so a normal install gets a working nudge with no configuration, while a large-context account stays silent rather than be warned at 15% full (the transcript records the model id without its [1m] suffix, so the two are indistinguishable). Bands are measured from where compaction actually happens, W − min(max_output, 20k) − 13k; measured from W, critical would sit past a point the session can never reach. The anti-loop marker lowers when the level drops, so a second compaction in the same session still warns — a compaction changes neither session_id nor transcript path. Silent when autoCompactEnabled is false, when save and session have both already run (the same gate stopNudge uses, so the two hooks never nag together), and when usage exceeds the resolved window, which can only mean the window is wrong. Claude Code only — no-op on Codex. See docs/design-decisions.md, "Proactive nudges via hooks".

Fixed

  • Session scans read the session id Claude Code actually exports. session-scan.py looked for CLAUDE_SESSION_ID, which Claude Code never sets in a child process — it only expands that name as a ${...} placeholder inside skill text. Every model-invoked scan therefore fell through to the newest Codex rollout sharing the cwd and rendered it as the caller's own session, or, with no Codex installed, reported SESSION_ID: not available and left session and review working blind. It now reads CLAUDE_CODE_SESSION_ID first (CLAUDE_SESSION_ID stays a fallback), and prints a SOURCE: line whenever a scan does borrow an unattributed Codex rollout, so borrowed numbers can never pass for your own.
  • The prewarm cache is finally read back. The warm is keyed on (jsonl, session_id); because the hook seeded the legacy name and the model-invoked scan resolved a different one, the two keys diverged and the warmed entry was never hit — so TESTING.md's "first review is near-instant thanks to prewarm" was untrue on Claude Code. The hook now seeds the canonical name, and its run gate recognises a session carried only by the environment (hook stdin without session_id) instead of skipping the warm silently.
  • Cross-runtime recall detects Claude Code from the bash-tool environment. runtime-memory.py recognised only CLAUDE_SESSION_ID / CLAUDE_PLUGIN_ROOT, neither of which exists there, so an omitted runtime placeholder degraded quietly to zero hits. It now also accepts CLAUDE_CODE_SESSION_ID and CLAUDECODE. Related: CODEX_HOME no longer outranks a live Claude session — it only names a config directory, so exporting it no longer makes a Claude Code user look like a Codex one; live thread markers still win.