> ## Documentation Index
> Fetch the complete documentation index at: /dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Give your agent memory

> Tell your agent when to recall and when to save, so it remembers across runs.

**1. Connect Constella**

Follow the guide for your tool: [Claude Code](/dev/docs/connect/claude-code.md), [Codex](/dev/docs/connect/codex.md), [Hermes](/dev/docs/connect/hermes.md), [OpenClaw](/dev/docs/connect/openclaw.md) or [any MCP client](/dev/docs/connect/other-mcp.md).

**2. Add these rules**

Put them in the file your agent reads at the start: `CLAUDE.md` for Claude Code, `AGENTS.md` for Codex, or your agent's system prompt.

```markdown CLAUDE.md theme={"system"}
## Memory (Constella)
- Before you start a task, call memory_recall with what the task is about.
- When the person decides something, states a preference, or you learn a fact
  that will matter next time, save it with memory_add. Give it a short id
  ("project:deploy-steps") so saving again updates it instead of adding a copy.
- If a memory turns out wrong, save the right one under the same id, or
  memory_forget it.
- Never save secrets, keys or passwords.
```

**3. Check what it saved**

Open the tool's folder under **Library → Connected apps** in Constella. Remove anything wrong, or clear the folder.

## Tips for good memories

* **One fact per memory.** "We ship on Fridays." beats a page of notes.
* **Full sentences.** A memory should make sense on its own, months later.
* **Stable ids.** `project:deploy-steps`, `pref:answer-length`. Saving the same id keeps one memory up to date.
* **Recall first.** An agent that recalls before it works repeats far fewer questions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.