agentleFS
GoldentriiGoldentrii/AgentRecall-X/AGENTS.md

AgentRecall-X

AGENTS.md377 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 repository2 other files it gives its agents.

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
  1. Very specific:

    If you don't have MCP available, use the ar CLI instead:

    line 103
  2. Very specific:

    Run session_start(project="auto") to let AgentRecall detect from context

    line 124
  3. Very specific:

    Call session_start at the start of every session that resumes prior work, and call session_end before you stop — unprompted.

    line 131

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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:

  1. ENTRY — ALWAYS, every session, not just on trigger phrases. The moment a session resumes prior work, call session_start FIRST, 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.
  2. EXIT — ALWAYS, before you stop. Before ending a turn/session where you did meaningful work, call session_end with 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.
  3. DURABLE INTENT — call immediately, don't defer. The moment you or the user says save / remember / checkpoint / 记住 / 保存, call session_end (or remember for a single fact) right then, not at some later "natural" stopping point.
  4. recall and check are 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

ToolPurpose
session_startLoad project context. Default mode: "cards" = owner identity card → HARD RULES (P0 corrections and behaviour policies) → project state card, plus a one-line pending-review count, nothing else (88 median tokens on the card-less fixture, ~1,070 with both cards at cap); mode: "full" adds insights, continuity, rooms, captures and watch_for warnings; mode: "lite" is a ≤500-token sketch. The rendered text is capped at 16,384 UTF-8 bytes (AGENT_RECALL_SESSION_START_MAX_BYTES); HARD RULES always survive. Call at ENTRY, always.
session_endSave journal, insights, trajectory and the project state card (state: goal, open_decisions, blockers, next, pointers; omitted fields carry forward). Call at EXIT, always, and on any durable-intent trigger.
rememberWrite a single fact/decision — auto-routes to the right store. Durable-intent trigger.
recallSearch all memory — keyword/RRF fusion + optional vector. Safe to call any time.
checkRecord 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.

session_end state (optional) — the project state card. Every session_end rewrites projects/<slug>/state-card.md, and the next session_start loads it after the HARD RULES. Fields: goal (≤300 chars), open_decisions (≤5 × 160), blockers (≤5 × 160), next (≤300; defaults to trajectory), pointers (≤8 × 200 — paths/URLs). Omit a field to carry it forward from the last card; pass [] to clear a list. The caps are soft: overflow is cut with … (never rejected) and the cut fields are listed in the result's state_card.truncated (state_card.written says whether a card was written). Only inputs past the schema's hard limits (goal/next 1,200 chars, list items 640, pointers 800, 20 entries per list) are rejected, and a rejection drops the whole save — so keep to the caps. The owner identity card (<root>/identity-card.md) is loaded first by session_start as owner; it is not writable through MCP — the owner edits it with ar identity. The hook-driven end-of-turn save (hook-end) and ar saveall leave the state card alone.

--full adds (1 more, 6 total)

ToolPurpose
check_actionPre-action safety matcher — warns on publish/push/deploy before you run them.

AR_EXTRAS=1 --full adds (7 more, 13 total) — quarantined, low-use

ToolPurpose
pipeline_openOpen a new project narrative phase.
pipeline_closeClose active phase with reflection fields.
pipeline_listList all narrative phases as JSON summaries.
pipeline_currentReturn content of the currently active phase.
pipeline_showRender project narrative spine — all phases.
register_ruleSave an IF-THEN behavior policy.
digestContext 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_end with a lightweight summary: "Checkpoint: just completed X, next is Y"


Token Cost Guide

ActionApprox tokensWhen
session_start~90 (cards default, no cards yet) · ~1,070 (both cards at cap) · ~800–1200 (mode: "full")Once per session — ENTRY, always
recall~200–400On demand
remember~100On demand
session_end~400–600Once at end — EXIT, always
check~150Before 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 ToolCLI CommandNotes
session_startar cold-startLoads context for current project
rememberar write "<content>"Freeform journal entry. ar capture "<question>" "<answer>" for Q&A format
recallar recall "<query>"Search palace + journal. Alias: ar insight "<query>"
session_endar saveallBatch-saves all today's sessions; or ar write "<summary>" for manual entry
check(no CLI equivalent)MCP only — correction tracking via hook-correction hook
(identity card)ar identity init|show|set <file>Owner card loaded first by every session_start; CLI is the only write path
(state card)ar state show [--project <slug>]Current project state card, rewritten by every session_end

Note: ar remember does not exist. Use ar write for freeform notes or ar capture for 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 status and ar bootstrap on the CLI. If you don't have MCP available at all, ar status and ar bootstrap are 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_start at the start of every session that resumes prior work, and call session_end before 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 MCP instructions (both derive conceptually from packages/core/src/host-profile.ts's lifecycleInstructions("B")). See packages/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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.