Your AI coding agent
has amnesia.

Codevira gives every AI tool you use a shared, persistent memory of your project — decisions, fix history, code graph, your preferences — and enforces it, blocking the edit before the regression ships.

📁~1 MB per project 🔀lives in your repo 💻machine-to-machine transfer 🔒no cloud ⚖️MIT licensed
terminal
# install once
$ pipx install codevira

# wire up every AI tool on this machine
$ codevira setup
50MCP toolsthe full agent surface
8hook policiesenforcing memory live
<100 mscold startnever blocks your IDE
0cloud dependenciesyour code stays home
The story

Why codevira exists

01 · THE PROBLEM

Brilliant in the moment.
Amnesiac across sessions.

Today's coding agents write code at a senior level — then forget everything when the session ends. You re-explain the architecture. You re-justify old choices. And one day an agent confidently reverts the bcrypt decision you made three months ago, because nothing remembered why.

02 · THE INSIGHT

Remembering isn't enough.
Memory must push back.

Notes that nobody reads don't prevent regressions. Codevira sits in the agent's tool-call path: when an edit would revert a protected decision or re-introduce a fixed bug, the edit is blocked — with the original reasoning surfaced, so human and AI can re-decide deliberately.

03 · THE PHILOSOPHY

Your memory belongs to you.
Not to one IDE. Not to a cloud.

Project memory lives in .codevira/ — human-readable JSONL, git-tracked, diffable, ~1 MB. Switch IDEs, switch machines, switch AI vendors: the memory comes with you. Codevira is built to be a primitive the whole AI ecosystem can build on, not a feature of one tool.

Every AI tool you open reads and writes the same project memory. What one learns, all of them know. What one is forbidden to break, none of them can.
The Codevira design contract
How it works

Four moments in the life of a memory

Watch the loop: a decision is recorded once, shared everywhere, enforced forever — and your agents keep learning on top.

1 Record The AI captures a decision — one MCP call, ~50 tokens.
2 Share Every other AI tool sees it instantly via the same repo files.
3 Enforce Months later, a careless edit is vetoed before the file changes.
4 Learn Skills, preferences, and reflections accumulate on top.
claude code

      
The graph

Memory you can see

Run codevira graph and your project's decision memory renders as an interactive, fully offline HTML viewer — decisions, files, tags, and the lineage between them. This is a live miniature. Drag the nodes. Click one.

decision protected file
D000412
decision

Use bcrypt for password hashing

context
md5 considered and rejected — rainbow-table risk. Re-examine only if a NIST recommendation changes.
do_not_revertsecurityauth
← click any node to inspect it
Generated per-project by codevira graph — searchable, queryable, zero network.
The wedge

Memory that pushes back

🔒

Decision lock 3.5

Mark a decision do_not_revert and the lifecycle hook vetoes any AI edit that would undo it. Now content-aware: an edit blocks only when it actually touches the decision's subject — orthogonal changes pass. Precision, not paranoia.

🛡️

Anti-regression

Commits tagged fix: build a fix-history database. An AI silently re-introducing a fixed bug gets stopped at the door.

📡

Blast-radius veto

Editing a public signature that 12 files depend on? Codevira shows the callers and refuses until the change covers them.

🧠

Working memory

Decay-scored intra-session scratchpad. The agent's train of thought survives context compaction.

⚙️

Skill library

Reusable procedures ("how we rebase here") with git-driven reinforcement — skills that keep failing get archived automatically.

🗺️

Spatial memory

Code-as-space: activity heatmaps, neighborhoods, and what kind of work each part of the codebase affords.

Preference capture 3.3

Learns how you like your AI to work — "keep answers short", "tests first" — distilled from real prompts by an LLM, not regex. Follows you across projects.

🤝

Cross-IDE consensus

When two AI tools write contradicting decisions, codevira surfaces the conflict instead of letting them fight.

📦

Machine transfer 3.3

codevira export setup → one archive → codevira import on the new machine. Memory and learning come with you.

Cross-IDE

One memory. Every tool.

A decision logged in Claude Code shows up in Cursor. A fix recorded today blocks the same regression in Windsurf tomorrow — through MCP plus an auto-generated AGENTS.md every modern tool reads natively.

Claude CodeClaude CodeMCP + hooks
CursorCursorMCP + AGENTS.md
WindsurfWindsurfMCP + AGENTS.md
GitHub CopilotCopilotAGENTS.md
Gemini CLIGemini CLIMCP + AGENTS.md
OpenAI CodexCodexMCP + AGENTS.md
AntigravityAntigravityMCP + AGENTS.md
Model Context ProtocolAny MCP clientstandard protocol
Why not just…

Your tools alone vs. with codevira

Every IDE has some context feature. None of them persist across tools, none of them enforce, and the moment you switch IDEs you start from zero.

Capability IDE alone
(chat history, .cursorrules)
Rules files
(hand-written CLAUDE.md)
Cloud memory
(SaaS recall tools)
Codevira
Memory survives the session
Shared across every IDEpartial
Writes itself (AI-captured)✗ manual
Enforces — blocks reverting edits✗ advisory✗ advisory
Blocks re-introducing fixed bugs
Knows your code graph (blast radius)
Local-first — code never leaves✗ their cloud
Git-tracked, diffable, reviewable
Learns your preferences from real promptspartial
Pricefreesubscriptionfree · MIT

