Reference
Agent Rules
Mandatory rules for agents using MemoryLayer. Paste into your agent config and leave them there.
Faster: auto-inject with one command
memorylayer setup detects your IDEs and writes all files below automatically.Terminal
memorylayer setup --ide all --yes
memorylayer setup --ide claude --no-hooks
memorylayer setup --ide all --remove --yesAuto setup
Supports Claude Code, Cursor, Windsurf, and Antigravity. Any other MCP-compatible agent works with a manual paste below.
Copy-paste rules
Add to ~/.claude/CLAUDE.md. Setup also installs hooks and ~/.claude/skills/memorylayer/SKILL.md.
▸~/.claude/CLAUDE.md
Tool decision guide
| Situation | Tool |
|---|---|
| Exact skill or symbol name knownO(1) deterministic — fastest path | skill_load |
| Code question about an indexed projectPrimary entry — always first for code Qs | recall(answer) |
| Session just startedMandatory before first response | recall (preview) |
| Brief message / need recent contextRecency-sorted, no search needed | recall(list) |
| New project mentionedMandatory, run once | code(ingest) |
| User shares preference / decision / correctionDedupes automatically | remember |
| Need related context beyond a search resultWalks tag/semantic/temporal edges (Pro+) | recall(explore: true) |
| Broad topic exploration (Pro+)Also surfaces derived + open_loops via WCM | recall(weave) |
| Code answer was empty — need raw hitsIntent-based fallback | code(locate) |
| Need specific literal in codeFallback for literal verification | code(grep) |
| Long document to store (Pro+)Splits into searchable chunks | remember(chunk) |
| Multiple facts at once (Pro+)Up to 100 items per call | remember(batch) |
| End of session — derive + prune (Pro+)WCM sleep cycle; transitive facts + contradictions | consolidate(ripple) |