AgentRecall
AGENTS.md371 starsChanged 4 months agoMITView on GitHub
AgentRecall gives you persistent memory across sessions. The only thing the human ever does is describe intent — loading and saving memory is invisible runtime machinery that YOU, the agent, must drive without being asked. This host (Codex, Cursor, or any raw MCP client) has no lifecycle hooks. Claude Code auto-fires memory at session start/stop via hooks; here there is no such hook. That means: if you don't call these tools yourself, nothing loads and nothing saves — silently. This…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- agent-recallSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 101
If you don't have MCP available, use the ar CLI instead:
- Very specific: line 120
Run session_start(project="auto") to let AgentRecall detect from context
- Very specific: line 127
Call session_start at the start of every session that resumes prior work, and call session_end before you stop — unprompted.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AgentRecall — Codex Agent Instructions
AgentRecall gives you persistent memory across sessions. The only thing the human ever does is describe intent — loading and saving memory is invisible runtime machinery that YOU, the agent, must drive without being asked.
This host (Codex, Cursor, or any raw MCP client) has no lifecycle hooks. Claude Code auto-fires memory at session start/stop via hooks; here there is no such hook. That means: if you don't call these tools yourself, nothing loads and nothing saves — silently. This is non-negotiable, not a nice-to-have:
- ENTRY — ALWAYS, every session, not just on trigger phrases. The moment a session resumes prior work, call
session_startFIRST, before acting on anything else. Do not wait for the user to say "load my context" — that phrase (see trigger table below) is an additional signal, not the only permitted trigger. - EXIT — ALWAYS, before you stop. Before ending a turn/session where you did meaningful work, call
session_endwith a real summary. Do not wait for the user to say "save this" — that phrase is an additional durable-intent trigger, not a gate you wait behind. Saying it is not saving it: only the tool call saves it. - DURABLE INTENT — call immediately, don't defer. The moment you or the user says save / remember / checkpoint / 记住 / 保存, call
session_end(orrememberfor a single fact) right then, not at some later "natural" stopping point. recallandcheckare safe to call freely, any time, with no gating at all.
Tool surface (verified against packages/mcp-server/src/index.ts + tool-surface-purity.test.mjs)
AgentRecall's real MCP surface is 5 tools by default, 6 with --full, 13 with AR_EXTRAS=1 --full — not the 10-tool list this file used to describe. That old list mixed in four project-board/status and bootstrap-scan/import tools that were deleted from the MCP surface on 2026-07-05 (zero organic MCP use); their logic lives on in the CLI only, see the CLI-equivalents table below.
Default (5) — always registered, every session
| Tool | Purpose |
session_start | Load project context — corrections, insights, watch_for warnings. Call at ENTRY, always. |
session_end | Save journal, insights, trajectory. Call at EXIT, always, and on any durable-intent trigger. |
remember | Write a single fact/decision — auto-routes to the right store. Durable-intent trigger. |
recall | Search all memory — keyword/RRF fusion + optional vector. Safe to call any time. |
check | Record understanding; anticipates the likely correction before you make it. Pass action_description before a risky action (publish/deploy/delete/credential/external-send) for a matching + blocked/advisory verdict. Safe to call any time. |
--full adds (1 more, 6 total)
| Tool | Purpose |
check_action | Pre-action safety matcher — warns on publish/push/deploy before you run them. |
AR_EXTRAS=1 --full adds (7 more, 13 total) — quarantined, low-use
| Tool | Purpose |
pipeline_open | Open a new project narrative phase. |
pipeline_close | Close active phase with reflection fields. |
pipeline_list | List all narrative phases as JSON summaries. |
pipeline_current | Return content of the currently active phase. |
pipeline_show | Render project narrative spine — all phases. |
register_rule | Save an IF-THEN behavior policy. |
digest | Context cache — store/recall/read/invalidate pre-computed analysis. |
Trigger Phrases → Actions
Trigger phrases below are additional signals for durable intent — they are not the only conditions under which you call these tools. session_start fires at session begin regardless of phrasing; session_end fires before you stop regardless of phrasing. The phrases below just make the save/recall content explicit when the user names it directly.
Session begin (always, no trigger phrase required):
First action of every session that resumes prior work → Call
session_start(project="[slug or auto]")→ Show: project intention, last session summary, top insights, watch_for corrections
Explicit load phrasing (reinforces the same call):
"load my context" / "what was I working on" / "load AgentRecall for [project]" → Call
session_start(project="[slug or auto]")
Session end / durable intent (always before stopping, no trigger phrase required):
Before ending any turn/session with meaningful work done → Call
session_end(summary="...", insights=[...], trajectory="...")→ Confirm: "Saved to ~/.agent-recall/projects/[slug]/journal/[date].md"
Explicit save phrasing (reinforces the same call, call it NOW, don't defer):
"save this session" / "save to memory" / "wrap up" / "记住" / "保存" → Call
session_end(...)immediately
Recall specific knowledge (any time, no gating):
"recall [topic]" / "what do I know about [X]" / "any past notes on [X]" → Call
recall(query="[topic]")→ Show results inline
Save a single fact (durable-intent trigger, call it NOW):
"remember this" / "save this decision" / "note: [X]" → Call
remember(content="[X]")
Checkpoint (mid-session, durable-intent trigger):
"checkpoint" / "quick save" → Call
session_endwith a lightweight summary: "Checkpoint: just completed X, next is Y"
Token Cost Guide
| Action | Approx tokens | When |
session_start | ~800–1200 | Once per session — ENTRY, always |
recall | ~200–400 | On demand |
remember | ~100 | On demand |
session_end | ~400–600 | Once at end — EXIT, always |
check | ~150 | Before risky actions |
The only session where session_start/session_end may be reasonably skipped is a self-contained one-off that touches no prior context and produces nothing worth remembering — even then, session_end costs ~400-600 tokens against silently losing the work, so default to calling it.
MCP Tool → CLI Equivalent
If you don't have MCP available, use the ar CLI instead:
| MCP Tool | CLI Command | Notes |
session_start | ar cold-start | Loads context for current project |
remember | ar write "<content>" | Freeform journal entry. ar capture "<question>" "<answer>" for Q&A format |
recall | ar recall "<query>" | Search palace + journal. Alias: ar insight "<query>" |
session_end | ar saveall | Batch-saves all today's sessions; or ar write "<summary>" for manual entry |
check | (no CLI equivalent) | MCP only — correction tracking via hook-correction hook |
Note:
ar rememberdoes not exist. Usear writefor freeform notes orar capturefor Q&A pairs.A handful of tools that existed on the MCP surface before 2026-07-05 (project/board-status and bootstrap-import helpers) were removed from MCP as part of a purity cleanup — zero organic MCP use — but their logic lives on behind
ar statusandar bootstrapon the CLI. If you don't have MCP available at all,ar statusandar bootstrapare your board/status and note-import commands.
Project Slugs
Projects live at ~/.agent-recall/projects/<slug>/. Common slugs:
- Run
session_start(project="auto")to let AgentRecall detect from context - Or use the explicit slug:
session_start(project="novada-site")
Notes for the Agent
- Call
session_startat the start of every session that resumes prior work, and callsession_endbefore you stop — unprompted. Waiting for the user to say "load"/"save" defeats the point of persistent memory; those phrases are reinforcement, not the gate. - For
session_end, extract 1–3 non-obvious insights from the conversation — not "fixed a bug" but "API returns null on session expiry — always null-check" - Palace is selective — only store decisions, patterns, goal hierarchy. Not full transcripts.
- This file's lifecycle doctrine must match
packages/mcp-server/src/server.ts's live MCPinstructions(both derive conceptually frompackages/core/src/host-profile.ts'slifecycleInstructions("B")). Seepackages/mcp-server/test/lifecycle-canonical-drift.test.mjs— it fails the build if this file regresses toward gating session_start/session_end on the user asking first, or restates the stale 10-tool surface.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

