Context as managed virtual memory.
Valera Studio Harness is a deterministic pager for long Claude Code sessions. Instead of resending the whole transcript every turn, it keeps a small, hot working set in context and faults in everything else from a plain-markdown store, on demand, by handle. Files are the truth — the agent works in a spotlight, not a warehouse.
Same model, same tasks — only the memory strategy differs.
120 cells (15 sessions × 2 conditions × 3–5 repeats), Valera Studio Harness vs. a stock Sonnet session holding full raw context, identical pass/fail checks on both sides.
Cost per session
Median cost per session — all 15 benchmark sessions, shortest to longest
Savings by session length
% cheaper than stock, median $ per session
Cheaper didn't cost accuracy.
Stock's only two misses (short-04-mixed,
medium-02-doc-gen) were plain task-correctness failures,
unrelated to memory.
| Session | Valera pass | Valera $ | Stock pass | Stock $ |
|---|---|---|---|---|
| short-03-recall-probe | 3/3 | $0.31 | 3/3 | $0.53 |
| medium-03-recall-probe | 4/4 | $1.08 | 4/4 | $3.76 |
| long-03-recall-probe | 5/5 | $2.28 | 5/5 | $11.17 |
| long-05-recall-probe-2 | 5/5 | $2.57 | 5/5 | $15.18 |
| short-04-mixed | 3/3 | $0.21 | 0/3 | $0.59 |
| medium-02-doc-gen | 4/4 | $1.05 | 2/4 | $2.87 |
Four layers, one working set.
Everything else — the full store — stays on disk until a query actually touches it.
STANDING.md
The resident layer. A short, fixed system prompt — non-negotiable floors, plus the mechanics of how the rest of memory reaches the agent. Never paged, never grows.
short/
Ungated capture. An agent writes here freely — inferred or measured, never as your own confirmed word.
long/
Durable, gated memory. Only you promote a short/ card here — that promotion is the trust mechanic the whole design leans on.
pager.py
Lexical matching surfaces a one-line catalog card when live text touches a memory's keys. The agent faults in the full card only when it needs it.
Every card in short/ and long/ carries the
same four-field frontmatter, defined in MEMORY_SCHEMA.md:
type, class, origin,
keys. origin is the trust axis —
origin: operator can only be minted by the human running
the session, never written by an agent on its own initiative, which
is what makes the promotion in 03 a real gate and
not a formality. class is a strict
public ⊂ crew ⊂ private ceiling that fails closed on
anything missing or malformed. It's a plain markdown/YAML contract,
not a database schema — the file on disk is the source of truth.
MIT licensed. Python 3.11+. No framework lock-in.
Clone it, edit STANDING.md for your own deployment, and
run the harness against the Claude Agent SDK. Source and full
quickstart ship together.
This is free (MIT licensed) — if it's useful to you, tips help fund development. Totally optional.
Pager design converges independently with, and adopted patterns from, TencentCloud/TencentDB-Agent-Memory (MIT) — their summary/no-silent-caps conventions informed this project's tier fields. Early design work also drew on a reading of mem0ai/mem0 (Apache 2.0).