{
  "markdown": "<div align=\"center\">\n\n# Rekindle\n\n[![npm](https://img.shields.io/npm/v/rekindle)](https://www.npmjs.com/package/rekindle)\n[![tests](https://img.shields.io/badge/tests-148%20passing-brightgreen)](#tests)\n[![license](https://img.shields.io/badge/license-MIT-blue)](LICENSE)\n[![Glama score](https://glama.ai/mcp/servers/Skitchy/rekindle/badges/score.svg)](https://glama.ai/mcp/servers/Skitchy/rekindle)\n\n**For Claude Code users who lose time re-explaining project context every session.**\n\n```bash\nnpx rekindle init\n```\n\n*Your AI forgets everything between sessions. Rekindle fixes that.*\n\n</div>\n\n---\n\n![Rekindle init demo](docs/demo.gif)\n\nRekindle is an MCP continuity engine that solves **session orientation**, not just storage. Orient at session start, capture at session end, survive mid-session compaction. All local, all SQLite, zero API keys.\n\n**v0.3.3** — version-consistent MCP metadata and package documentation, on top of v0.3.2's one-command session-start delivery installer. [Release notes](https://github.com/Skitchy/rekindle/releases/tag/v0.3.3)\n\n## Quick Start\n\nRequires Node.js 20 or newer.\n\n```bash\nnpx rekindle init\n```\n\nThis creates `.rekindle/` in your project with a SQLite database, identity template, captures directory, and transcript directory. Then add the MCP server config for your client:\n\n<details open>\n<summary><strong>Claude Code</strong></summary>\n\nAdd to `~/.claude.json`:\n```json\n{\n  \"mcpServers\": {\n    \"rekindle\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"rekindle\"]\n    }\n  }\n}\n```\n\nEnable PreCompact protection (captures context before mid-session compaction):\n```bash\nnpx rekindle setup-hooks\n```\n\nEnable session-start orientation delivery — the budgeted orientation packet arrives automatically at startup, resume, `/clear`, and `/compact`, so the model re-orients at every context boundary without being asked:\n```bash\nnpx rekindle setup-delivery\n```\n\nBoth hooks are opt-in; plain `init` never installs either. `npx rekindle init --with-hooks --with-delivery` does everything in one line.\n</details>\n\n<details>\n<summary><strong>Claude Desktop</strong></summary>\n\nAdd to `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/`, Windows: `%APPDATA%\\Claude\\`):\n```json\n{\n  \"mcpServers\": {\n    \"rekindle\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"rekindle\"]\n    }\n  }\n}\n```\n</details>\n\n<details>\n<summary><strong>Cursor</strong></summary>\n\nAdd to `.cursor/mcp.json` in your project root:\n```json\n{\n  \"mcpServers\": {\n    \"rekindle\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"rekindle\"]\n    }\n  }\n}\n```\n</details>\n\nThen fill in `.rekindle/identity.md` and paste the boot instructions into your project's `CLAUDE.md`.\n\n> Session 1 stores. Session 2 remembers. Session 10 anticipates.\n\n---\n\n## The Problem (43 Sessions of Data)\n\nOver 43 sessions, we measured what an AI assistant failed to load at session start:\n\n| Metric | Value |\n|--------|-------|\n| Sessions analyzed | 43 |\n| Clean boots (all context loaded) | 33% |\n| High-signal failures (5+ gaps) | 26% |\n| Total retrieval failures | 173 |\n\nExisting memory tools (Mem0, Letta, Zep) optimize for retrieval accuracy: can the AI find what it stored? That's necessary but not sufficient. None of them address whether the AI loaded the *right* context for *this* session, or whether it can detect what it missed.\n\nRekindle solves session orientation: loading identity, recent context, memory health, and missing-context warnings before the assistant starts work.\n\nSee [docs/gap-analysis.md](docs/gap-analysis.md) for the full research dataset.\n\n---\n\n## What It Does\n\n### Boot: orient at session start\n\n`boot_report` runs an orientation pipeline before any work begins:\n\n```\nboot_report\n  +-- Read identity document (who am I working with?)\n  +-- Scan memory stats (what do I know?)\n  +-- Find latest checkpoint (where did we leave off?)\n  +-- Read last transcript (what actually happened?)\n  +-- Surface open loops (what needs follow-up?)\n  +-- Surface PreCompact captures (what survived compaction?)\n  +-- Detect gaps (what am I missing?)\n  +-- Calculate orientation score (how oriented am I?)\n  --> \"Carrying forward: [context loaded, gaps identified, score: 80/100]\"\n```\n\n### Survive the Long Middle: PreCompact capture (v0.3)\n\nMid-session compaction destroys reasoning chains, failed approaches, relational texture, and tone. The PreCompact hook fires automatically before compaction and saves what would otherwise be lost:\n\n```\nPreCompact hook fires\n  +-- Parse JSONL transcript (last N messages)\n  +-- Write raw Markdown capture (.rekindle/captures/)\n  +-- Write structured JSON snapshot (decisions, open loops, files)\n  +-- Update manifest for cheap listing\n  --> boot_report surfaces captures on next session start\n  --> end_session warns if captures exist but weren't reviewed\n```\n\nThree read modes control token cost:\n- **summary** — one paragraph, cheap\n- **structured** — decisions/loops/warnings, moderate\n- **raw** — full transcript excerpt, expensive (only when needed)\n\n### Capture: close the loop at session end\n\n`end_session` stores structured continuity records — not just a summary:\n\n| Field | What it captures |\n|-------|-----------------|\n| `checkpoint` | Where we left off (required) |\n| `decisions` | What was decided and why |\n| `open_loops` | Unresolved tasks or questions |\n| `constraints` | Boundaries that must not be violated |\n| `relational_delta` | What changed in the working relationship |\n| `next_session_focus` | Where to resume next session |\n| `preferences` | New user preferences learned |\n| `warnings` | Things next session should watch for |\n\nAll records stored with `type`, `source`, and `session_id` metadata. Next `boot_report` loads the checkpoint automatically.\n\n### Between sessions: search and manage\n\n| Tool | Description |\n|------|-------------|\n| `store_memory` | Store with content, category, importance (1-10), and project scope |\n| `search_memory` | Full-text search with BM25 ranking, boosted by importance |\n| `list_memories` | Browse memories, newest first. Filter by category or project |\n| `delete_memory` | Delete by ID |\n| `update_memory` | Update content, category, or importance |\n| `list_captures` | List PreCompact captures (optionally filter by session) |\n| `read_capture` | Read a capture in summary, structured, or raw mode |\n| `capture_now` | Manually capture current session context on demand |\n\n**Categories:** `preference` `lesson` `context` `relationship` `general`\n\n---\n\n## Why not just CLAUDE.md?\n\nA static file is passive. Your AI reads it, but it can't search it, rank it, track what's been retrieved, or tell you what's missing. Rekindle adds:\n\n- **Search** — full-text with importance-weighted ranking\n- **Structure** — category and project scoping across memories\n- **Orientation** — proactive context loading at boot, not just on-demand retrieval\n- **Gap detection** — flags missing identity, empty categories, stale data\n- **Scoring** — transparent checklist so you know *how oriented* the AI is\n- **Session capture** — structured close with checkpoints, decisions, and open loops\n- **Compaction survival** — PreCompact captures preserve what summaries flatten\n\n---\n\n## Release Highlights\n\n**v0.3.3**\n\n- **Version-consistent protocol metadata** — the MCP initialize response derives its version from the shipped package metadata, preventing release-version drift\n- **Package-page accuracy** — the README shipped to npm identifies the current release before the tag and package are created\n- **148 automated tests**, plus a packed-artifact check that compares MCP metadata to the installed package version\n\n**v0.3.2**\n\n- **One-command delivery install** — `npx rekindle setup-delivery` (or `init --with-delivery`) configures the SessionStart hook opt-in: idempotent, preserves other tools' hooks, refuses corrupted settings files\n- **147 automated tests**\n\n**v0.3.1 — \"Five Measured Gates\"**\n\n- **Session-start delivery** — `rekindle session-start` emits a budgeted orientation packet via the SessionStart hook at startup, resume, `/clear`, and `/compact`\n- **Budgeted packets, truthful receipts** — packets cap at 8,000 valid UTF-8 bytes with an in-packet truncation marker; receipts attest emission only and never claim model visibility\n- **Desktop-safe storage** — storage root never derives from the spawn point (Claude Desktop spawns MCP servers at `/`); explicit resolution order, fail-loud\n- **Dual-channel guidance** — workflow guidance rides both tool descriptions and MCP instructions, drift structurally impossible\n- **Cursor adapter** — `session-start --client cursor` with whitelist stdin parsing; email and workspace paths never reach receipts\n- **Measured, not assumed** — every claim above is backed by a published measurement ([evidence](docs/evidence-v0.3.1-measurements), [spike results](docs/compatibility-spike-results.md))\n\n**v0.3.0 — \"Survive the Long Middle\"** added the PreCompact capture system, open loops, and review tracking — [v0.3.0 release notes](https://github.com/Skitchy/rekindle/releases/tag/v0.3.0)\n\n---\n\n## CLI Commands\n\n| Command | Description |\n|---------|-------------|\n| `npx rekindle init` | Set up `.rekindle/` in current directory |\n| `npx rekindle init --global` | Set up in home directory |\n| `npx rekindle init --with-hooks` | Init + configure PreCompact capture hook |\n| `npx rekindle init --with-delivery` | Init + configure SessionStart delivery hook |\n| `npx rekindle setup-hooks` | Configure PreCompact capture hook (standalone) |\n| `npx rekindle setup-delivery` | Configure SessionStart delivery hook (standalone) |\n| `npx rekindle session-start` | Emit budgeted orientation packet (SessionStart hook) |\n| `npx rekindle session-start --client cursor` | Same, in Cursor's hook response shape |\n| `npx rekindle precompact-capture` | Capture context before compaction (hook) |\n| `npx rekindle capture-now` | Manually capture current session context |\n| `npx rekindle` | Start MCP server (used by Claude Code) |\n\n---\n\n## Install from Source\n\n```bash\ngit clone https://github.com/Skitchy/rekindle.git\ncd rekindle\nnpm install\nnpm run build\nnode dist/init/cli.js init\n```\n\n<details>\n<summary><strong>PreCompact Hook Configuration</strong></summary>\n\nThe `setup-hooks` command writes this to `.claude/settings.local.json`:\n\n```json\n{\n  \"hooks\": {\n    \"PreCompact\": [\n      {\n        \"matcher\": \"auto\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"npx rekindle precompact-capture\",\n            \"timeout\": 60\n          }\n        ]\n      },\n      {\n        \"matcher\": \"manual\",\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"npx rekindle precompact-capture\",\n            \"timeout\": 60\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nThe hook receives session context on stdin (session_id, transcript_path, cwd, hook_event_name) and writes captures to `.rekindle/captures/`.\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `REKINDLE_PRECOMPACT_MAX_MESSAGES` | `80` | Max messages to capture |\n| `REKINDLE_PRECOMPACT_MAX_CHARS` | `120000` | Max characters to capture |\n| `REKINDLE_BASE_DIR` | Resolved (see below) | Base directory for `.rekindle/` |\n\n**Storage root resolution.** All Rekindle entry points (server, PreCompact hook) resolve the directory holding `.rekindle/` through one rule, in order:\n\n1. `REKINDLE_BASE_DIR`, if set — explicit always wins\n2. Derived from `REKINDLE_DB_PATH`, when it points at a canonical `<base>/.rekindle/db/` layout\n3. An existing `.rekindle/` in the current working directory (never when cwd is the filesystem root)\n4. An existing `.rekindle/` in your home directory\n5. Otherwise: your home directory — never the spawn point\n\nRules 3 and 5 exist because some hosts (e.g. Claude Desktop) spawn MCP servers at `cwd=/`; a spawn point is not a storage location. If storage cannot be created, the server exits with a message naming the fix instead of a stack trace.\n\n</details>\n\n<details>\n<summary><strong>Privacy and Security</strong></summary>\n\n- **All data is local.** Nothing is sent to external servers.\n- **No network calls.** The MCP server communicates via stdio. No HTTP, no telemetry, no analytics.\n- **Transcripts contain conversation text.** Do not enable transcript capture if your sessions contain secrets or credentials.\n- **Hook installation is opt-in.** Both the capture hook (`setup-hooks`) and the delivery hook (`setup-delivery`) must be requested explicitly, by command or by flag. Plain `init` never installs either.\n- **SQLite database is a regular file.** Not encrypted. Use OS-level disk encryption if needed.\n- **`.rekindle/` is gitignored.** The init command handles this automatically.\n- **boot_report reads local files.** Paths are not sandboxed. Only use with MCP clients and prompts you trust.\n\n</details>\n\n## Compatibility\n\n\"Full delivery\" means the orientation packet arrives automatically at session boundaries and the model demonstrably sees it — measured with canary probes at both the receipt layer and the model layer, not assumed. Details and evidence: [compatibility spike results](docs/compatibility-spike-results.md).\n\n| Client surface | MCP tools | Session-start delivery |\n|--------|-----------|--------|\n| Claude Code terminal (macOS) | Tested | Full delivery, measured (startup, resume, `/clear`, `/compact`) |\n| Claude Code terminal (Windows) | Tested | Full delivery, measured |\n| Claude Code terminal (Linux/WSL2) | Tested | Hook channel identical; delivery measurement pending |\n| Claude Desktop, Code surface | Tested | Full delivery, measured (`/clear` re-delivers via new-session startup) |\n| Claude Desktop, chat surface | Tested | Tool-mode only: hooks unsupported by the client; guidance reachable via the model's tool-search |\n| Cursor | Tested | Via `.cursor/hooks.json`, measured (see below) |\n| Any MCP stdio client | Compatible | Depends on the client's hook support |\n\n### Claude Code: session-start orientation (opt-in)\n\n```bash\nnpx rekindle setup-delivery\n```\n\nwrites this to `.claude/settings.local.json`:\n\n```json\n{\n  \"hooks\": {\n    \"SessionStart\": [\n      {\n        \"matcher\": \"startup|resume|clear|compact\",\n        \"hooks\": [\n          { \"type\": \"command\", \"command\": \"npx rekindle session-start\", \"timeout\": 60 }\n        ]\n      }\n    ]\n  }\n}\n```\n\nThe packet is capped at 8,000 valid UTF-8 bytes — measured: when hook output exceeds the host's limit, the model sees only the leading portion, with no error surfaced. If sections are dropped to fit the budget, an in-packet marker says so, and the receipt in `.rekindle/receipts/session-start.jsonl` records exactly what was emitted without ever claiming the model saw it.\n\n### Cursor: session-start orientation (opt-in)\n\nCursor's hook system can deliver the budgeted orientation packet at session\nstart, measured working in the v0.3.1 compatibility spike. Setup is manual\nand opt-in — Rekindle never installs hooks without being asked. Add to\n`.cursor/hooks.json` in your project:\n\n```json\n{\n  \"version\": 1,\n  \"hooks\": {\n    \"sessionStart\": [ { \"command\": \"rekindle session-start --client cursor\" } ]\n  }\n}\n```\n\n**Privacy:** Cursor's hook payload includes your account email and workspace\npaths. The adapter treats that payload as personal by default: it extracts\nonly the session ID and workspace root (used in-process for storage\nresolution), and neither the raw payload, the email, nor any path is ever\nwritten to receipts or any other artifact. Background agents are bypassed by\ndefault (truthfully receipted); opt in with `REKINDLE_ORIENT_BACKGROUND_AGENTS=1`.\n\n<details>\n<summary><strong>Architecture</strong></summary>\n\n```\nrekindle/\n  src/\n    index.ts          MCP server entry point\n    server.ts         Server setup, tool registration (10 tools)\n    storage/\n      sqlite.ts       SQLite + FTS5, schema migration, sessions\n    orientation/\n      types.ts        OrientationResult, Gap, ScoreItem\n      GapDetector.ts  Structural gap detection (8 codes)\n      Scorer.ts       Orientation scoring (6 criteria, 100pts)\n      OrientationService.ts   Orchestrator\n      OrientationRenderer.ts  Markdown + JSON output\n    captures/\n      types.ts        CaptureEntry, StructuredSnapshot, HookInput\n      CaptureManager.ts   Parse, capture, list, read, review tracking\n      discover-transcript.ts  Auto-discover session transcripts\n      precompact-capture.ts   CLI hook entry point\n      capture-now.ts          Manual capture CLI\n    tools/\n      boot-report.ts  Orientation + open loops + capture awareness\n      end-session.ts  Structured session close + capture warning\n      list-captures.ts  List PreCompact captures\n      read-capture.ts   Read captures in 3 modes\n      capture-now.ts    Model-triggered manual capture\n      store.ts search.ts list.ts delete.ts update.ts\n    delivery/\n      budget.ts       8000-byte UTF-8 packet construction, truncation marker\n      receipts.ts     Emission receipts (never claim model visibility)\n      session-start.ts SessionStart hook adapter\n      cursor.ts       Cursor hook adapter (privacy-whitelisted stdin)\n      guidance.ts     Canonical workflow guidance, both channels\n    init/\n      cli.ts scaffold.ts setup-hooks.ts setup-delivery.ts templates/\n```\n\n**Storage:** SQLite + FTS5 via `better-sqlite3`. BM25 ranking boosted by importance. Typed records with `type`, `source`, `session_id`.\n\n**Transport:** stdio (standard MCP). Works with Claude Code out of the box.\n\n</details>\n\n## Tests\n\n```bash\nnpm test\n```\n\n148 tests: storage CRUD + FTS5 ranking, orientation domain (gap detection, scoring, service, rendering), capture manager (parsing, limits, review tracking, formatting), delivery (packet budget, receipts, guidance channels, Cursor privacy sentinels), hook setup for both hooks (schema, idempotency, corruption refusal), and MCP integration (all 10 tools plus package-derived server metadata).\n\n## Roadmap\n\n**v0.4: \"It thinks in networks\"** — Spreading activation, semantic search via embeddings, gap analysis tooling, eval harness.\n\n## License\n\nMIT\n",
  "bytes": 18034,
  "sha": "7788584877d3e4ff2b1385dbafaa4f4492e2a131aee9f08858913bd617c5d62f",
  "repo_slug": "skitchy/rekindle",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_skitchy_rekindle_f0b72efa/readme"
}