Skip to content

v0.4.0 — Claude compaction continuity

Choose a tag to compare

@phense phense released this 04 Sep 09:49
· 97 commits to main since this release

agentic-rag 0.4.0 — Claude compaction continuity

This release brings the session continuity shipped for Codex in 0.3.0 to
Claude Code, bound to Claude's own hook contract, on the same provider-neutral
PostgreSQL + pgvector checkpoint store.

Highlights

  • Six Claude lifecycle hooks from the default rag install: PreCompact
    delivers the versioned compact instructions through hook stdout,
    PostCompact stores Claude's compact_summary as a bounded, secret-stripped
    handoff on the checkpoint, SessionStart restores it with an age label, and
    SessionEnd queues the final transcript delta for every Claude reason.
  • A managed 1M/500K Claude policy: autoCompactWindow = 500000, a warning
    (never a rewrite) for models without the [1m] suffix, and warnings for
    overriding environment variables.
  • SessionStart output capped at Claude's 10,000-character hook limit, with
    the checkpoint shortened into the remaining budget before any section is
    dropped and every cut announced.
  • A previewable, recoverable Claude install: rag install --check, unique
    settings.json backups, a mode-0600 rollback record, and a target-aware
    rag install --restore.
  • Migration 008 (handoff, handoff_at) and checkpoint handoff: freshness
    in rag status.
  • Client detection is payload-driven; Codex behavior is unchanged. The Codex
    sources were checked to confirm PostCompact completes before
    SessionStart(source="compact") runs.

Upgrade

uv sync
uv run rag init-db
uv run rag install --check
uv run rag install

Then, in Claude Code, review the six handlers with /hooks, confirm
/autocompact shows 500000 tokens from settings, and verify with
uv run rag status. Codex users: start a fresh Codex session after
rag install --codex; Codex discovers handlers once per session.

Read What’s New in 0.4.0 for the complete tour.

Verification

  • 610 tests passed against PostgreSQL.
  • Wheel and sdist passed twine check.
  • Migration 008, the installer, and a manual /compact were exercised on a
    real macOS deployment; the two defects that smoke exposed were fixed before
    this release.