by timgordontg
The Universal Cross-Model Episodic Memory Standard. Local-first, project-scoped SQLite engine for Google Antigravity, Claude Code, Cursor, Codex CLI, GitHub Copilot CLI, and OpenCode. Zero cloud lock-in.
# Add to your Claude Code skills
git clone https://github.com/timgordontg/engrimengrim is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by timgordontg. The Universal Cross-Model Episodic Memory Standard. Local-first, project-scoped SQLite engine for Google Antigravity, Claude Code, Cursor, Codex CLI, GitHub Copilot CLI, and OpenCode. Zero cloud lock-in. It has 304 GitHub stars.
engrim's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/timgordontg/engrim" and add it to your Claude Code skills directory (see the Installation section above).
engrim is primarily written in Python. It is open-source under timgordontg on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh engrim against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
The Universal Cross-Model & Cross-Agent Episodic Memory Standard.
A local-first, project-scoped SQLite memory engine that allows developers to freely switch between models and environments (Google Antigravity, Claude Code, Cursor, Codex CLI, GitHub Copilot CLI, OpenCode, and Windsurf) on the same codebase without losing architectural decisions, user constraints, or project state.
"Why pay for 200,000 tokens of forgotten noise on every turn? The models are disposable utilities; your project's decisions are not."
Engrim is the universal, cross-model episodic memory standard engineered specifically for autonomous AI coding agents and heavy software development.
It solves the "200,000-token context window trap" (where coding models suffer from severe attention dilution, compounding per-turn token costs, and the loss of prior architectural decisions whenever a chat session is cleared) by replacing raw transcript replay with 4,000 characters of high-precision, curated episodic working memory stored in a single, local-first SQLite file (~/.engrim/memory.db).
| Challenge | Without Engrim (Token Bloat & Context Resets) | With Engrim (Episodic Continuity) |
|---|---|---|
| Context Window | Attention Dilution: 150k+ tokens re-sent on every turn; models lose reasoning sharpness and hallucinate past constraints. | Precision Working Memory: ~4,000 chars (<1,000 tokens, <1% of context) injected at boot. Zero attention dilution. |
| Session Clearing | Context Reset on /clear: Clearing chat wipes agent context to zero; you spend minutes re-explaining rules and architecture. |
Continue-As-Clear: Clear anytime (/clear). Decisions, active state, and [โถ RESUME HERE] reload instantly. |
| Agent Ecosystem | Vendor Silos: Decisions made in Claude Code are invisible in Antigravity, Cursor, Codex, Copilot CLI, or OpenCode. | Universal Substrate: One local SQLite store (~/.engrim/memory.db) shared across all 6 major harnesses. |
| Hook Reliability | Silent Failures: Moving across machines or OSes silently breaks hardcoded binary paths with no error message. | Self-Healing Diagnostics: engrim doctor --fix checks the supported hook and MCP configurations and repairs stale binary paths. |
| Data Privacy | SaaS Cloud Leakage: Proprietary code and architectural constraints sent to third-party memory APIs. | 100% Local & Private: Stored locally in SQLite WAL mode (POSIX 0600). No telemetry, no cloud sync, no tracking. |
graph TD
subgraph Agents ["Supported Agent Environments"]
AGY["Google Antigravity<br/>(PreInvocation & Stop Hooks)"]
CLAUDE["Claude Code<br/>(SessionStart & Stop Hooks)"]
CURSOR["Cursor / Windsurf<br/>(Model Context Protocol stdio)"]
CODEX["Codex CLI<br/>(Hooks, guidance & optional MCP)"]
OPENCODE["OpenCode<br/>(Plugin & MCP)"]
COPILOT["GitHub Copilot CLI<br/>(Command hooks & MCP)"]
end
subgraph CoreEngine ["engrim Core Engine (v1.4.11)"]
ADAPTERS["Adapters & Lifecycle Hooks<br/>(agy, claude, opencode, copilot, mcp)"]
DOCTOR["Health & Diagnostic Engine<br/>(engrim doctor --fix)"]
PROVENANCE["Agent Provenance Engine<br/>(origin_agent tracking)"]
ROUTER["Hybrid Retrieval & Minder<br/>(bm25 lexical + vector cosine)"]
end
subgraph Storage ["Local-First SQLite Store (~/.engrim/memory.db)"]
MEMORIES[("Curated Memories<br/>(decisions, facts, feedback)")]
FTS5["FTS5 Full-Text Search<br/>(porter stemmer, triggers)"]
VEC["Vector Embeddings<br/>(model2vec static embeddings)"]
LOG["Flight Recorder Log<br/>(turns + action lines)"]
end
AGY <-->|"hook / CLI"| ADAPTERS
CLAUDE <-->|"hook / CLI"| ADAPTERS
CURSOR <-->|"JSON-RPC (stdio)"| ADAPTERS
CODEX <-->|"command hook / MCP"| ADAPTERS
OPENCODE <-->|"plugin / MCP"| ADAPTERS
COPILOT <-->|"command hook / MCP"| ADAPTERS
ADAPTERS --> PROVENANCE
PROVENANCE --> ROUTER
ROUTER --> MEMORIES
MEMORIES --- FTS5
MEMORIES --- VEC
ADAPTERS --> LOG
engrim injects the top-priority memory pack (~4k chars) into the agent's context, leading with [โถ RESUME HERE].engrim_add) or lifecycle hooks automatically, tracking the origin_agent provenance.bm25) + vector (model2vec) search retrieves relevant records on demand in ~30ms without slowing down the agent./clear. The next session boots from memory.db with zero memory loss.pip install engrim
Run engrim setup without arguments. It automatically detects installed environments on your machine and configures them all:
engrim setup
~/.gemini exists $\rightarrow$ wires Antigravity lifecycle hooks, skill, and MCP server.~/.claude exists $\rightarrow$ wires Claude Code SessionStart, Stop, status line, and CLAUDE.md.~/.cursor exists $\rightarrow$ generates and merges Cursor MCP configuration.~/.codex exists $\rightarrow$ wires Codex CLI native command hooks and managed global AGENTS.md guidance. MCP stays opt-in.~/.config/opencode exists $\rightarrow$ writes OpenCode plugin, registers MCP server, and adds AGENTS.md notes.~/.copilot exists $\rightarrow$ wires Copilot CLI hooks and the Engrim status line, registers the MCP server, and adds copilot-instructions.md notes.engrim doctor)Verify database integrity, semantic recall coverage, and all configured agent hooks across your system:
# Run comprehensive health diagnostic across all agent environments
engrim doctor
# Automatically repair broken hook paths or cross-OS migrations with self-healing PATH fallback
engrim doctor --fix
# Output diagnostic report as JSON (for CI pipelines or health monitoring)
engrim doctor --json
Real output:
================================================================================
๐ฉบ ENGRIM DOCTOR: DIAGNOSTIC HEALTH CHECK
================================================================================
Platform : linux (x86_64) ยท Python 3.12.3
Engrim CLI : /home/user/.local/bin/engrim
Project : /workspace/my-project
[1] Database & Storage Engine
โ Store Location : /home/user/.engrim/memory.db
โ Integrity Check : ok
โ Journal Mode : wal (WAL)
โ Curated Memories : 956 active / 1057 total
(decision=413, fact=178, feedback=47, reference=20, state=283, user=15)
โ Flight Log Turns : 48501 logged
[2] Semantic Recall Engine
โ Model Available : model2vec:minishlab/potion-base-8M
โ Embedded Records : 1032 / 956
[3] Agent Environments & Hooks
Google Antigravity (~/.gemini):
โ PreInvocation hook: valid
โ Stop hook: valid
โ MCP server: /home/user/.local/bin/engrim (valid)
โ Skill deployed: yes
Claude Code (~/.claude):
โ SessionStart hook: valid
โ SessionEnd hook: valid
โ Stop hook: valid
โ UserPromptSubmit hook: valid
Codex CLI (~/.codex):
โ SessionStart hook: valid
โ SessionEnd hook: valid
โ Stop hook: valid
โ UserPromptSubmit hook: valid
โ Managed AGENTS.md guidance: present
โข MCP registration: optional, not configured
GitHub Copilot CLI (~/.copilot):
โ sessionStart hook: valid
โ userPromptSubmitted hook: valid
โ agentStop hook: valid
โ MCP server: /home/user/.local/bin/engrim (valid)
โ Status line: configured
================================================================================
Result: All systems healthy. Zero issues detected across all agent hosts.
================================================================================
<bin> || engrim ... || true) ensuring sessions never experience silent hook failures when directories move or dotfiles sync across machines.PRAGMA integrity_check), active records, and semantic model readiness (model2vec).engrim setup --agy
~/.gemini/config/hooks.json to execute engrim hook --agent agy --event boot on PreInvocation and engrim hook --agent agy --event stop on Stop.~/.gemini/config/skills/engrim/SKILL.md.~/.gemini/antigravity-cli/mcp_config.json and ~/.gemini/config/mcp_config.json.engrim setup --claude
SessionStart, SessionEnd, Stop, and UserPromptSubmit hooks in `~/.claude/setting