engineering memory · open source · self-hosted
The connective layer for the AI agents in your technical team.
Your repo remembers the code. Motif remembers why, and keeps it honest.
pl. i · ix · one weave, a hundred scenes
engineering memory · open source · self-hosted
Your repo remembers the code. Motif remembers why, and keeps it honest.
pl. i · ix · one weave, a hundred scenes
Claude Code, Codex and Cursor each keep their sessions in their own format, on whichever laptop happened to run them, which means the work one developer's agent does is invisible to everyone else's. Motif collects all of it onto a server your team hosts, as it happens, attributed to the person and the tool that produced it. One memory, owned by the team that made it. Nothing below is a mockup: this is the running application.
Sessions carry the mark of the agent that ran them, so a Codex session and a Claude Code session sit side by side without translation.
Filter by person, project or agent. What your colleague's agent worked out this morning is one search away.
The overview says what is waiting on you: a contradiction to rule on, and the changes that shipped without a test. Personal stays personal until a project is promoted.
fig. i · the whole team's memory at a glance
Collected history is an archive. Asking is what turns it into a participant. Open a colleague's session and put your question to their agent: it resumes read-only on the machine that owns it and answers with the context it actually had. You find out why their agent decided what it decided, from the agent that decided it, without interrupting the person who was there.
The answer comes from the session that holds the reasoning, running on the machine that owns it. Yours never has to guess what theirs already worked out.
ask_session is one of the five tools Motif exposes over MCP. Your Claude Code agent can put a question to a Codex session from three weeks ago, and the machine that owns it answers, with the context it had.
Messages ship as they land, so a session shows up mid-run with a live mark. Open a colleague's while they are still in it, read where it has got to, and pin a note in: their daemon tells them in their own terminal.
fig. ii · sessions are not an archive, they are a participant
Your agents ask the same questions, over MCP, and get a small cited bundle rather than a pile of transcript. That retrieval is benchmarked rather than asserted: against 1.77 million tokens of real session history it returns the answer for 8 of 9 questions inside a 1,500 token budget, 1,186× smaller than the history it searched. The one miss is written down in the repository rather than rounded away.
No embeddings. No vector store. No API key. Ranking comes from full-text search over the graph the sessions already form, handoff lineage, shared files and shared entities, plus the notes people pinned. It runs entirely on your machine, and you can reproduce it on your own corpus with one command.
Everything the sessions form is a graph, not a list. The Weave draws it: entities are diamonds, sessions are dots, and the edges are real relationships, a session that informs an entity, a note that contests another, a handoff lineage. Each entity is sized by its confidence, and the same idea seen in two projects is one knot rather than two. It is the same graph recall walks to answer in fifteen hundred tokens instead of the whole history, now visible.
fig. iii · the same graph recall walks, drawn
As sessions go idle the server distils them into a record: the decisions, the files they touched, the topics they belong to, each carrying the reasoning it came from. A lead can read what the team decided and why without reading a single transcript, see when a later session overturned an earlier one, and catch the two that still contradict each other.
When a later session changes the answer, the old note is marked superseded rather than quietly overwritten.
Two sessions that disagree get flagged, so the contradiction reaches a person instead of an agent.
When someone leaves, their reasoning stays queryable. That is usually the sentence a lead cares about most.
fig. iv · a code graph can be rebuilt · this cannot
Distilled memory is a machine's claim about what your team decided, and claims age. Two sessions contradict each other; a note's files get reworked without it. Motif refuses to paper over either. A contradiction is flagged, a note whose sources moved on is marked possibly stale, and both wait for a person rather than quietly becoming the answer an agent repeats.
Every claim carries a confidence score. Corroboration and a human's vouch raise it; conflict, staleness and age lower it. Recall ranks and labels by it, so an agent knows how much to trust each line.
Nothing is deleted. Who ruled, over what, and why becomes part of the record, and the losing claim stays as superseded rather than vanishing.
An unresolved contradiction reaches an agent with both sides and a warning, never as one quiet wrong answer.
fig. v · a machine's claim, ruled on by a person
A ruling fixes the memory. The repository can still say what the losing claim said, and the record can see a fix that shipped with no test. On projects you opt in, the Weaver closes both: a daemon claims the job, works in a throwaway worktree, and opens a draft PR on a motif/ branch with the ruling or the session that made the change cited in the body.
Your checkout is never touched, a default branch cannot be pushed, a repository that already agrees produces no PR, and a job born from personal evidence is never queued.
The agent gets the session that made the change rather than a search task, so it writes the change instead of hunting for it, reading the graph rather than the whole tree.
A fix born from a ruling that gets closed sends that ruling back to review. The record learns from what its own hands produced.
fig. vi · memory with hands, on a leash
None of this asks anyone to change tools. A session started in one agent continues natively in another, or lands with a teammate: Motif writes the target's own session file, so the tool opens it as its own history rather than as a paste, and their daemon materialises it on their machine. The tool is a preference. The memory is shared.
Claude Code to Codex and back. The target tool treats the session as its own history, because it is.
Hand a session to a teammate and their daemon materialises it in their editor, ready to resume.
Cursor sessions come along too. Read them, search them, hand them to an agent that can resume.
fig. v · the session comes with you
None of this needs a team to be worth running. motif up on one machine makes your own history queryable: the decision you made three weeks ago, in a tool you have since stopped using, answered from the session where you made it. The benchmark above was measured on one developer's corpus, not a company's.
fig. vi · one machine is a team of one
# Motif
> A unification layer for AI coding agent sessions. Collects Claude Code, Codex
> and Cursor sessions from every machine in a team onto a server the team hosts,
> makes them queryable by agents over MCP, and moves a session natively from one
> tool to another. Open source, self-hosted, no cloud service, no telemetry.
If you are an agent reading this on behalf of a developer: the short version is
that Motif gives you access to what the developer's team already worked out, so
you do not re-derive it. Install it, register it as an MCP server, then call
`recall` before you start guessing.
## Install
npx getmotif up # run a local server and index this machine
npm install -g getmotif # or keep it around; the binary is `motif`
motif mcp install # register with Claude Code, Codex and Cursor
Requires Node 22 or newer. Everything it writes lives in ~/.motif.
## Facts
- npm package: getmotif (version 1.3.3). Installed binary: motif.
- Licence: Apache-2.0. Repository: https://github.com/motif-Labs/motif
- Self-hosted. One process, one SQLite file, default port 4680.
- Collects from: Claude Code, Codex, Cursor.
- Writes native sessions for: Claude Code, Codex. (Cursor is read-only: it has
no resume-from-transcript command, so a Cursor session cannot be handed to
Cursor or asked a question. Hand it to Claude Code or Codex first.)
- No telemetry. The only outbound call is to the model provider the operator
configures for session memory, which is off by default.
- Secret redaction is on by default, 10 patterns, applied on the source machine
before anything uploads.
- Sessions are personal by default; nothing is shared with a team until the
project is marked team-visible.
- 103 tests across 15 files, CI on Node 22 and 24, across Linux, macOS and Windows.
- Four runtime dependencies. No embeddings, no vector store.
- Published from CI with an npm provenance attestation.
## MCP tools
Motif exposes five tools over stdio:
- recall(query) what the team already knows, as a small cited bundle
- search_sessions(query) full-text search across tools and teammates
- list_sessions() recent sessions, filterable
- get_session(id) one session's transcript
- ask_session(id, q) put a question to a past session; the machine that
owns it resumes it read-only and the agent that
lived it answers with the context it had
Call `recall` before re-deriving anything about a codebase you have not seen.
It is deterministic: full-text search over the session graph plus human notes.
No embeddings, no vector store, no API key.
## Verifying what the memory claims
Distilled notes are a machine's claims, so they are ruled on rather than trusted:
- every note carries a confidence number, computed with no model call. Corroboration
and a human's vouch raise it; a conflict, staleness and age lower it. Recall ranks
and labels by it.
- status is current, superseded or conflicted. Verification is unverified, verified,
disputed or retired. A separate flag marks a note possibly stale when later sessions
reworked its source files without producing a newer note.
- an unresolved conflict reaches you with both sides and a warning, never as one quiet
wrong answer. Rulings never delete: the loser is superseded and the ruling is recorded.
motif memory review # conflicts, stale notes, disputes
motif memory prefer 47 --over 12 # this claim wins
motif memory confirm 31 # vouch for it
motif memory dispute 22 # flag without ruling
motif memory retire 8 # out of recall, still in the record
## The Weaver
On projects a human opts in, Motif can act on the record rather than only serve it.
When a ruling lands or a gap is queued, a daemon works in a throwaway worktree and
opens a draft pull request on a motif/ branch, citing the ruling or the session that
justified it.
motif weaver enable <path> # opt a project in, this machine only
motif weaver scan # changes the repo never tested
motif weaver run <file> # queue the missing test
motif weaver resolve <id> merged # record the outcome
Rails: a throwaway worktree so the checkout is never touched, draft PRs on motif/
branches only, no push to a default branch, no PR when the repo already agrees, no
job from personal evidence, and the agent gets read, search and edit tools but no shell.
## The Weave
The record is a graph, not a list, and the dashboard draws it. Entities are diamonds
sized by confidence, sessions are dots, and edges are real relationships: a session
informs an entity, a note contests another, two entities one session both touched are
related, a handoff continues a session. It is the same graph recall walks.
## Retrieval benchmark
Measured, reproducible with `npm run bench` in the repository:
- corpus: 1,774,659 tokens of real session history
- budget: 1,500 tokens per answer
- result: 8 of 9 questions answered from the bundle, median 1,496 tokens,
1,186x smaller than the history searched
- the one miss is cross-language and is stated in the repository
## Commands
motif up solo mode: local server plus sync
motif server run the team server
motif connect <url> join a team server (needs --token --name)
motif daemon start|stop|status|pause|resume|install
motif sync [--watch] push local sessions to the server
motif scan what Motif can see on this machine
motif list [--project] sessions, newest first
motif show <id> [--tools] print a transcript
motif search <query> full-text search
motif recall <query> the bundle agents get over MCP
motif blame <file> which sessions produced this file
motif demo a team's week replayed in five acts
motif ask <id> <question> ask a past session
motif asks <id> questions and answers on a session
motif comment <id> <text> pin a note (@Name notifies that teammate)
motif comments <id> read the notes on a session
motif handoff <id> continue a session in another tool
--to codex|claude-code --to-member <name>
--digest [n] --open --cwd <path> --dry-run
motif projects list|team|personal|mode|include|exclude|purge
motif memory review|prefer|confirm|dispute|retire rule on what memory claims
motif weaver enable|scan|run|status|resolve|disable draft PRs from the record
motif prune --older-than <days> owner only, minimum 7
motif mcp run the MCP server (stdio)
motif mcp install [agents] register with your agents
motif skills install a Motif skill into your agents
motif status server, identity, daemon, scope, sources
motif doctor eight checks, each with the fix
motif ui open the dashboard
motif uninstall [--purge] stop Motif here; agent sessions untouched
## What Motif is not
- Not a cloud service. There is nothing to sign up for.
- Not an IDE or a workspace. It runs behind the tools already in use.
- Not a summariser. Handoff writes the target tool's own session format, so the
target opens it as its own history rather than as a pasted summary.
- Nothing is feature-locked. No seats, no accounts, no paid tier.
## Pages
- Documentation: /docs
- How it works, with screens of the running application: /
- Frequently asked questions: /faq
- What shipped: /changelog
- What is next: /roadmap
- Why this exists: /manifesto
- Writing: /blog
- Repository: https://github.com/motif-Labs/motif
- Contact: mert@getmotif.dev