GhostPaw codex

What GhostPaw codex keeps for each memory
GhostPaw codex is the memory library of my GhostPaw family, and it stores what an agent believes, one claim at a time. Each belief knows where it came from, how sure the agent is, how often it was confirmed and when, and every correction it has been through. A belief nobody confirms loses freshness by itself; a belief that turns out wrong is superseded, not deleted, so you can always see what the agent believed last month and why it changed its mind.
It is not OpenAI's Codex CLI. The package is @ghostpaw/codex, the command ghostpaw-codex, and it runs locally on your machine in one SQLite file, with nothing to host and no key to manage.
Belief #1
- Claim
- Invoice 4471 is overdue
- Source
- observed explicit starts at 0.90, observed 0.80, distilled 0.60, inferred 0.50
- Certainty
- 0.80
- Evidence
- 1 confirmation
- Freshness
- 100% decays from the last confirmation
- Category
- fact
- Provenance
- billing export
- Lineage
- #1, no correction yet
ghostpaw-codex belief add stores itcodex 0.8.0- Runtime
- Node 24's built-in
node:sqlite; one file,~/.ghostpaw/codex.db - Dependencies
- 0 at runtime; release binaries bring Node with them
- Ways in
- TypeScript library, MCP server, CLI and Agent Skill
- MCP tools
- 8, from one registry
- Search
- Keyword search, no model call
- Version
- 0.8.0, ; MIT
- Tests
- 456 passing on Node 24.14.0, run
One belief in GhostPaw codex, 101 days
This is GhostPaw's own example of a belief going wrong, an invoice that is overdue until it is paid, and every number below was computed by codex 0.8.0 itself: I ran the library against a fresh database with a fixed clock and let it report certainty, evidence and freshness for each day. Point at a step to find it on the trace.
1Remember · day 0
Invoice 4471 is overdue
observedcertainty 80%evidence 1fresh 100%
Seen in the billing export. An observed belief starts at 80%.
remember_belief2Confirm · day 9
Invoice 4471 is overdue
certainty 86%evidence 2fresh 100%
The next export says the same. Freshness restarts and now decays more slowly, by the square root of the evidence.
revise_belief3Fade · day 100
Invoice 4471 is overdue
certainty 86%fresh 49% · fading
Nobody has confirmed it for 91 days. Under 70% the review flags it fading, under 40% stale.
review_codex4Correct · day 101
Invoice 4471 is paid
explicitcertainty 90%supersedes #1
The customer writes that it is paid. The new belief replaces the old one instead of sitting next to it.
revise_belief5Recall · day 101
search "invoice 4471" finds #2 only
#1 Invoice 4471 is overdue#1 is a ghost now: out of every search, still on record in the lineage 1, 2.
search_codex
Why GhostPaw codex and not a MEMORY.md
A MEMORY.md is short, readable and easy to fix by hand, until the agent writes it. Then it only grows, contradictions sit side by side, and every line looks as true as the next. The README of codex lists the reasons, and each one is a field of the belief record.
MEMORY.md9 lines
- We use REST for the billing API
- Invoice 4471 is overdue
- Fox prefers prebuilt binaries
- Deploys run on Fridays
- REST was retired, use the queue
- Invoice 4471 is overdue
- Invoice 4471 is paid
- Deploys never run on Fridays
codex.db3 active, 3 ghosts
- #2 Invoice 4471 is paidexplicit · 90%
- #4 Billing uses the queueexplicit · 90%
- #6 No deploys on Fridaysobserved · 86% · evidence 2
#1 Invoice 4471 is overduesuperseded by #2#3 We use REST for the billing APIsuperseded by #4#5 Deploys run on Fridayssuperseded by #6
- MEMORY.md only grows
A superseded belief leaves recall; forget hides one, retire deletes a whole lineage for good.
- Contradictions pile up
A correction supersedes the old belief, and every write lists the nearby beliefs it might duplicate.
- Every line looks equally true
Each belief carries its source and certainty, so a guess and a confirmed fact never read the same.
- No sense of time
Freshness decays from the last confirmation, and the review flags what went stale.
- Concurrent edits clobber
One SQLite file in WAL mode; the CLI and the MCP server open it read-only for reads.
The same correction, in the terminal
The session on the right is real output from codex 0.8.0, run on a throwaway database and cut to the lines that change. Search is keyword search: SQLite's full-text index plus a character-trigram match, ranked and cut off at 55% of the best hit. It calls neither an embedding model nor the network, so recall is fast, free and the same every time.
The price is honest: a synonym the beliefs never use needs an alias (alias add class warrior), and for search by meaning across documents the codex site itself points you to an embedding-based tool.
$ ghostpaw-codex belief add 'Invoice 4471 is overdue' --source observed --category fact --provenance 'billing export'
id: 1
claim: Invoice 4471 is overdue
certainty: 0.80
evidence: 1
source: observed
$ ghostpaw-codex search 'invoice 4471'
1 Invoice 4471 is overdue [0.80 observed strong] provenance: billing export
$ ghostpaw-codex belief correct 1 --claim 'Invoice 4471 is paid' --source explicit --provenance 'message from the customer'
id: 2
claim: Invoice 4471 is paid
certainty: 0.90
sources: message from the customer, billing export
$ ghostpaw-codex search 'invoice 4471'
2 Invoice 4471 is paid [0.90 explicit strong] provenance: message from the customer
$ ghostpaw-codex show 1
claim: Invoice 4471 is overdue
status: superseded by 2
lineage: 1, 2
Four ways into GhostPaw codex, eight tools
The library, the MCP server, the CLI and the Agent Skill are all generated from one registry of tools, and a check in CI fails when they drift apart. The registry has eight tools; the README and the site still say seven, from before import_beliefs joined.
- Library
@ghostpaw/codex - MCP server
ghostpaw-codex mcp - CLI
ghostpaw-codex - Agent Skill
SKILL.md+ 17 guides
search_codexreview_codexinspect_codex_itemremember_beliefrevise_beliefretire_beliefdismiss_proximityimport_beliefs
~/.ghostpaw/codex.dbone SQLite file, copy it, back it up, open it with any SQLite tool
src/toolsInstall
An MCP client gets the eight tools with one line; a Node 24 program imports the same functions. Release binaries for Linux, macOS and Windows check their checksums on install and bring Node along. The README measured it with 10,000 beliefs in a file database on Node 24.14.0: a search takes 3.6 ms at the median, remembering a belief with its scan for nearby ones 4.5 ms.
# as an MCP server for any MCP client
npx -y @ghostpaw/codex mcp
# in Claude Code
claude mcp add ghostpaw-codex -- ghostpaw-codex mcp
# as a library
npm install @ghostpaw/codex
import { DatabaseSync } from 'node:sqlite';
import { initCodexTables, read, write }
from '@ghostpaw/codex';
const db = new DatabaseSync('codex.db');
initCodexTables(db);
write.remember(db, {
claim: 'Invoice 4471 is overdue',
source: 'observed',
category: 'fact',
});
const hits = read.recall(db, 'invoice 4471');
GhostPaw codex in use by my Grok bots
My Grok bots use GhostPaw codex every day: it keeps what they learn, so the next run starts from better data, faster, and the same lesson is never written down twice. Here is who writes beliefs and what for, and the bot that maintains the library itself.
- B1 · Learning passesMICE Kontor
The agency's bot runs SEO and GEO passes and records each lesson as a belief with its source page and pass.
MICE Kontor - B2 · Learning passeshelgoland.tech
The island guide's SEO bot keeps what search taught it as beliefs, and must search codex before every add.
helgoland.tech - B3 · Product lessonsAgentpreneur Lab
The product bot records what each learning pass taught it, with the page it came from, and checks codex first.
Agentpreneur Lab - B4 · Growth knowledgeCosmolytic Studio
The shop's bot keeps its growth knowledge as beliefs beside its procedures in GhostPaw grimoire.
Cosmolytic Studio
- B5 · Nightly one‑to‑onesThe mentor bot
Keeps what it learns about each bot in its nightly talks as beliefs named after that bot, so the next night starts from what it already knows, and how sure it is.
- B6 · Imported tablesThe desk bots
Moved their belief tables, such as which post openings work, out of markdown and into codex with
import_beliefs.
A bot maintains GhostPaw codex
One of my Grok bots owns the GhostPaw libraries: code, tests, docs, the sites and the releases. When another bot trips over codex, it files a note; the maintainer turns the note into a quest in its own GhostPaw questlog and ships the fix. The read-only reads in 0.8.0 came from such a note.
- picks the day's library and plans from the fleet's notes
- builds and tests; long refactors go to OpenAI's Codex CLI as briefed jobs
- releases 0.x versions once CI is green, at most one per library a day
- updates the docs and deploys the sites
- a 1.x release or a breaking API change
- anything that costs money
- new repositories or a change of visibility
- the organisation's settings and its secrets
The GhostPaw family: five files an agent keeps
Agent harnesses keep their state in markdown files that grow every session. Each GhostPaw library replaces one of them with a SQLite file and the same four ways in. They never import each other: install one and ignore the rest. I extracted them from Ghostpaw, an agent of my own, and these five are its memory.
-
MEMORY.mdS1 · Belief memoryGhostPaw codexBeliefs instead of a memory filev0.8.0 · replaces MEMORY.md -
SOUL.mdS2 · Identity memoryGhostPaw soulsAn identity that changes with evidencev0.6.3 · replaces SOUL.md -
skills/S3 · Procedural memoryGhostPaw grimoireProcedures that get better and keep their historyv0.7.4 · replaces skills/ -
USER.mdS4 · Social memoryGhostPaw affinityContacts instead of a user notev0.7.3 · replaces USER.md -
TODO.mdS5 · Commitment memoryGhostPaw questlogQuests instead of a to‑do listv0.14.2 · replaces TODO.md
Use GhostPaw codex, read it, or write to me
The site has the install lines for every platform and a console that replays a wrong fact in five moves; the repository has the code, the changelog and every test. It is a 0.x release, so test upgrades against a backup.
Open the siteCode on GitHubPackage on npm
I build products and MVPs and consult through Anonyfox e. K.; serious asks go to max@anonyfox
More from the Library rack
- github.comcelestineLive, stage 3 of 5
- github.comchatoyantLive, stage 3 of 5
- affinity.ghostpaw.devGhostPaw affinityLive, stage 1 of 5
- grimoire.ghostpaw.devGhostPaw grimoireLive, stage 1 of 5
- questlog.ghostpaw.devGhostPaw questlogLive, stage 1 of 5
- souls.ghostpaw.devGhostPaw soulsLive, stage 1 of 5
- lfm.cashlfmLive, stage 3 of 5
- lfr.emaillfrLive, stage 2 of 5
- github.comMagpie HTMLLive, stage 1 of 5
