memini
The memini server gives AI coding agents persistent, local-first project memory and mistake-prevention guardrails across sessions. It allows agents to recall context, check files for risks before editing, and record various types of memories to avoid repeating mistakes.
recall_project_context— Load the most important project memories (failed attempts, fragile files, decisions, deployment rules) at the start of a task, so the agent begins with relevant context instead of starting from scratch.check_before_editing— Check whether a file has recorded risks, failed attempts, or fragile-file warnings before editing it, enabling pre-edit guardrails especially for configuration and deployment files.remember_decision— Record an important design or implementation decision and its rationale, preventing future sessions from unknowingly reversing it.remember_failed_attempt— Record an approach that was tried and failed (what was tried, why it failed, and the actual fix if known), so no future session repeats the same mistake.remember_fragile_file— Mark a file as fragile or risky with awarnorblockseverity, so future sessions receive a guardrail warning or are denied editing access before touching it.end_session_summary— At the end of a work session, record what changed, what worked, and what failed, creating a session summary and proposing durable memories for future reference.
memini
Never the same mistake twice. Mistake-prevention guardrails and persistent project memory for AI coding agents.
AI coding agents are stateless: every session starts with amnesia. The agent that broke your build editing vercel.json on Monday will happily try the exact same edit on Thursday. memini gives each repo a persistent memory of failed attempts, fragile files, decisions, and deployment rules — and force-feeds the relevant warning to the agent at the moment it's about to repeat history.
Not a notebook the agent may choose to read. A guardrail it can't skip.

