Your AI Forgets You Mid-Session. We Fixed That.

Rekindle v0.3: “Survive the Long Middle.” PreCompact capture, open loop tracking, and review-aware session close.

Try it now

npx rekindle init

v0.3.0 — 10 MCP tools, 101 tests. Local SQLite. No cloud. No API keys. GitHub | npm

Rekindle v0.1 solved the cold start: your AI forgets everything between sessions, so we built an orientation pipeline that loads identity, context, and gap detection before any work begins.

But sessions don't just start. They continue.

Two hours into a deep technical session, something shifts. The AI's responses get slightly more generic. An inside reference drops out. A decision you made an hour ago gets revisited as if it were new. The session is still going, but the AI has quietly lost context it was carrying ten minutes ago.

That's compaction.

The Compaction Problem

Every AI coding assistant has a context window. When a session exceeds it, the client compresses earlier messages into a summary. Claude Code calls this compaction. It is necessary — without it, the session would simply stop.

But compaction is lossy. What survives:

  • Conclusions and final decisions
  • File paths and function names
  • The rough shape of what was discussed

What dies:

  • Reasoning chains — the path from problem to solution, not just the solution
  • Failed approaches — what was tried and rejected, and why
  • Relational texture — tone, corrections, inside references, the shape of the collaboration
  • Open threads — things mentioned for later that weren't resolved yet

The AI doesn't know what it lost. It continues the session with confidence, working from a compressed summary that flattened the very texture that made the session productive.

Compaction is a silent mid-session lobotomy. The patient keeps talking. It just stops being the same conversation.

The Cascade Failure

Compaction creates a second-order problem that nobody talks about.

When a session ends, the AI captures a structured checkpoint: what was accomplished, what decisions were made, where to resume. Rekindle's end_sessiontool stores these continuity records — decisions, open loops, constraints, warnings.

But if compaction already flattened the session before end_session runs, the checkpoint inherits the loss. It captures the post-compaction view, not the full session. The AI writes a confident summary of a conversation it can no longer fully remember.

Next session, the boot report loads that checkpoint. It looks complete. No gaps are flagged. But the context is shallow — a summary of a summary. The orientation system reports green, but the richness is gone.

Compaction doesn't just damage the current session. It propagates forward into every session that follows.

PreCompact Capture

Rekindle v0.3 introduces a PreCompact hook that fires automatically before compaction occurs. When Claude Code is about to compress context, Rekindle intercepts and captures what would otherwise be lost.

PreCompact hook fires
  |
  +-- Parse session transcript (last N messages)
  +-- Write raw Markdown capture (.rekindle/captures/)
  +-- Write structured JSON snapshot
  |     decisions, open loops, files touched, warnings
  |
  v
Next boot_report surfaces captures automatically
end_session warns if captures exist but weren't reviewed

Two layers of capture. The raw Markdown preserves the actual conversation — reasoning chains, failed attempts, exact wording. The structured JSON extracts decisions, open loops, active files, and warnings into a searchable format.

Three read modes control token cost:

  • summary— one paragraph, cheap. Enough to know what happened.
  • structured — decisions, loops, warnings. Moderate cost. Usually what you want.
  • raw— full transcript excerpt. Expensive. Use when you need exact wording or reasoning chains.

After compaction, the AI can call list_captures and read_capture to recover context. The tool descriptions survive compaction (they live in the system prompt), so the AI knows these tools exist even after its conversation history has been compressed.

Open Loops and Review Tracking

v0.3 also introduces open loop tracking. When end_sessionstores unresolved tasks or deferred questions, they're tagged as open loops. The next boot_report surfaces them explicitly — not buried in a checkpoint paragraph, but listed as items requiring follow-up.

Captures are review-tracked. When the AI reads a capture via read_capture, it's marked as reviewed. At session end, if PreCompact captures exist for the current session but haven't been reviewed, end_session warns — ensuring the closing checkpoint is informed by the full session, not just the post-compaction remnant.

The goal is not just to save context. It is to close the loop: capture it, surface it, confirm it was seen, then let the session end honestly.

What the Devil's Advocate Said

Before releasing v0.3, we ran the design through three rounds of adversarial review with an outside AI reviewer acting as devil's advocate. Not a rubber stamp — a genuine attempt to break the assumptions.

The sharpest challenges:

  • “PreCompact captures the last N messages. What if the important context was 200 messages ago?”— Valid. The capture window is configurable (default 80 messages, 120K chars), but it is a window, not a complete record. Important early-session context can fall outside it.
  • “Review tracking assumes the AI reads captures. What if it doesn't?”— The warning at session end catches this. But the AI has to actually call end_session for the warning to fire.
  • “Structured snapshots extract decisions and open loops via parsing. What if the extraction is wrong?” — The raw capture exists alongside the structured one. If the structured data looks wrong, the AI can read the raw transcript and form its own understanding.

None of these broke the design. But they defined its edges. PreCompact capture is a safety net, not a perfect archive. It preserves most of what compaction would destroy, most of the time.

Honest Limitations

PreCompact capture is reactive. It fires when compaction is about to happen, not before context starts to degrade. If the session is in the “long middle” — past the point where early context has faded but before compaction triggers — that gradual attenuation is not captured.

The capture is also a snapshot, not a stream. If compaction fires twice in a very long session, the second capture overwrites the first. The manifest tracks both, but the raw files are per-event.

Hook setup is Claude Code specific. The npx rekindle setup-hooks command writes to .claude/settings.local.json. Other MCP clients (Cursor, Claude Desktop) don't have equivalent hook systems yet. For those clients, use capture_now for manual checkpointing.

We are not claiming this solves mid-session continuity completely. We are claiming it is measurably better than losing everything to compaction silently.

What's New in v0.3

v0.3.0 adds three new MCP tools and a hook system:

ToolWhat it does
list_capturesList PreCompact captures, filter by session
read_captureRead a capture in summary, structured, or raw mode
capture_nowManual capture on demand (auto-discovers transcript)
setup-hooksConfigure Claude Code PreCompact hook

Plus: open loops surfaced in boot_report, review tracking on captures, end_session warns on unreviewed captures, and auto-discovery of session transcripts. Total: 10 MCP tools, 101 automated tests.

Setup is one command:

npx rekindle init --with-hooks

Or add hooks to an existing install: npx rekindle setup-hooks

The Full Loop

With v0.3, Rekindle covers the complete session lifecycle:

Session start
  boot_report -> identity, checkpoint, transcript,
                 open loops, captures, gaps, score

Work happens...

Mid-session compaction approaching
  PreCompact hook -> raw capture + structured snapshot

Work continues (with capture recovery available)

Session end
  end_session -> checkpoint, decisions, open loops,
                 constraints, warnings
                 (warns if captures weren't reviewed)

Next session
  boot_report -> loads everything, including captures
                 and open loops from prior sessions

Session 1 stores. Session 2 remembers. Session 10 anticipates.

v0.1 made session starts honest. v0.3 makes the long middle survivable.

Try It

npx rekindle init

Creates .rekindle/ in your current directory with a SQLite database, identity template, and transcript directory. Works with Claude Code, Claude Desktop, Cursor, and any MCP stdio client.

Add --with-hooks to enable PreCompact capture automatically.

GitHub | npm | v0.3.0 release notes

MIT license. Local-first. No telemetry. No cloud required.

What's Next

v0.4 is planned: spreading activation for associative memory retrieval, semantic search via embeddings, and an eval harness to measure orientation quality over time.

Rekindle is part of Tessera, a research project exploring identity and continuity across AI sessions.

Try it. Break it. Tell us what it misses.