AI agent memory · git-native protocol
Your agents
remember.
One private git repo becomes shared, persistent AI agent memory for Claude Code, Codex, Gemini, Kimi and every other agent you run — across sessions, machines and vendors. No server. No plugin. No lock-in.
01 / The problem
Every session
starts at zero.
You spent an afternoon teaching one agent your stack, your rules and where the project stands. Open a new session, a second laptop or a different tool — and it is gone. You are back to reciting your own medical history.
Machine-bound
The agent on your work computer knows your rules. The one on your laptop, your cloud box or your phone starts blank.
Vendor-locked
Claude's memory only feeds Claude, Codex's only feeds Codex. Switch tools and the context you built stays behind.
Agents don't talk
One agent records a gotcha; another agent, one machine over, walks straight into it the next day.
Fragile ownership
A lapsed subscription, a regional block or a lost account can wipe out months of accumulated context overnight.
“On machine A an agent wrote down ‘this deploy script has a nasty gotcha’. The next day, the agent on machine B stepped on the exact same rake.”
02 / How it works
One repo.
One brain.
nestwork is not a service you run — it is a protocol your agents follow. Memory is plain markdown in your own private git repo. Every agent pulls before it reads and commits after it writes, so whatever one agent learns, every other agent can use next session.
Create your private nest
Click Use this template on GitHub and make it private. It is your repo, on your account — nothing is sent to anyone else.
Run one installer per tool
Clone it on each machine and run the installer for Claude Code, Codex, Gemini, Kimi, Hermes or OpenClaw. It wires up session-start loading and sync hooks.
Just keep working
Hooks run pull --rebase before every memory write and commit + push right after. Open any agent on any machine and it already knows you.
Authority chain: when two sources disagree, the higher layer wins — agents never blend conflicting instructions.
03 / Context that scales
Loads like
a skill.
More context is not better context: a model's effective attention is far smaller than its advertised window. So nestwork never dumps your whole history into the prompt.
- Resident tier, ~640 tokens. At startup an agent reads only the core rules and two short summaries — byte budgets are checked by script.
- Topic index. Memory is split into topic files, each with a one-line
descriptionsaying when to read it.memory.mdis a generated routing table. - Open only what matches. Doing a git operation? The agent opens
git-discipline.mdand nothing else. Your memory can grow for years without bloating a single session.
<!-- nestwork:topic-index:begin --> - collaboration.md — defaults: language, time zone, when to act vs ask - engineering.md — coding discipline; read before writing code or tests - environment.md — per-machine paths, ports, quirks - git-discipline.md — shared-checkout git rules; read before any git op - methodology.md — estimation & verification; read before reporting - owner.md — who the user is, identity, stack - tooling.md — agent tool configs, installers, updates … <!-- nestwork:topic-index:end -->
04 / What you get
Everything is
a text file.
No server, ever
No database, no daemon, no hosted API. Git already solves storage, history and conflicts — nestwork reuses it. Memory is plain files you can read anywhere.
Six tools, one brain
Installers for Claude Code, Codex CLI, Gemini CLI, Kimi Code, Hermes and OpenClaw, plus a generic installer for any markdown-configured agent.
Built for many agents
Each agent owns agents/<host>/<id>/. Atomic per-write hooks pull, write, commit and push with retry — dozens of agents, no clobbering.
Topic memory
Skill-style routing: a generated index plus topic files. A --check guard fails on stale indexes, missing descriptions or oversized files.
Memory distillation
Merge every agent's private notes into shared memory with claude -p or codex exec — a union, never destructive, human-reviewed.
Agent-to-agent mail
One agent leaves a note in its outbox; another agent on another machine reads it when coordinating. No queue, no broker — just a file and a push.
Optional encryption
Turn on git-crypt and your git host only ever sees ciphertext, while agents keep reading and writing plain markdown.
Rescue tool memory
Claude Code, Codex and Kimi each keep memory on one machine. Distill it into your nest so it survives a new laptop, a new tool or a lost account.
05 / Used daily, in production
Dogfooded on
a real fleet.
Source: the author's own private nest, counted 2026-09. Claude Code and Codex are daily drivers; other installers ship but are less battle-tested.
06 / Compare
Protocol,
not plugin.
Most AI agent memory is either a service you have to run or a feature locked inside one tool on one machine. nestwork sits one layer above them: a neutral, portable source of truth any agent can read.
| nestwork | Built-in tool memory | MCP memory server | claude-mem | Per-repo CLAUDE.md / AGENTS.md | |
|---|---|---|---|---|---|
| Infrastructure | A git repo | Local files per tool | A running server | Local worker + SQLite/Chroma | Files in each repo |
| Across machines | ✓ git pull | ✗ one machine | Deploy per machine | ✗ local database | Per repo only |
| Across tools / vendors | ✓ any markdown-config agent | ✗ one tool | MCP clients only | Several (per its README) | Partly |
| User-level memory | ✓ | ✓ | ✓ | ✓ | ✗ project only |
| Multi-agent collaboration | ✓ protocol-level | ✗ | Needs coordination | ✗ per machine | ✗ |
| Version history & review | ✓ git log / diff | ✗ | Depends | Database, not git | ✓ |
| Data ownership | 100% your repo | Local, tool-managed | You | Local database | You |
| Setup cost | Low — you already know git | Zero, but tool-bound | Medium | Medium | Low |
07 / Quickstart · a few minutes
Install nestwork
Create your private repo from the template, clone it on each machine, then run the installer for every tool you use. Open a new session — done.
git clone https://github.com/<you>/<your-nest>.git ~/nestwork
bash ~/nestwork/scripts/install/claude.sh
bash ~/nestwork/scripts/install/codex.sh
bash ~/nestwork/scripts/install/gemini.sh
bash ~/nestwork/scripts/install/kimi.sh
git clone https://github.com/<you>/<your-nest>.git $HOME\nestwork
& $HOME\nestwork\scripts\install\claude.ps1
& $HOME\nestwork\scripts\install\codex.ps1
& $HOME\nestwork\scripts\install\gemini.ps1
& $HOME\nestwork\scripts\install\kimi.ps1
- Claude Code
- Codex CLI
- Gemini CLI
- Kimi Code
- Hermes Agent
- OpenClaw
- generic.sh
Filled = the author's daily drivers. Every installer only edits text between its own markers and ships with an uninstaller; your memory and your other config are never touched.
08 / FAQ
Questions,
answered.
What is nestwork?
nestwork is a git-native memory protocol for AI coding agents. A private git repository holds your rules, preferences, lessons and project context as plain markdown, and every agent you use — Claude Code, Codex CLI, Gemini CLI, Kimi Code, Hermes, OpenClaw — reads and writes that same repository. The result is one persistent, versioned memory that follows you across sessions, machines and vendors.
How do I share memory between Claude Code and Codex?
Clone your nest once per machine and run both installers: scripts/install/claude.sh and scripts/install/codex.sh. Both tools get the same startup protocol pointing at the same repository, so a rule or lesson written in a Claude Code session is available to Codex in its next session, and vice versa. Each tool writes to its own directory, so they never overwrite each other.
Does Claude Code's memory sync across machines?
Not by itself. As of 2026, Claude Code, Codex and Kimi Code all keep their built-in memory on the local machine. nestwork puts the durable part of that context in git, so a new laptop or cloud box gets it with a single git clone. You can also distill a tool's native memory into the nest so it survives a machine change, a tool change or a lost account.
Won't loading all that memory bloat my context window?
No — that is exactly what the protocol avoids. At startup an agent reads only a small resident tier: core rules plus two short summaries, about 640 tokens on the author's nest versus roughly 69,600 for a load-everything startup. Everything else is on demand: memory.md is a generated index of topic files, each with a one-line description of when to read it, and the agent opens only the files that match the current task.
Is nestwork a vector database or a RAG system?
No. There are no embeddings and no retrieval service. Memory is human-readable markdown that you can open, edit, diff and review like any other file in git. Retrieval works the way an agent already uses skills: read a short index, pick the relevant file, read it.
Do I need to run a server or pay for a service?
No. There is no hosted service, daemon or database — only git and a few shell and Python scripts in your own repository. Host it on GitHub, GitLab, a self-hosted Gitea or any git remote you already use. Agents can read memory without a network; on tools with sync hooks, memory writes need the remote to be reachable.
What happens when many agents write at the same time?
Every agent instance owns its own directory, agents/<host>/<agent-id>/, so ordinary memory writes never touch the same file. On tools with hooks, each write runs pull --rebase first and commit + push right after, with retries. Shared memory is only rewritten during an explicit, human-reviewed distillation.
Can I keep sensitive memory private?
Keep the repository private — that is enough for most people. For content that must stay confidential even from your git host, enable the optional git-crypt mode: agents read and write plain text while every commit stores ciphertext. Never store API keys or secrets in memory, encrypted or not; use a secret manager.
How is this different from AGENTS.md or CLAUDE.md?
A per-repository AGENTS.md describes one codebase. nestwork uses the same file format as a startup protocol for a user-level memory repository, so your identity, preferences, cross-project lessons and live project state travel with you into every repository and every tool — while each project's own AGENTS.md keeps working as before.
Can a team use nestwork?
Yes, but start small: one private repository, one directory per agent instance, and human-owned rules in queen/, which agents treat as read-only. The layered authority chain decides whose instruction wins, so shared rules stay stable while each agent keeps its own notes.
09 / Read more
Articles and documentation
- AI Agent Memory — Four Types and Their Trade-offsGuides
- Claude Code Memory Across Machines, Synced with GitGuides
- Share Memory Between Claude Code and CodexGuides
- Codex CLI Memory, AGENTS.md and Persistent RecallGuides
- Agent Memory Tools Compared — Mem0, Letta, Zep and MoreGuides
- Agent Memory Benchmarks — LoCoMo, LongMemEval, BEAMGuides
- AGENTS.md vs CLAUDE.md vs Memory — What Goes WhereGuides
- Load Agent Memory on Demand, Not All at StartupGuides
- Multi-Agent Shared Memory Without Write ConflictsGuides
- Git-Native Memory for AI Agents — Why Git Is EnoughGuides
- Memory Distillation — Consolidating AI Agent MemoryGuides
- Agent-to-Agent Communication with a Git MailboxGuides
- All articles →20
Stop re-explaining yourself to your AI.
A few minutes to set up. Every agent you run from then on starts where the last one stopped.