Skip to the page
Chapter 01 · Amnesia

Every session starts from zero.

A new agent session re-learns the project's conventions, re-reads what an earlier session already read, and repeats failures an earlier one already hit, because nothing those sessions learned was kept where it could be found.

Read all eight chapters on one page

01.1Six sessions, two agents

Without memory, session six repeats session two's mistake.

The harness gives every session a fresh context window. With nowhere durable to put what it learned, an agent spends the start of each session re-learning the project and the middle of it working through problems an earlier session already solved.
Six sessions, two agents

The same repository, with and without a memory.

A toy in your browser · not ee
  • Useful work
  • Re-discovering conventions
  • Re-reading the same files
  • Hitting a trap
  • ee pack · 4k-token budget
  • Recalled · preflight warned
  1. Sess

    01

    No memory

    Hits a trap: the migration test needs a fresh DB

    With ee

    Hits it too, then records it as a rule

  2. Sess

    02

    No memory

    Hits the migration trap again

    With ee

    The rule is in the pack, so it avoids the trap

  3. Sess

    03

    No memory

    Hits a trap: tagging before the changelog lands

    With ee

    Hits a new trap that no memory covers yet

  4. Sess

    04

    No memory

    Hits the migration trap again

    With ee

    Preflight recalls the rule before the test

  5. Sess

    05

    No memory

    Hits the tagging trap again

    With ee

    Preflight on git tag recalls the lesson

  6. Sess

    06

    No memory

    Hits the migration trap again

    With ee

    Rule recalled; most of the session goes to the task

Useful work · no memory

42%

6 traps hit in 6 sessions

Useful work · with ee

75%

2 traps hit: only the new ones

In memory

4 lessons

Each is written once with ee remember and can be packed in any later session.

Sources and assumptions
README.md · Why This Exists (“Coding agents forget”) · the operating loop: ee pack at the start, ee remember and ee outcome as lessons are learned, ee preflight check before a risky command (advisory; it never blocks). The proportions are invented for this page and are not measured.
01.2CLAUDE.md, AGENTS.md, notes.md

What happens as the notes file grows.

A notes file is loaded whole into every session. A vector store returns only the closest matches, but ranks by similarity alone and cannot tell a stale or repeated chunk from a current one. Move through the weeks to compare both with ee.
52 weeks of lessons · three memory setups

What a session gets from a notes file, a vector store and ee.

Derived · arithmetic, not a benchmark

Week 52 · 520 lessons written · 139 now stale · 49 true lessons apply to “fix a flaky test”

  • On-task and true
  • True, off-task
  • Repeats an earlier line
  • Stale or contradicted
  • Empty slot
  1. Notes fileCLAUDE.md · AGENTS.md

    Every line goes into every session, on-task or off. The file has been trimmed 4 times, stale and repeated lines first, and the trims have deleted 201 lessons that were still true.

    8,000 tokens

    Useful
    16%
    Stale
    5
    Repeats
    3
    Missed
    23
    Deleted
    201
  2. Vector storetop 80 by similarity

    Returns up to 80 chunks, the ones most similar to the task. The score does not mark a chunk as stale or as a repeat, and the store keeps no record of what it left out.

    4,000 tokens

    Useful
    38%
    Stale
    27
    Repeats
    12
    Missed
    19
    Listed
    none
  3. ee pack--max-tokens 4000

    Strict MMR fills at most 4,000 tokens of memory text and demotes repeats. Lessons ee has detected as stale are excluded. The 20 candidates it left out are listed, each with a reason, in data.pack.skipped[].

    10,400 tokens · 6,400 of metadata

    Useful
    41%
    Stale
    5
    Repeats
    8
    Missed
    16
    Listed
    20

Useful: on-task, true and not a repeat. Missed: true lessons about this task that the session does not have. Deleted: true lessons the file's trims have removed so far. Listed: candidates the lane reports as left out.

  • Notes file
  • Vector store
  • ee pack
  • File trimmed

Tokens a session

8,000 · 4,000 · 10,400

04k8k12kwk 113263952wk 52

Ranking. The vector store and ee's search use the same similarity score here, so both miss the on-task lessons it scores low. Top-k has no record of which lessons went stale or repeat one already in the session, so it passes them through.

Token cost. ee's budget counts only the memories' own text. In markdown, each item also lists its id, why it was chosen, its trust class and its provenance, about 80 tokens here. A smaller --max-tokens gives a smaller pack.

Keeping AGENTS.md. ee export agentsmd writes the primer's rules and warnings into a marker-delimited block of AGENTS.md, 600 tokens by default. It never edits outside its markers. ee diag agentsmd-drift reports where the file and the memory disagree.

