Five loop primitives ship in your harness. Retenta is the sixth.
Loop engineering means designing loops that prompt agents — scheduled, unattended, iterating. Five of the six primitives now ship inside Claude Code and Codex. The sixth — memory — is still a markdown file. A capsule is that memory, productized: writable, semantic, ordered, and neutral across every harness.
The agent forgets. The Capsule doesn't.
The six loop primitives
Why a capsule beats the markdown file
Markdown is honest — deterministic, ordered, diffable, legible at a glance. A capsule keeps those and adds what a file can't.
Semantic, not flat
Recall the relevant prior state by meaning — not by grepping a growing file that eventually blows the context window.
Ordered & deterministic
An ordered progress ledger — the “what's next” a markdown file is good at — read strongly-consistently, so a cold-started run sees its own last write immediately.
Neutral across harnesses
Reachable over MCP and REST from Claude Code and Codex alike. The memory isn't locked to the harness the loop happens to run in.
Durable & provable
Survives process kills, machines, and vendors. Citations back to sources; every read and write scoped to one capsule.
The loop, in four tools
recallLoad the whole spine in one call at the start of a run — open items + ordered progress + relevant memory.
log_progressAppend an ordered entry at every milestone — done · next · blocked.
rememberSave a synthesized finding; topic keeps one current note per subject (last-write-wins).
search / askQuery the knowledge itself, with citations back to sources.
The retenta-memory skill teaches an agent to use them in order — recall at the start, log_progress at each milestone, remember for findings, cite sources — so it triggers automatically on loop and scheduled tasks.
Install for your harness
Copy your capsule's MCP URL and a named access key from its Connect box (create a key per harness under “Keys for loops & automations” — a Claude Code loop and a Codex loop each hold their own, independently revocable).
Claude Code
Plugin bundles the connector + skill.
export RETENTA_MCP_URL="https://mcp.retenta.ai/c/<slug>/mcp" # from the Connect box export RETENTA_API_KEY="rk_live_…" # a named owner key /plugin marketplace add thecrownjoel/retenta /plugin install retenta-memory@retenta
Codex
Native remote MCP + the loop skill.
export RETENTA_KEY="rk_live_…" # a named owner key codex mcp add retenta \ --url https://mcp.retenta.ai/c/<slug>/mcp \ --bearer-token-env-var RETENTA_KEY mkdir -p ~/.agents/skills/retenta-memory # save the retenta-memory SKILL.md there, then use $retenta-memory
A nightly triage loop (any harness or cron)
The same tools over plain REST — recall the spine, do the work, log each step, remember the finding.
BASE="https://mcp.retenta.ai/c/<slug>"; KEY="rk_live_…"; RUN="$(date +%Y%m%d)"
auth(){ curl -s -H "Authorization: Bearer $KEY" -H "content-type: application/json" "$@"; }
# 1. load the whole spine at the start of the run
auth "$BASE/recall" -d '{"query":"nightly triage: what is open?"}'
# 2. …do the work…
# 3. record each milestone (idempotencyKey makes an at-least-once retry a safe no-op)
auth "$BASE/log_progress" -d '{"step":"triaged CI","status":"done","runId":"'$RUN'","idempotencyKey":"'$RUN'-triage"}'
auth "$BASE/log_progress" -d '{"step":"flaky test in the auth suite","status":"next","runId":"'$RUN'"}'
# 4. remember the synthesized finding (topic = one current note, last-write-wins)
auth "$BASE/remember" -d '{"text":"CI green; 1 flaky test remains","topic":"ci-status","runId":"'$RUN'"}'Want proof it survives a kill? scripts/loop-demo.mjs runs three cycles as separate processes and shows cycle 3 recalling cycles 1–2.
Give your loop a memory.
Build a capsule, connect it to your harness, and stop losing what the last run learned.