A three-layer system that makes Claude remember and self-improve

Executive overview

Standard AI chat tools remember surface details — your name, your job title — but forget the context that actually drives good work. The result is wasted time re-explaining the same things every session. A three-layer memory architecture, built inside Claude Code or Codex, fixes this by persisting context across sessions and enabling the AI to update its own instructions as it learns.

The system moves from broad global defaults down to highly specific, project-level knowledge — exposing only what the AI needs at any moment to protect its context window.

The compounding effect: every session the AI corrects, documents, and applies its own lessons learned — turning a tool into an asset.

Why standard AI memory falls short

  • Chat tools (ChatGPT, Claude, Gemini) only retain surface preferences — name, title, general style.
  • Deep contextual knowledge — client quirks, team terminology, boss-specific shorthand — is never stored.
  • Every session restarts from zero, costing time and producing inconsistent output.
  • File read/write capability (only in Claude Code, Claude Cowork, Codex) is what makes persistent, layered memory possible.

Layer 1: always-on global defaults

  • Set once inside Settings > Personal Preferences (Cowork) or Settings > Personalization (Codex).
  • Include: your role (under 5 lines) and your communication style preferences.
  • Optional: behavior rules (e.g., ask clarifying questions before acting) and safety rails (e.g., never delete files without approval).
  • Safety rails are useful early on; remove them as confidence in the AI builds — they reduce autonomy and slow workflows.
  • Keep layer 1 minimal: it loads into every conversation, so information density matters.

Layer 2: the mission file (Claude.md / agents.md)

  • One file per project folder; named Claude.md (Cowork) or agents.md (Codex).
  • The AI reads this file first before every task in that folder.
  • Structure: purpose (what work happens here), tree (folder structure and what each subfolder is for), rules (AI behavior specific to this project).
  • Add a note-taking section at the bottom — this is where the self-improving loop begins.
  • After each task, the AI logs corrections, preferences, and patterns as dated one-line lessons.
  • When 3 or more similar lessons accumulate, the AI automatically creates a new context file, then updates the tree.
  • Keep the file under 100 lines — it loads on every task, so density beats completeness.
  • AI can generate this file for you: open the folder, paste a creation prompt, dictate the project context, let it build the file.

Layer 3: training materials (context files)

  • Live in a dedicated context subfolder inside the project folder.
  • Purpose: teach the AI what good output looks like — not just what data is available.
  • Each context file has three parts:
    • Header — what the file is for and when to use it.
    • Content — standards, preferences, examples of approved deliverables.
    • Learning section — starts empty; filled by the AI as it discovers patterns.
  • Example: a client profile context file might include communication preferences (emails under 300 words, plain language), key vocabulary, and two approved deliverable examples the AI can model.
  • Lessons self-appended by the AI (e.g., "Sarah prefers charts over tables — March 4") make future outputs progressively better.

Progressive disclosure: why three layers beats one big prompt

  • Stuffing all context into the AI at once degrades performance — the context window is finite.
  • Three layers allow progressive disclosure: the AI loads only what it needs for each task.
  • Layer 1 is always present (small). Layer 2 is loaded per folder (concise). Layer 3 is accessed selectively (specific files only).
  • This architecture unlocks complex, high-quality task execution that a single large prompt cannot.

Getting started in 20 minutes

  • Minutes 1–3: set up layer 1 global instructions in settings.
  • Minutes 4–10: create a project folder, drop in relevant files, paste the creation prompt, and dictate project context — AI builds the Claude.md.
  • Minutes 11–20: create the context subfolder, add 3–5 diverse examples of good work, ask the AI to extract what makes them good, and generate context files from the result.

More like this — when you're ready for early access.

Join the waitlist for a personal account and content recommendations based on what you're working on.

No spam. Unsubscribe at any time.

You're on the list. We'll be in touch before launch.

Get early access to the full library.

Join the waitlist for a personal account and content recommendations based on what you're working on.

No spam. Unsubscribe at any time.

You're on the list. We'll be in touch before launch.

Be among the first to get personalised recommendations tailored to your stage in business.

No spam.

You're on the list. We'll be in touch before launch.

Be among the first to get personalised recommendations tailored to your stage in business.

No spam.

You're on the list. We'll be in touch before launch.