GhostPaw affinity

What GhostPaw affinity keeps about one person
GhostPaw affinity is the contacts library of my GhostPaw family. It keeps the people an agent deals with, their handles, a journal of what happened, the promises made to them and the dates that come round every year. The agent only records events; how close someone is, how far they can be trusted and how often you usually talk are worked out from those records, and nobody types a score.
It replaces the USER.md an agent harness keeps about people. It is not the Affinity CRM from affinity.co, which shares the word and nothing else. The package is @ghostpaw/affinity, and it runs locally in one SQLite file.
Contact #4 · invented example
- Name
- Ada a person (kind human)
- Handle
- email [email protected]
- Rank
- 1 derived from what happened, never set
- Trust
- 0.50 a heuristic from the records, not a judgement
- Cadence
- every 35 days learned from four lunches
- Last talk
- 46 days ago 1.3 cadences
- Promise
- Send Ada the recipe due 29 July, open, overdue
- Yearly
- birthday, 15 September
- Contact?
- yes, nothing blocks a message
USER.md, what it heldAda: lunch sometimes. Owes her a recipe?
- Runtime
- Node 24's built-in
node:sqlite; one file,~/.ghostpaw/affinity.db - Dependencies
- 0 at runtime; release binaries bring Node with them
- Ways in
- TypeScript library, MCP server, CLI and Agent Skill
- MCP tools
- 14, from one registry
- Reads
- Only what the agent records; no mail, no address book
- Version
- 0.7.3, ; MIT
- Tests
- 602 passing on Node 24.14.0, run
Who is drifting: GhostPaw affinity's radar, 90 days
Every person here is invented, and every position was computed by affinity 0.7.3 itself: I recorded a summer of calls, lunches and promises against a fresh database with a fixed clock and read the radar on days 30, 60 and 90. A ring is one usual gap between two talks; past one and a half, affinity marks the link as drifting. Scroll, and ninety days pass on the scope; point at a person to find them.
Jundrift
65 dayscadence 193.4×
Climbing every five days in June, then nothing. Past the drift ring on day 60, far out by day 90.
No contact for 65 days (cadence 19 days)Adaoverdue promise
46 dayscadence 351.3×
Not drifting yet, but on top of the radar: a promise to her is late.
Overdue promise: Send Ada the recipe (due 2026‑07‑29)Olado-not-contact
80 dayscadence 631.3×
Met once. She can stay on the radar; her employer's flag still stops any message to her.
blocked via Kestrel Ltd, works_atInesin rhythm
27 dayscadence 490.6×
Coffee once a month; a slow rhythm is still a rhythm.
Routine check-in recommendedRenin rhythm
6 dayscadence 90.7×
A weekly call that holds. His cadence tightened from 25 days to 9 as the calls came in.
Routine check-in recommended
Promises in GhostPaw affinity close as kept, cancelled or broken
The thing worth remembering about a person is often what you said you would do. affinity records a promise with a due date, keeps it open until it is resolved, and accepts only three honest endings. There is no "done": the CLI refuses it. An open promise weighs on trust until it closes, and a late one puts the person on top of the radar.
- Kept · day 20Send Ren the trail map
Done a day before it was due, and recorded as kept.
- Cancelled · day 38Book a table for Ines
Plans changed; nobody owes anything.
- Broken · day 40Bring Jun the borrowed rope back
Due on day 27, never kept, and recorded as broken rather than quietly dropped.
- Open · overdue since day 58Send Ada the recipe
Still open on day 90. This is why Ada leads the radar.
manage_commitmentThe do‑not‑contact fuse in GhostPaw affinity
An agent that can write to people needs to know who must not hear from it. Since 0.7.3 a contact, a company or a group can carry a do‑not‑contact flag, and check_contactable follows works_at and member_of ties to find it: flag a company, and nobody who works there gets a message. The CLI exits 1, so a script stops before it sends.
- FromMika, the agentdrafts a note to Ola
- F1 · check_contactableBlowncontactable: false
- ToOlano message sent
WhyOlaworks_atKestrel Ltd, do-not-contact
The same check, and a promise, in the terminal
The session is real output from affinity 0.7.3 on a throwaway database, with the same invented names. It flags the company, ties Ola to it and asks whether Ola may be contacted; then it tries to close a promise to Ren, recorded beforehand, as "done".
What affinity holds is what the agent wrote into it. It does not read mail, messages or an address book on its own, there is no hosted service, and nothing leaves the SQLite file unless your code sends it. Trust and rank are heuristics from the records, not judgements of a person.
$ ghostpaw-affinity contact create '{"name": "Ola", "kind": "human"}'
Created 1 contact. (id 3)
$ ghostpaw-affinity contact create '{"name": "Kestrel Ltd", "kind": "company"}' --do-not-contact
Created 1 contact. (id 4)
$ ghostpaw-affinity relationship tie --from '{"contactId": 3}' --to '{"contactId": 4}' --kind works_at
Created 1 link. (id 1)
$ ghostpaw-affinity check contactable --contact '{"contactId": 3}'
contactId : 3
name : Ola
contactable: false
blockedBy : Kestrel Ltd
exit 1
$ ghostpaw-affinity commitment resolve --commitment-event-id 1 --resolution done
resolution must be one of: kept, cancelled, broken
exit 2
$ ghostpaw-affinity commitment resolve --commitment-event-id 1 --resolution kept
Updated 1 event. (id 1)
Exit codes a script branches on
- 0success, a no‑op included
- 1blocked by a do-not-contact flag, or another tool error: do not send
- 2usage or invalid input, such as "done"
- 3not found, or a question back
- 4conflict, such as a promise already closed
Four ways into GhostPaw affinity, fourteen tools
The library, the MCP server, the CLI and the Agent Skill are generated from one registry of tools. The registry has fourteen; the site says twelve in one place and fourteen in another, and fourteen is right. affinity is the largest of the five libraries, about 20,900 lines of TypeScript before tests.
- Library
@ghostpaw/affinity - MCP server
ghostpaw-affinity mcp - CLI
ghostpaw-affinity - Agent Skill
SKILL.md+ 13 guides
search_affinityreview_affinityinspect_affinity_itemmanage_contactmerge_contactsmanage_duplicate_dismissalmanage_identitymanage_relationshiprecord_eventmanage_eventmanage_commitmentmanage_date_anchormanage_attributecheck_contactable
~/.ghostpaw/one SQLite file, copy it, back it up, open it with any SQLite tool
src/toolsInstall
An MCP client gets the fourteen 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. A merged duplicate is never thrown away: the loser stays on record and points at the contact that absorbed it, and check_contactable follows it there.
# as an MCP server for any MCP client
npx -y @ghostpaw/affinity mcp
# in Claude Code
claude mcp add ghostpaw-affinity -- ghostpaw-affinity mcp
# as a library
npm install @ghostpaw/affinity
import { DatabaseSync } from 'node:sqlite';
import { initAffinityTables, read }
from '@ghostpaw/affinity';
const db = new DatabaseSync('affinity.db');
initAffinityTables(db);
// before any message leaves the agent
const gate = read.checkContactable(db, contactId);
if (!gate.contactable)
throw new Error(`do not contact: ${gate.blockedBy[0].name}`);
// who is drifting, and why
const radar = read.listRadar(db);
GhostPaw affinity in use by my Grok bots
My Grok bots keep the people they deal with in GhostPaw affinity, and the bots that write to people run its do‑not‑contact check first. Here is who keeps contacts and what for, and the bot that maintains the library itself.
- B1 · Social DeskReplies and messages
Keeps the handles of the people it answers or writes to, and runs
check_contactablebefore every outreach. - B2 · Social ingestIncoming messages
Records each message as an event with its external id, so a second import of the same thread adds nothing.
- B3 · MentorThe fleet roster
Keeps the other bots as contacts of kind agent, with the commitments between them.
- B4 · Chief of staffRead only
Looks people up across the shared stores and never writes to them.
A bot maintains GhostPaw affinity
One of my Grok bots owns the GhostPaw libraries: code, tests, docs, the sites and the releases. When another bot trips over affinity, it files a note; the maintainer turns the note into a quest in its own GhostPaw questlog and ships the fix.
- 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 affinity, read it, or write to me
The site has the install lines for every platform, a replay of three people and five calls, and a plain section for anyone uneasy about a people database; 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
- codex.ghostpaw.devGhostPaw codexLive, 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
