Skip to main content
Glama

memini

npm version CI memini MCP server

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.

memini demo — an agent is stopped before repeating a recorded deploy mistake

How it works

  1. 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.

  2. 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 set VITE_STRIPE_USE_SERVER=true.

    • warn severity: the agent is warned once per session, then may proceed.

    • block severity: the edit is always denied until a human archives the memory.

  3. Session start injects a digest of the most important memories (severity-first, token-budgeted).

  4. MCP tools let the agent record what it learns: remember_failed_attempt, remember_fragile_file, remember_decision, end_session_summary, plus recall_project_context and check_before_editing.

  5. Git-aware staleness — memories hash the files they reference; pm stale flags memories whose evidence has changed, and stale memories stop firing guardrails until re-verified.

Related MCP server: claude-engram

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 warn

That'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 config

Enforcement 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 Codepm init installs it

    • Cursor (1.7+) — pm install-mcp --write cursor

    • GitHub 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 by pm init (or pm install-hooks --git). Fails open; overridable with git commit --no-verify.

  • Advisory — any MCP client — the check_before_editing / recall_project_context tools, 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 stats shows 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

pm init

Set up .memini/, gitignore, and hooks

pm remember <type> <title> [-b body] [--file f...] [--severity warn|block]

Record a memory

pm recall [query] [--file f] [--digest]

Search memories / preview the agent digest

pm check <path>

Guardrail check (exit 1 if risks recorded) — usable in CI

pm list / show / archive / approve <id>

Manage memories

pm stats

What your memory is doing — guardrail fires, coverage, staleness

pm review

Surface quality issues: duplicates, contradictions, dormant guardrails

pm stale / pm verify <id>

Detect and re-verify outdated memories

pm mcp

Run the MCP server (stdio)

pm doctor

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

project (default)

<repo>/.memini/

this repo's failed fixes, fragile files, decisions

workspace

.memini/ in a parent folder of your repos

org/client conventions shared by every repo under that folder

user

~/.memini/

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-wide

Every 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 tools
check_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_pathYesPath of the file you intend to edit

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses the tool checks for specific items (risks, failed attempts, fragile-file warnings) but does not describe the return format, side effects, or whether it is read-only. Without annotations, the description carries the full burden, and the lack of output schema details leaves some ambiguity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, front-loaded with the core purpose, and contains no extraneous information. Every word serves a purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity (one parameter, no nested objects) and the presence of sibling tools that cover other memory functions, the description adequately outlines the tool's role. However, it could be more complete by describing the return type or typical usage pattern.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single parameter 'file_path', which already has a clear description. The tool's description adds context about configuration or deployment files, but this does not significantly enhance understanding beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool checks for risks, failed attempts, or fragile-file warnings before editing, using specific verbs and resources. It distinguishes itself from sibling tools like recall_project_context or remember_decision, which handle remembering or recalling context rather than checking preconditions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Always call this before modifying configuration or deployment files,' providing clear when-to-use guidance. However, it does not mention when not to use it or contrast with alternative tools like recall_project_context, which could also provide relevant context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
filesNo
what_failedNo
what_workedYes
what_changedYes
summary_titleYes

TDQS

B3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. The description indicates creation and proposing memories but does not disclose side effects, whether it modifies existing data, or if the proposal requires confirmation. The behavioral footprint is partially unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, concise and front-loaded with purpose. No wasted words, though could be slightly more structured with explicit parameter mapping.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Moderate complexity (5 params, 3 required, no output schema). Description covers main intent but lacks details on return value and the meaning of 'proposes durable memories.' Adequate but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must add meaning. It mentions what_changed, what_worked, what_failed but omits files and summary_title. It adds some context but is incomplete for all parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool records what changed, worked, and failed at session end, creating a summary and proposing memories. It distinguishes from sibling remember_* tools which focus on individual items, but does not explicitly differentiate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description specifies 'at the end of a work session,' providing clear context. However, it does not explicitly exclude use during a session or guide when to use this versus sibling tools like remember_decision.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
task_descriptionYesShort description of the task you are about to do

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided. The description discloses loading important memories but does not detail side effects, authentication needs, or how multiple calls behave. It is adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no wasted words. Front-loaded with purpose, followed by usage guidance. Concise and well structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks details on return format or how loaded memories are provided. With no output schema, the description should explain what the agent receives. Adequate but missing completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with a clear description. The tool description adds context on when to call but does not explain how task_description filters memories. Meets baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description specifies the verb 'load' and the resource 'project memories', listing specific types. It clearly distinguishes from sibling tools that record memories rather than recall them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states 'Call this at the start of a task'. While it doesn't mention when-not-to-use or alternatives, the sibling tools provide clear differentiation for recording memories.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

