AI agents forget your business between sessions because a model keeps nothing once a conversation ends. Anything it seems to remember was loaded back in at the start. So the cure for re-briefing is not a smarter model. It is deciding what gets loaded, from where, and who keeps it current. A setup that works has four layers: standing rules, project state, company knowledge and what each agent has learned. Most people have the first and stop there.

Why agents start from zero

A developer put it in one sentence: "Every Claude session starts from zero" (Hacker News). The model has your instruction file and whatever is in the repository. It does not have last Tuesday's decision, the reason you rejected the first design, or the client's preference you explained twice already.

The cost shows up as repetition. You become the memory, and you pay for it in every prompt.

The four layers

Layer Holds Changes Lives in
Standing rules How to work here: build commands, conventions, what needs approval Rarely CLAUDE.md, AGENTS.md, GEMINI.md
Project state Where the work stands and what is next Every session A handoff file per piece of work
Company knowledge Decisions, research, brand, client context Weekly Notes the agent can search
Agent learning What this agent has learned doing this job Over months Memory attached to the agent

Each layer answers a different question. Rules: how do we work? State: where are we? Knowledge: what do we know? Learning: what have I found out the hard way?

Layer 1: standing rules

Keep them short and stable. Every line is read on every session. If you use more than one agent tool, keep the files identical, which we cover in One set of rules for Claude Code, Codex and Antigravity.

The common mistake is putting project state here. Rules files that fill up with "currently working on" notes go stale within days and teach the agent wrong things with full confidence.

Layer 2: project state

This is the layer that removes the most re-briefing for the least effort. One file per open piece of work, with a fixed shape:

# Checkout redesign

**Goal:** Cut checkout from four steps to two without losing address validation.

## Where it stands (verified 2026-11-14)
- Steps 1 and 2 merged. Payment step is on branch checkout-payment.
- Address validation fails for PO boxes. Not fixed.

## Open work, in order
1. Fix PO box validation
2. Mobile layout for the payment step
3. Waiting on me: choose the error copy

## Rules
- Do not touch the tax calculation. It is owned by another change.

## Pointers
- Ticket 142, design in docs/checkout.md

Two habits make it work. The agent reads the file first and updates it last. And the "where it stands" section is checked against reality, not copied forward, because a handoff that says something is done when it is not is worse than no handoff.

Layer 3: company knowledge

Decisions and context that outlive any one project: why you chose a vendor, how you describe the product, what a client asked for last quarter. Two things matter more than which tool holds it.

It must be searchable by the agent. A folder of notes the agent never opens is not memory. Either the agent is told to search it at the start of a task, or the system retrieves relevant notes into the prompt.

It must not rot. One developer described the upkeep as "staleness (which for me seems like a constant chase)" (Hacker News). Date your notes, and when a decision is reversed, change the old note instead of adding a contradicting one.

Layer 4: what the agent learns

An agent that does the same job every week should get better at it: the quirk in your deploy script, the reviewer who always asks for tests, the client who dislikes long emails. That requires memory attached to the agent, not to the conversation.

It also requires the ability to correct it. Stored memory can be wrong, and a wrong memory is repeated confidently. Whatever you use, make sure you can read what an agent has stored and delete it.

Memory across tools

If you run Claude Code and Codex on the same project, each has its own memory features, and neither reads the other's. That is why layers 2 and 3 should live in plain files or a shared store instead of inside one tool. Files in the repository are the one format every agent reads.

Memory services that sit between tools exist, and so do shared memory servers that agents connect to. They help with retrieval. They do not remove the need to decide what is worth remembering.

What not to store

  • Secrets. Never put credentials in memory or rules files
  • Anything derivable from the code. The agent can read the code
  • A diary. "What I did today" belongs in commit history
  • Unverified claims. A note that says the bug is fixed, written before the test ran, will mislead every later session

How CPLai handles memory

CPLai treats this as a core job, not an add-on.

  • Persistent agents. Each agent keeps its identity, role, instructions and memory between runs, and completed work can add durable memory. You can view an agent's memory and reset it (Agents).
  • Company vault and knowledge graph. Notes, decisions and agent memories are scoped to a company and retrieved into prompts with their source (Vault, Knowledge Graph).
  • Managed instruction files. CPLai writes the same block into CLAUDE.md, AGENTS.md and GEMINI.md, telling any command-line agent how to search company knowledge and where handoffs go (Agent Memory Files).
  • Scoped by company. If you run more than one business, each company's knowledge stays with that company.

The limits are the same ones this article warns about. Retrieval is only as good as the notes behind it and may return nothing. Memory can be wrong and needs correcting. CPLai gives you the place and the plumbing. Keeping the knowledge true is still a habit.

Sources