Reference
memex init
Set memex up in a repo, once. Safe to repeat.
What it does
Creates .memex/ (a .gitignore, a settings file and an empty collections/ folder), writes a short block into AGENTS.md between markers that tells any agent to read intent before code, and points an existing CLAUDE.md at it with an @AGENTS.md line.
If no memex is on your PATH (when run through npx), it copies itself to ~/.local/bin. It ends by printing memex info.
Safe to repeat: it never overwrites files in .memex/, replaces only its own block in AGENTS.md, and reports each action. Reading works without it; only log needs a .memex/.
In a new repo
$ memex init
created .memex/.gitignore
created .memex/config.json
created .memex/collections/.gitkeep
created AGENTS.md
updated CLAUDE.md
… then the atlas, as memex info prints it