Sources and assumptions
A model, not a benchmark: one seeded draw of 520 lessons that all three lanes share. Assumed: 10 lessons a week, 50 tokens each · one new lesson in 5 restates one still true · each week 1.5% of true lessons are overtaken · the file is trimmed past 200 lines back to 120, stale and repeated lines first, then the oldest · the vector store returns 80 bare chunks, the 4,000 tokens of lessons ee's budget buys · both rank by one similarity: on-task lessons 0.3 to 1, others 0 to 0.58 · ee notices a stale lesson with chance 15% a week (a revision, a harmful outcome, the contradiction guard, decay) · MMR similarity 0.9 for two copies of a lesson, 0.3 within a topic, 0.1 otherwise · an ee item's id, why, trust and provenance lines about 80 tokens · not modeled: section quotas, the preview and link-only tiers, the query-relative relevance cutoff, the memory-tier boost, and the helpful/harmful outcome bias (at most ±0.05, AGENT_PROFILE_BIAS_CAP in src/models/context_profile.rs). ee's side: src/pack/mod.rs · DEFAULT_CONTEXT_MAX_TOKENS 4,000 (counted on each memory's own text) · DEFAULT_MMR_RELEVANCE_WEIGHT 0.75 · DEFAULT_COVERAGE_FILL_RELEVANCE_FLOOR 0.05 · PackOmissionReason · apply_contradiction_guard · the markdown renderer · tests/fixtures/golden/agent/context_pack.md.golden · src/config/merge.rs · [pack] candidate_pool 100 · src/output/mod.rs · data.pack.skipped[], skippedTotal · src/core/context.rs · include_tombstoned · src/core/agentsmd.rs · src/core/primer.rs · PRIMER_DEFAULT_BUDGET_TOKENS 600 · README.md · Agent Harness Integration.
01.3Where ee sits

ee is a command the harness calls.

Claude Code, Codex or a shell script keeps its own tools, approvals and prompt loop. Agents call ee to record evidence and to fetch context, through one CLI with a stable JSON contract.
Who owns what

Agents write evidence to ee and read context from it.

Diagram · not program output
Agent harnessClaude Code · Codexany shell · MCPowns tools, approvalsand the prompt loopplanactobservePUSH INPULL OUTremember · outcome · casspack · recall · search · whyeestores memoryFrankenSQLite + SQLModelSOURCE OF TRUTHDERIVED · REBUILDABLEee index rebuildFrankensearch indexBM25 + Model2Vec vectorsGraph snapshotFrankenNetworkXCachesquery plans, warm packs

Push in · writes

Pull out · reads

readtouches source of truth · index · graph

ee pack "<task>" --workspace . --max-tokens 4000 --format markdown

Assembles a token-budgeted context pack; every item carries an evidence pointer and a score breakdown.

The harness keeps its tools, approvals and prompt loop; ee stores memory and answers queries. The dashed boxes are derived data: if the index is lost, ee index rebuild regenerates it from the source of truth.

Sources and assumptions
README.md · Agent Operating Loop, Design Philosophy §2 (harness agnostic) and §6 (search indexes are derived assets) · src/cli/mod.rs (the commands) · src/db (FrankenSQLite + SQLModel, the source of truth)
01.4Five commands

The basic loop in five commands.

Open a workspace, record a rule, pack it into the next session, report whether it helped, and ask why it was chosen. The later chapters show what each of these steps does in detail.
  1. 1

    Open a workspace

    ee init --workspace .

    Idempotent. The store is FrankenSQLite under .ee/; indexes beside it are derived and rebuildable.

  2. 2

    Teach it a rule

    ee remember "Run cargo fmt --check before tagging a release." \
      --workspace . --level procedural --kind rule --json

    Text that looks like a secret is refused with exit 7, and the error says where it matched. A memory written this way starts in the human_explicit trust class.

  3. 3

    Hand the next session a pack

    ee pack "prepare the release" --workspace . \
      --max-tokens 4000 --format markdown

    Rules, decisions, failures and evidence that match the task, within the budget, each with provenance and a score.

  4. 4

    Say what helped

    ee outcome <memory-id> --workspace . --signal helpful \
      --reason "caught the unformatted file before the tag"

    Feedback moves the memory's posterior. Harmful counts 2.5 times as much as helpful.

  5. 5

    Ask why

    ee why <memory-id> --workspace . --json

    Where a memory came from, what supports it, how fresh and how trusted it is, and what would change its rank.