Skip to content

v0.2.0 — context-loss recovery (/compact + /clear)

Latest

Choose a tag to compare

@justi justi released this 27 Apr 14:00
· 4 commits to main since this release
0379a3e

Headline

Refresh now fires immediately after the two moments an agent has just lost most of its working memory:

  • /compact (or AutoCompact) — wired via the PostCompact hook, dropping a signal file the next refresh consumes (#30).
  • /clear — sibling trigger via SessionStart with matcher: "clear", sharing the same signal file (#32).

These are the windows where re-injecting the brief gives the highest ROI. Cadence stays in place for everything else.

What install-hook wires now

Three event handlers in .claude/settings.json:

  • UserPromptSubmitrevive refresh (cadence-gated emit)
  • PostCompactrevive mark-compact (drops signal)
  • SessionStart matcher=clearrevive mark-clear (drops same signal)

Idempotent: re-running install-hook adds only what's missing. revive doctor validates all three (and verifies the SessionStart matcher specifically — codex caught a false-positive in review where matcher=startup pointing at mark-clear would have passed).

Also since v0.1.19

  • revive init now auto-fixes .gitignore so the documented ".revive/static.md is checked in" workflow actually works (#31). Handles .revive/, .revive/*, .*, and read-only .gitignore.
  • README tagline rewrite (#31): "Your agent forgot the ADR you wrote 30 prompts ago."

Install / upgrade

curl -sSL https://raw.githubusercontent.com/justi/context-revive/main/install.sh | bash
revive install-hook              # adds the new PostCompact + SessionStart entries
revive doctor                    # confirm all three hooks

Existing users: install-hook is idempotent — running it after the upgrade adds only the new entries without touching the existing UserPromptSubmit one. Per-project .revive/static.md and the rest of settings.json are untouched.

Test surface

139 bats tests, full CI on every PR (shellcheck + bats).