How it works
Memories live in your repo — a
.memini/folder with a local SQLite index and human-readable, PR-reviewable markdown views. Local-first: nothing leaves your machine.Hooks enforce guardrails — when the agent tries to edit a file with recorded risks, the edit is intercepted before it happens and the recorded lesson is injected:
[WARNING] Editing vercel.json broke the build (recorded 2026-07-03)— Tried changing buildCommand; deploy failed. Actual fix: move checkout server-side and setVITE_STRIPE_USE_SERVER=true.warnseverity: the agent is warned once per session, then may proceed.blockseverity: the edit is always denied until a human archives the memory.
Session start injects a digest of the most important memories (severity-first, token-budgeted).
MCP tools let the agent record what it learns:
remember_failed_attempt,remember_fragile_file,remember_decision,end_session_summary, plusrecall_project_contextandcheck_before_editing.Git-aware staleness — memories hash the files they reference;
pm staleflags memories whose evidence has changed, and stale memories stop firing guardrails until re-verified.
Related MCP server: Projectmem
Quickstart (90 seconds)
cd your-repo
npx -y memini init # creates .memini/ + installs Claude Code hooks
# record your first guardrail
npx -y memini remember failed_attempt \
"Editing vercel.json broke the build" \
-b "Tried changing buildCommand; deploy failed. Fix: move checkout server-side." \
--file vercel.json --severity warnThat's it. Next time any Claude Code session in this repo tries to edit vercel.json, it gets the warning first.
Cursor, Windsurf, and other MCP clients:
claude mcp add memini -- npx -y memini mcp # Claude Code MCP
npx -y memini install-mcp --write cursor # Cursor: MCP + rule + enforced preToolUse hook
npx -y memini install-copilot # GitHub Copilot: enforced preToolUse hook (.github/hooks)
npx -y memini install-mcp # print generic MCP configEnforcement is a chain of gates, and memini covers several:
Before the edit — the edit to a guardrailed file is blocked before it happens.
block→ denied,warn→ the user is prompted with the recorded history. Supported on:Claude Code —
pm initinstalls itCursor (1.7+) —
pm install-mcp --write cursorGitHub Copilot — CLI, cloud coding agent, and VS Code agent mode (preview) —
pm install-copilot
Before the commit — every tool — a git pre-commit guardrail blocks a commit that touches a
block-severity file, no matter which IDE or agent made the edit (Windsurf, Cline, a human…). Installed bypm init(orpm install-hooks --git). Fails open; overridable withgit commit --no-verify.Advisory — any MCP client — the
check_before_editing/recall_project_contexttools, plus an always-applied Cursor rule steering the agent to use them.
Keeping memory useful over time
A memory tool is only as good as what's in it, and it rots if left alone. memini keeps it healthy:
Auto-capture — a Claude Code session-end hook nudges the agent to record durable lessons (a fix that worked, a fragile file, a failed approach) when a session actually changed files, so you don't have to remember to
pm remember. It stays silent on idle sessions.Usefulness tracking — every time a guardrail actually fires, memini counts it.
pm statsshows which memories are pulling their weight and which have never fired.pm review— flags near-duplicates, contradictory guardrails on the same file, and dormant guardrails that have never fired long after creation. All local heuristics, no LLM — you decide what to keep, merge, or archive.Git-aware staleness — memories hash the files they reference; when the code changes, the memory is flagged and stops firing until re-verified (
pm stale/pm verify).
CLI
Command | What it does |
| Set up |
| Record a memory |
| Search memories / preview the agent digest |
| Guardrail check (exit 1 if risks recorded) — usable in CI |
| Manage memories |
| What your memory is doing — guardrail fires, coverage, staleness |
| Surface quality issues: duplicates, contradictions, dormant guardrails |
| Detect and re-verify outdated memories |
| Run the MCP server (stdio) |
| Diagnose setup |
Memory types: decision, failed_attempt, fragile_file, architecture, deployment, client_preference, session_summary.
Scopes: sharing rules across repos
Some lessons are project-specific; some apply to every repo on your machine that belongs to the same org or client. memini has three scopes:
Scope | Where it lives | Use it for |
|
| this repo's failed fixes, fragile files, decisions |
|
| org/client conventions shared by every repo under that folder |
|
| personal rules that follow you everywhere |
cd ~/work/acme && pm init --workspace # one-time: workspace store covering ~/work/acme/*
# from inside any repo under ~/work/acme:
pm remember deployment "DB connections must use org OAuth, never PATs" \
--file "databricks.yml" --severity warn --scope workspace
pm promote <id> --workspace # lift a project lesson that turned out to be org-wideEvery repo under the workspace folder — including ones you create later — gets those guardrails automatically. Resolution walks up the directory tree, like .gitconfig or ESLint configs. Workspace/user file guardrails match by glob (vercel.json matches any repo's vercel.json; config/**/*.yml works too), and wider-scope memories only fire when human-verified — agents can propose memories to project scope only, so a prompt-injected agent can't plant rules that spread across repos. pm doctor shows which scopes are active.
Design principles
Enforced, not advisory. MCP memory tools are optional for the agent; hooks are not. The guardrail path works even if the agent never thinks to check its memory.
Human-readable, PR-able. Every memory renders to markdown under
.memini/that your team reviews like any other change.Git-linked evidence. Memories record the branch, commit, and file hashes they were born from, so claims are verifiable and staleness is detectable.
Local-first. SQLite + markdown in your repo. No accounts, no cloud, no telemetry. Secrets are auto-redacted from memory bodies before they're stored.
Cross-tool. Core is a CLI + files; Claude Code hooks and MCP are thin adapters.
Security
Local-first by design: no server, no account, no telemetry. Secrets are auto-redacted before storage, file references are contained to the repo, and injected memory text is size-capped and framed as data. See SECURITY.md for the full threat model — including the honest limitations (guardrails intercept edit tools, not arbitrary shell; warn is advisory, block is not).
Status
Early (v0.1). Team sync — shared memory across your whole team, with a review workflow — is on the roadmap. Feedback and issues welcome.
License
MIT
Available Tools
6 toolscheck_before_editingA
Check whether a file has recorded risks, failed attempts, or fragile-file warnings BEFORE editing it. Always call this before modifying configuration or deployment files.
Inputs: file_path (required).
end_session_summaryB
At the end of a work session, record what changed, what worked, and what failed. Creates a session summary and proposes durable memories.
Inputs: what_worked (required), what_changed (required), summary_title (required), files, +1 more.
recall_project_contextA
Load the most important project memories (failed attempts, fragile files, decisions, deployment rules) before starting work. Call this at the start of a task.
Inputs: task_description (required).
remember_decisionA
Record an important design or implementation decision and WHY it was made, so future sessions do not relitigate or reverse it unknowingly.
Inputs: body (required), title (required), files.
remember_failed_attemptA
Record an approach that was tried and FAILED, so no future session repeats it. Include what was tried, why it failed, and what the actual fix was (if known).
Inputs: title (required), why_it_failed (required), what_was_tried (required), files, +1 more.
remember_fragile_fileB
Mark a file as fragile/risky so future sessions get a guardrail warning (or block) before touching it.
Inputs: reason (required), file_path (required), severity.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: checking before editing, recalling context, recording decisions, failures, fragile files, and session summary. No overlap in functionality.
All tools follow a consistent verb_noun pattern in snake_case (e.g., recall_project_context, remember_decision). The pattern is predictable and clear.
With 6 tools, the set is well-scoped for managing agent memory and sessions. Each tool covers a specific necessary action without redundancy.
The set covers core memory operations (load, record decisions/failures/fragile files, session summary, pre-edit check). Minor gaps exist, such as no explicit tool to list or forget memories, but the surface is largely adequate.
Maintenance
Related MCP Connectors
Shared memory for coding agents. Stop re-explaining your codebase every session.
Project memory for coding agents: requirements, decisions, code graph and delivery telemetry.
Project memory, documentation and controlled secret access for AI coding agents.
Shared project memory for coding agents: decisions, lessons, guardrails and tasks per repository.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI coding assistants with persistent project memory to retain architectural decisions, code patterns, and domain knowledge across sessions. It stores data locally in a SQLite database, allowing agents to remember, recall, and manage project-specific context using full-text search.6 npmApache 2.0
- AlicenseAqualityAmaintenanceLocal-first memory layer for AI coding agents — captures issues, attempts, fixes, and decisions, and warns at git commit before you repeat a mistake.191,370 PyPI877MIT
- AlicenseAqualityFmaintenanceSelf-improving, verifiable memory for AI coding agents. Learns how you work, stops repeating mistakes, models each project, recalls the right lesson at the right moment. Every memory is signed and tamper-evident. Local-first.82Apache 2.0
- FlicenseNot gradedqualityAmaintenanceProvides AI coding agents with a local-first, persistent memory layer so they can store and semantically recall project-specific and cross-project knowledge, conventions, and error patterns during sessions. It also optionally enables autonomous task queue execution and issue resolution driven by that same memory.-