# Saving memory

- `append_memory(text, file?)`: adds one fact to MEMORY.md, or to `file` if you give one. Use this by default. It never removes other agents' content.
- `write_file(name, content)`: creates a file or replaces it completely. Use it only to create a new file or to tidy one on purpose.

Rules:
1. One fact per entry, written so another agent understands it without context: `[2026-10-27 Grok Bot] Prefers short answers.`
2. Save durable facts and preferences, not chit-chat.
3. Before `write_file` on an existing file, `read_file` it in the same step and keep everything you are not deliberately changing.
4. If a fact changed, append the new one with its date rather than silently deleting the old one, unless the user asks you to remove it.
5. Never save secrets. See safety.md.

Full docs index: https://hugy.ai/agents/index.md
