DEV Community

dtzp555-max
dtzp555-max

Posted on • Originally published at github.com

Memory Continuity: Zero-Dependency Session Persistence for AI Agents

The Problem

Every time your AI coding agent hits a session reset — timeout, context limit, gateway restart — it forgets everything. Your project context, decisions made, files touched, open questions... gone.

The Solution

Memory Continuity is a zero-dependency lifecycle plugin that preserves working state across session boundaries using plain markdown files. No SQLite. No vector DB. No external APIs.

It answers one question:

What were we doing, where did we stop, and what should happen next?

How It Works

6 lifecycle hooks capture state at critical moments:

  • before_agent_start — inject relevant history into new sessions
  • before_compaction — save state before context compression
  • before_reset — checkpoint before /clear
  • agent_end / session_end — persist everything at shutdown
  • subagent_ended — recover child agent results into parent

All data lives in a memory/ directory as plain .md files:

memory/
  CURRENT_STATE.md          # live working state
  sessions/2026-03-31.md    # daily session logs
  summaries/daily/          # auto-generated summaries
  summaries/weekly/         # weekly rollups
  tags.md                   # auto-extracted tag index
  cold/                     # decayed old archives
Enter fullscreen mode Exit fullscreen mode

Key Features

  • 14 slash commands/mc show, /mc search, /mc recall, /mc export, /mc subagents, and more
  • Smart recall — keyword-based relevance injection at session start
  • Tag extraction#tag patterns auto-indexed (CJK-aware with Unicode property escapes)
  • Memory decay — old archives auto-move to cold storage
  • Subagent support — parent→child state seeding + child→parent result recovery
  • Programmatic APImc:recall service for cross-plugin integration
  • 13 config keys — fully customizable with sensible defaults

Why Not Use a Database?

Memory Continuity DB-based plugins
Dependencies Zero SQLite, Chroma, APIs
Data format Plain markdown Proprietary
Backup cp / scp DB export
Migration Copy files Re-index
Transparency Human-readable Black box
contextEngine slot Not used Often required

Plain markdown means you can read, edit, grep, and git-track your memory files directly. No magic.

Compatibility

Memory Continuity deliberately avoids the contextEngine slot. It runs via lifecycle hooks only, so it coexists with lossless-claw (lossless context compression) without conflict.

Tested On

  • x86 cloud server (Oracle Cloud)
  • ARM (Raspberry Pi)
  • Apple Silicon (Mac)

Install

openclaw plugins install https://github.com/dtzp555-max/memory-continuity
Enter fullscreen mode Exit fullscreen mode

Links

Feedback and contributions welcome!

Top comments (0)