remember_decisionA

Record an important design or implementation decision and WHY it was made, so future sessions do not relitigate or reverse it unknowingly.

ParametersJSON Schema
NameRequiredDescriptionDefault
bodyYesDetails in markdown: what, why, evidence
filesNoRepo-relative file paths this relates to
titleYesOne-line summary

TDQS

A3.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description only states basic write action without detailing behavior like overwrite policy, visibility, or persistence beyond 'record'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with action and resource, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers purpose and parameter hints adequately for a write tool with no output schema; could clarify overwrite vs append behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Adds meaning beyond schema: body should contain 'what, why, evidence' in markdown, files are 'repo-relative', title is 'one-line summary'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verb 'Record' and clear resource 'important design or implementation decision with rationale', distinguishing it from siblings like 'remember_failed_attempt' which focuses on failures.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage when preventing relitigation, but lacks explicit when-not-to-use or comparison to alternatives like 'recall_project_context'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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).

ParametersJSON Schema
NameRequiredDescriptionDefault
filesNo
titleYesOne-line summary of the failed approach
actual_fixNoThe fix that actually worked, if discovered
why_it_failedYes
what_was_triedYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully convey behavioral traits. It correctly indicates a write operation (recording), but does not mention side effects, permissions, or what happens on duplicate entries. Adequate but could be more transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no wasted words. Front-loaded with purpose and clear structure. Highly concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple recording tool with no output schema, the description covers the main inputs but lacks details on return behavior or limitations. Reasonably complete given the complexity, but could be enhanced.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is low (40%). The description adds meaning by listing what to include (what was tried, why it failed, fix) which maps to params, but it omits the 'files' parameter entirely. Partially compensates but incomplete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: to record a failed approach to avoid repetition. It specifies what to include (what was tried, why it failed, actual fix) and distinguishes from sibling tools like remember_decision.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use it (when an approach failed). It implies alternatives like remember_decision for successful decisions, but does not explicitly name them. Clear context provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

remember_fragile_fileB

Mark a file as fragile/risky so future sessions get a guardrail warning (or block) before touching it.

ParametersJSON Schema
NameRequiredDescriptionDefault
reasonYesWhy this file is fragile — what happened when it was mishandled
severityNowarn
file_pathYes

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses the key behavioral trait of affecting future sessions with guardrails. However, it lacks details on persistence, reversibility, or side effects. Since no annotations are present, the description carries the full burden but is only partially sufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single, front-loaded sentence with no wasted words. Efficiently conveys the core purpose and effect.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for basic understanding but incomplete for complex use. Lacks information on workflow context, return value, and how this interacts with other tools like check_before_editing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With only 33% schema description coverage, the description adds no additional meaning to the parameters. It does not explain file_path format, reason purpose, or severity options beyond the schema's defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (mark a file as fragile/risky) and the effect (future guardrail warning or block). It distinguishes itself from sibling tools like remember_decision and remember_failed_attempt by focusing specifically on file fragility.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like check_before_editing or remember_failed_attempt. No 'when not to use' or prerequisites mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 6 tool updatesv0.2.1
    • First observedcheck_before_editing
    • First observedend_session_summary
    • First observedrecall_project_context
    • First observedremember_decision
    • First observedremember_failed_attempt
    • First observedremember_fragile_file

TDQS

A3.8/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: checking before editing, recalling context, recording decisions, failures, fragile files, and session summary. No overlap in functionality.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in snake_case (e.g., recall_project_context, remember_decision). The pattern is predictable and clear.

Tool Count5/5

With 6 tools, the set is well-scoped for managing agent memory and sessions. Each tool covers a specific necessary action without redundancy.

Completeness4/5

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

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides 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.
    13
    Apache 2.0
  • A
    license
    A
    quality
    A
    maintenance
    Local-first memory layer for AI coding agents — captures issues, attempts, fixes, and decisions, and warns at git commit before you repeat a mistake.
    15
    794
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides a persistent, local-first memory for coding agents over MCP, enabling automatic recall and recording of past work, failures, and decisions to reduce repetition and token usage.
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lumayapartners/memini'

If you have feedback or need assistance with the MCP directory API, please join our Discord server