ChloeCtx
How it works

Store everything. Bring back only what helps.

A lost message never comes back, so ChloeCtx keeps everything. Reading costs the model attention, so each question gets only what it needs.

One message

From something you said to the answer that needed it

  1. You say it

    In any assistant, once.

    "The client's machines run Python 3.8."
  2. Captured

    Secrets redacted, cut into small records.

    [prompt · s3] client machines run Python 3.8
  3. Stored as said

    One file on your machine, with its date. No model call.

    words + meaning indexed
  4. Noted

    Later, a small model writes down what was agreed.

    fact · by user: Python 3.8. When: choosing a library
  5. Brought back

    Weeks later, the request that needs it gets it.

    "Add a settings.toml loader" → no tomllib on 3.8
In Claude Code

It runs itself: six moments in a session

Claude Code calls ChloeCtx at each moment, so nothing depends on the model remembering to save or ask. Each call takes a few milliseconds.

  1. Session startA briefing

    Rules, decisions and planned work, checked against today's code.

    gives context
  2. Every promptThe history it needs

    Matching decisions, and older records when the evidence is strong.

    gives context
  3. Before an editNotes on that file

    Earlier errors and decisions about the file it is about to change.

    gives context
  4. Every tool callStored, secrets removed

    The call and its result. A failure that later passed becomes a fix.

    records
  5. End of a turnWhat was agreed

    A small model writes down what the turn decided.

    in the background
  6. CompactionNothing is lost

    The summary is stored, and what it dropped can come back when a prompt needs it.

    records

SessionStart. The briefing names the rules first, then decisions, planned work with its requirements, and facts.

Notes

A small model writes down what each turn agreed

Off the prompt's path, for about $0.001 a turn.

From the kickoff with the client: their machines run Python 3.8. Also, let's drop the ICS feed, their system rejects it. Next sprint we'll add SMS reminders, max 160 characters.

Dropped the ICS export and kept everything 3.8-compatible. SMS reminders noted for next sprint.

Stop · notes written in the background

fact · by userClient machines run Python 3.8.
When: choosing a library or standard-library module; parsing a config file

decision · by user · replaces 2f1c:88The ICS calendar feed is dropped: the client's system rejects it.

planned · requirementSMS reminders, next sprint: at most 160 characters each.

When it matters

Each note names its situations, so "add a settings.toml loader" finds "Python 3.8" with no word in common.

Who said it

Only what you state becomes a rule. An assistant's guess stays a guess.

Kept current

New notes replace, close or retire old ones, and a note whose code changed says so.

No repeats

It never repeats what the model can still see

Recall skips what is already in the context window. After a compaction, what the summary dropped can come back.

The next prompt can bring back exact details the summary threw away, such as an error message or a number.

saiddonea notea compactionbrought back
The gate

Full, brief, or nothing at all

When the evidence is weak, it adds nothing. Drag the slider to see what a prompt would get. It is the weakest part of the design, and the benchmarks say why.

Full recallup to 4,000 characters, best records first
  • [error · s2 · turn 14] cannot borrow `rows` as mutable · export.rs:118
  • [decision · s2] stream rows instead of building the CSV in memory
  • [tool_call · s2] cargo test -p export · 41 passed
  • [prompt · s1] count sheets go in walking order by bin
  • [episode · s2 · turn 15] export.rs, tests.rs changed · tests pass
  • [fact · s1] the receipt printer is 42 characters wide
The query engine

It connects a request to what it implies

"Enter the school's order" never says "nut-free". The query engine finds it anyway, in the background while Claude starts work.

  1. 1 · Plan

    A small model turns the request into several searches.

    "the school's rules" · "the catalog"
  2. 2 · Search

    All at once, by words, meaning, kind and date.

    4 searches, one snapshot
  3. 3 · Fuse

    The results become one ranked list.

    top records + their context
  4. 4 · Pick

    A second call keeps what changes the answer.

    rule: nut-free · fact: Bakewell has almonds
72 → 82%right answers on LongMemEval-S with its picks
$0.0012a request with Haiku, off the prompt's path
12–14 of 16runs on implied-requirement tasks, against 8 for search alone
Under the hood

One small daemon per project owns the file

Hooks and the MCP server are its clients over a Unix socket. It starts on demand and stops when idle.

ChloeCtx's architecture Claude Code runs chloectx hook for each event and chloectx mcp for the memory tools. Both talk over a Unix socket to one daemon per project, which captures, recalls and runs background work, owns the project's one ChloeDB file, and calls a small model through claude -p. Claude Code one session SessionStart UserPromptSubmit PreToolUse PostToolUse Stop · PostCompact SessionEnd … memory_* tools chloectx hook <event> a few ms · exits 0 on any failure chloectx mcp stdio · six memory tools unix socket chloectx serve one per project · starts on demand · exits after 30 idle minutes Capture redact secrets · cut into 400-byte records · embed · append Recall notes · BM25 + vectors · live window · priors · gate · pack In the background write notes each turn · query engine · consolidate every 8 Warm state embedder (memory-mapped) · segment readers · memtable claude -p a small model, off the prompt your memory one ChloeDB file
an event or a tool call going incontext coming backa model call, in the backgrounda durable append
memory_askanswer from several searches memory_searchone hybrid search memory_timelinewhat surrounded a record memory_sqlread-only SQL memory_rememberkeep a note memory_forgetforget a fact everywhere
Never in the way

A hook that can't reach the daemon in time exits silently.

Outside text is data

What a web page or tool returned is never injected on its own.

Fixes are remembered

A failure that later passed comes back when the error does.