RAGit
CommandsMemory

memory wrap

Record a session summary into working memory

What It Does

memory wrap records the current session state into .ragit/memory/**. It writes a session wrap, refreshes the current working state, and updates the open-loops registry.

When To Use / When Not To Use

When to use it

  • You are stopping work and want tomorrow's restart point preserved.
  • You want the current goal, constraints, open loops, and next actions written into working memory.

When not to use it

Syntax

pnpm ragit memory wrap --input <path|-> \
  [--dry-run] [--format text|json|both] [--cwd <path>]

Arguments And Options

  • --input <path|->: Required JSON payload describing the session wrap.
  • --dry-run: Validate the wrap and show planned writes without changing files.
  • --format text|json|both: Choose text, JSON, or both.
  • --cwd <path>: Run against another repository.

Input And Output Contract

{
  "goal": "finish auth migration",
  "summary": "Refined refresh token boundaries and left one open loop.",
  "constraints": ["Do not break snapshot contracts."],
  "decisions": ["Keep refresh handling outside manifest mutation."],
  "openLoops": [
    {
      "id": "auth-refresh",
      "title": "Finish refresh token handling",
      "status": "open",
      "nextAction": "Update the adapter tests"
    }
  ],
  "nextActions": ["Update adapter tests", "Run pnpm test"],
  "promotionCandidates": [],
  "sourceHeadSha": "HEAD",
  "createdAt": "2026-03-08T10:00:00.000Z"
}
  • JSON output includes sessionId, sessionPath, currentPath, openLoopsPath, sourceHeadSha, and dryRun.
  • --dry-run validates payload shape and shows target files without writing them.

Examples

Human terminal flow:

pnpm ragit memory wrap --input session-wrap.json

Agent-oriented flow:

pnpm ragit memory wrap --input - --dry-run --format json

Failures And Cautions

  • The payload must match the wrap schema. Unexpected or malformed fields are rejected.
  • memory wrap does not ingest anything into searchable retrieval.
  • If HEAD is missing, wrap can still write state, but it will record the missing source reference accordingly.