Codevira doesn't replace your IDE's features — it's the layer underneath all of them.

Token economics

Memory is cheaper than amnesia

Re-explaining your project every session costs real tokens — and real money. Codevira's read surface is summary-first by design: one ~500-token call replaces the catch-up conversation entirely.

“Catch me up on this project”

New session, returning agent.

without
~20,000 tk
re-paste architecture · re-read files · re-justify choices
with
~500 tk
one get_session_context() call
~97% less

“What did we decide about auth?”

Mid-session architecture question.

without
~8,000 tk
grep, open 5 files, reconstruct intent — often wrong
with
~250 tk
one search_decisions("auth") call — with the original why
~97% less

A regression ships

The expensive one nobody budgets for.

without
~60,000 tk
bug report · debugging session · re-fix · re-review
with
~0 tk
edit vetoed at the hook — before the file changed
prevented

Illustrative sessions from codevira's own development. The injection side is just as frugal: ≤3 relevant decisions per prompt, 0 tokens when off-topic, ~30 tokens for your style profile.

Machine to machine

Your memory moves with you

New laptop? Two commands. Project memory already travels with git clone — the transfer archive brings your cross-project learning (preferences, learned rules) on top.

old machine → new machine
# old machine — one archive with everything
$ codevira export setup
 codevira-setup.tar.gz
  project memory (.codevira/) + global learning

# new machine
$ pipx install codevira
$ codevira import codevira-setup.tar.gz
 project memory restored
 global learning merged — never overwrites what's already there
$ codevira init   # re-register IDEs, rebuild caches
Moves with git Decisions, sessions, skills, reflections — already in your repo. Clone and they're there.
Moves in the archive Cross-project learning: your preferences and learned rules, merged — not overwritten — into the new machine.
Rebuilt fresh Code-graph caches and indexes are machine-local and regenerate on first run. Nothing to migrate, nothing to break.
Integration

MCP is the SDK

Codevira speaks the Model Context Protocol — the open standard every major AI tool already implements. codevira setup auto-configures everything it detects; here's what it writes, per tool, if you'd rather do it by hand.

# one command — detects installed AI tools, writes MCP configs,
# installs Claude Code lifecycle hooks, generates AGENTS.md
$ codevira setup

 Claude Code    MCP config + 5 lifecycle hooks
 Cursor         MCP config + AGENTS.md
 Windsurf       MCP config + AGENTS.md
 Gemini CLI     MCP config + AGENTS.md

Fully reversible: codevira uninstall removes every system write.

// ~/.claude.json  (written by `codevira setup`)
{
  "mcpServers": {
    "codevira": {
      "command": "/path/to/codevira-python",
      "args": ["-m", "mcp_server"],
      "cwd": "/path/to/your/project"
    }
  }
}

Claude Code also gets lifecycle hooks (PreToolUse / PostToolUse / UserPromptSubmit / Stop / SessionStart) — that's where enforcement lives.

// ~/.cursor/mcp.json
{
  "mcpServers": {
    "codevira": {
      "command": "/path/to/codevira-python",
      "args": ["-m", "mcp_server"],
      "cwd": "/path/to/your/project"
    }
  }
}

Cursor reads the repo's AGENTS.md natively — the decision digest rides along with zero config.

// ~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "codevira": {
      "command": "/path/to/codevira-python",
      "args": ["-m", "mcp_server", "--project-dir", "/path/to/project"]
    }
  }
}

Tools that don't pass cwd get an explicit --project-dir instead.

# Codevira is a standard MCP stdio server — any client in any
# language connects with the usual MCP SDK. Python example:

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

params = StdioServerParameters(command="codevira-python", args=["-m", "mcp_server"])
async with stdio_client(params) as (r, w):
    async with ClientSession(r, w) as s:
        await s.initialize()
        ctx = await s.call_tool("get_session_context", {})

50 tools: decisions, roadmap, code graph, working memory, skills, spatial, consensus, reflections, preferences. TypeScript, Go, Rust, Java MCP SDKs all work the same way.

# No SDK at all? The memory is just files in your repo.
$ cat .codevira/decisions.jsonl | jq '.decision'
"Use bcrypt for password hashing"
"JSONL is the canonical store; SQLite is a rebuildable index"

# Every language that can read a file can read codevira memory.
# That's the point.

Git-tracked, human-readable, vendor-neutral. Your memory survives every tool you'll ever switch to.

CapabilityPythonTS / JSGoRustEvery other language
Decision capture, search & enforcement
Cross-IDE memory via AGENTS.md
Roadmap, sessions, skills, preferences
Code graph + blast-radius analysisextra install
Symbol-level tools (get_signature / get_code)extra install

Python, TypeScript, JS/JSX, Go, and Rust get full symbol tools; for other languages the agent reads the file directly.

Give your agents a memory.

Open source, MIT, local-first. Two commands and every AI tool on your machine shares it.

Get started on GitHub View on PyPI