cairntir
Local-first persistent memory MCP server for Claude Code, Codex, Cursor, Qwen Code, and AI coding agents. Cross-session, cross-agent SQLite memory.
Install / Use
claude mcp add pnmcguire480 -- npx -y github:pnmcguire480/cairntirIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of cairntir
cairntir scores 76/100 on our quality scale, 773rd of 932 AI & Machine Learning skills we index.
Its MCP Server is 5.5 KB long, split into 7 sections with 4 code examples: a solid amount of guidance for an agent.
It has 3 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated yesterday, so cairntir is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
cairntir compared with similar skills
All 4 of these similar skills score higher than cairntir; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| cairntir (this skill)by pnmcguire480 | 76 | 3 | 1d ago | MCP Server |
| claude-memby thedotmack | 100 | 95.1k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 87.5k | 16d ago | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 84.9k | 3d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.2k | today | CLAUDE.md |
Frequently asked questions
- How do I install cairntir?
- Run
claude mcp add pnmcguire480 -- npx -y github:pnmcguire480/cairntir. The install tabs above show the steps for each supported agent. - Which AI agents does cairntir work with?
- It is written for Claude Code, Claude Desktop, Cursor and OpenAI Codex, as a MCP Server file. Other agents that read the same format can often use it too.
- Is cairntir safe to use?
- It is MIT-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is cairntir still maintained?
- The repository was last updated yesterday, so cairntir is actively maintained.
Skill content
View source on GitHubCairntir
Persistent, local-first memory for AI coding agents. Claude Code, Codex, Cursor, Qwen Code, and other MCP clients share one searchable project history.
Cairntir stores decisions, facts, unfinished work, and outcomes as verbatim drawers in a SQLite database you own. A budgeted handoff restores complete drawers across sessions; semantic and file-anchored recall find deeper evidence.
Current release: 1.11.0. See the release evidence and changelog. Published downloads are on PyPI and GitHub Releases.
Install
pip install --upgrade cairntir
cairntir setup
Python 3.11+ is required. Setup initializes the store and configures supported hosts it detects. Restart your agent afterward.
cairntir version
cairntir doctor
For one host or project, use cairntir init --host codex; add --user for
user-scope configuration. Cursor's global User Rule requires a manual paste;
setup prints the rule and reports that step.
Follow the getting-started guide for configuration, verification, recovery, and troubleshooting.
Use
Ask your agent to remember a decision in your project's wing, then start the
next task with cairntir_handoff(wing="myproject"). A wing is a project, a
room is a topic, and a drawer is one verbatim memory.
cairntir handoff myproject
cairntir handoff myproject --task "repair cache invalidation" --budget 8192
cairntir recall "why did we choose Postgres?" --wing myproject
cairntir recall-for-change src/auth.py
cairntir recover --host codex --wing myproject
cairntir cost myproject
Handoff returns whole drawers or names those omitted by its character budget. It includes recent default-layer writes, open predictions, and optional code anchors. Settlements append observed outcomes without rewriting predictions.
Portable evidence preserves source identities and relationships across stores. Evaluated procedures require holdout evidence and local approval; scoped sharing limits access with owner-issued grants.
Host support
| Surface | Support |
|---|---|
| Setup | Claude Code, Cline, Codex CLI, Copilot CLI, Cursor, Gemini CLI, OpenCode, Qwen Code |
| Transcript recovery | Claude Code, Codex, Qwen Code |
| Other MCP clients | Configure the cairntir-mcp stdio command manually |
| Cursor transcripts | Unsupported; an explicit receipt explains the limitation |
Transcript recovery is opt-in, separately budgeted, read-only, and untrusted.
It reads bounded host-owned transcript tails; it cannot recover text the host
never persisted. Saving a recovered request requires explicit selection with
cairntir recover ... --write N. Memory is not automatically made
authoritative merely because it appeared in a transcript or imported file.
Data and safety
The authoritative store is local SQLite with sqlite-vec. Embeddings run
locally; first use may download the embedding model. Optional update checks
contact PyPI, and explicitly selected LLM adapters can contact their provider.
Cairntir is not a sandbox for the agent using it.
Portable JSONL verifies content hashes and optionally HMAC signatures through the Python API. The CLI imports as untrusted and does not verify signatures. Version 1 cannot safely import source-local history references; use a database backup for linked history. Export/import also enforce the format's external-URL restriction. See data handling for backup and trust boundaries.
Build and integrate
The MCP server exposes 21 tools over stdio. Stable Python protocols support custom backends; see the integration guide.
src/cairntir/
├── memory/ # SQLite storage, embeddings, retrieval
├── mcp/ # stdio server and backend
├── reason/ # prediction, experiment, observation
├── recipes/ # composable workflows
└── cli.py # cairntir setup | init | handoff | recover | recall | replay | hotfix | doctor | export | import
tests/ # unit, integration, contract, property, evaluation
docs/ # guides, architecture, recipes, release evidence
Contributing documents the locked development environment and required checks. Tests enforce at least 80% coverage of the measured surface; transport entrypoints are excluded and tested separately. The LongMemEval subset is a regression gate, not a general benchmark claim.
Documentation
- Getting started
- Concepts and data handling
- Multi-host architecture
- Recipes: CodeGlass, Decision Replay, Signal Reader, Bounded Hotfix, and Finalization Mode
- Roadmap
- Security policy · release policy
- Design principles · lineage
Cairntir (CAIRN-teer) combines a cairn, a waypoint of stacked stones, with a seeing-stone. Maintained by Patrick McGuire. MIT licensed.
Related Skills
claude-mem
95.1kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
87.5kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
84.9kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
74.2kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
