
Codex's local memories have eleven config keys and one feature flag. Here's a conservative setup, a per-chat switch, and a script that scans the memory store for secrets.

One 60-line hook rebuilds the agent's bearings from git and a plan file after /clear and compaction, and puts a price on resuming a cold session. About fifteen minutes to set up.

Fifteen minutes to a two-line status bar showing unreviewed lines, the prompt-cache clock and how much context is left, so you stop the agent before the diff gets out of hand.

Two small scripts log every instruction file a session pulls in, why it loaded and what it costs, then flag the rules that never fire. About 15 minutes to set up.

On a 1M-context model, a long session drags a near-million-token history through every turn. One command sets a smaller auto-compact window, and a cost model shows where it pays off.

A Claude Code subagent loads your whole CLAUDE.md hierarchy by default. The omitClaudeMd field skips it, and a ten-minute test shows what you save and what you lose.

Anthropic's own advice is to prune ruthlessly. A one-question test, a short audit script that finds the stale lines for you, and a map of where each deleted rule should go instead.

Global defaults, repo rules and per-service overrides stack in a fixed order. Know it, and a monorepo stops fighting your instructions.