Knowledge

Memory Bank Continuity

Give stateless agents a project spine.

Use when

Agent work spans multiple sessions, contributors, or tools and context keeps getting rebuilt from scratch.

difficultyBeginner
categoryKnowledge
sourceAdapted from public agentic-coding handbook patterns

Cadence

At the start and end of multi-session agent work

Verification

Project brief, active context, decisions, tech constraints, and progress are current enough for a fresh agent to continue safely.

Structured loop spec

FieldValue
NameMemory Bank Continuity
CategoryKnowledge
TriggerAt the start and end of multi-session agent work
ObjectiveGive stateless agents a project spine.
Allowed inputsRelevant files, source notes, logs, tests, screenshots, metrics, or task state for this loop
Allowed actionsAt session start, read the project brief, active context, tech constraints, system patterns, and progress files.; During work, record durable decisions, current blockers, changed commands, and important path references.; At session end, update active context and progress with what changed, what passed, what failed, and what comes next.; Do not store secrets, raw transcripts, or giant code dumps in memory files.; Verify a fresh-agent handoff can state goal, current state, commands, blockers, and next action.
VerificationProject brief, active context, decisions, tech constraints, and progress are current enough for a fresh agent to continue safely.
Stop conditionStop when the verifier passes, the budget is exhausted, no progress is made, a blocker appears, or approval is required.
BudgetSet a time, turn, token, retry, file, or dollar cap before running the loop.
Approval boundaryHuman approval required before public, destructive, financial, legal, account, or production-impacting actions.
Safe outputDraft, report, checklist, table, or approval-gated recommendation
Works withClaude, ChatGPT, Gemini, any tool-using AI assistant

Steps

  1. At session start, read the project brief, active context, tech constraints, system patterns, and progress files.
  2. During work, record durable decisions, current blockers, changed commands, and important path references.
  3. At session end, update active context and progress with what changed, what passed, what failed, and what comes next.
  4. Do not store secrets, raw transcripts, or giant code dumps in memory files.
  5. Verify a fresh-agent handoff can state goal, current state, commands, blockers, and next action.

Prompt

Run the Memory Bank Continuity loop. Read the repo's project brief, active context, tech constraints, system patterns, and progress files before work. During and after the session, update durable decisions, blockers, changed commands, important paths, verification evidence, and next action. Do not store secrets, raw transcripts, or giant code dumps. Verify the handoff lets a fresh agent continue without rereading the whole chat.

Run in Claude Code

Paste this into Claude Code (or any tool-using agent) to run the loop bounded: one change per round, the same verification every round, durable state files, and explicit stop conditions.

Run the "Memory Bank Continuity" loop from AI Loop Library (https://ailooplibrary.com/loops/memory-bank-continuity/) as a bounded loop.
Goal: Give stateless agents a project spine.
Rules: one change per round; run the same verification every round (Project brief, active context, decisions, tech constraints, and progress are current enough for a fresh agent to continue safely.); append each round to docs/loops/memory-bank-continuity/progress.md and update docs/loops/memory-bank-continuity/state.json; stop on verifier pass, 8 rounds, 3 consecutive failed verifications, no progress, a blocker, or anything needing human approval (money, production, outbound, deletion). Finish with a proof report: rounds used, changes made, verification output, remaining risk, and the next human decision.

Get the MCP server + agent pack

Tags

memory bankproject contextdocsagent continuity

Related loops

Browse all 68 loops