by rtk-ai
Permanent memory for AI agents. Single binary, zero dependencies, MCP native.
# Add to your Claude Code skills
git clone https://github.com/rtk-ai/icmLast scanned: 5/25/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-25T08:22:57.685Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}icm is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by rtk-ai. Permanent memory for AI agents. Single binary, zero dependencies, MCP native. It has 456 GitHub stars.
Yes. icm passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/rtk-ai/icm" and add it to your Claude Code skills directory (see the Installation section above).
icm is primarily written in Rust. It is open-source under rtk-ai on GitHub, so you can review or fork the full source.
Yes. SkillsLLM 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 icm against similar tools.
No comments yet. Be the first to share your thoughts!
English | Français | Español | Deutsch | Italiano | Português | Nederlands | Polski | Русский | 日本語 | 中文 | العربية | 한국어
⚠️ Project status: experimental
ICM is pre-1.0 and under active development. Breaking changes can land in any minor release, and hooks/MCP configuration formats may shift.
That said, I (the maintainer) use ICM every day as my primary AI coding memory layer — it's experimental in API stability, not in day-to-day usefulness.
My focus is currently on rtk; ICM updates are merged on a best-effort cadence. Issues and pull requests are welcome but may take longer to review than usual.
ICM is Apache-2.0 licensed and ships as-is, without warranty of any kind (see LICENSE). Before any destructive operation, run the read-only equivalent first (
icm uninstall --dry-run,icm uninstall --check).
ICM gives your AI agent a real memory — not a note-taking tool, not a context manager, a memory.
ICM (Infinite Context Memory)
┌──────────────────────┬──────────────────────────┐
│ MEMORIES (Topics) │ MEMOIRS (Knowledge) │
│ │ │
│ Episodic, temporal │ Permanent, structured │
│ │ │
│ ┌───┐ ┌───┐ ┌───┐ │ ┌───┐ │
│ │ m │ │ m │ │ m │ │ │ C │──depends_on──┐ │
│ └─┬─┘ └─┬─┘ └─┬─┘ │ └───┘ │ │
│ │decay│ │ │ │ refines │ │
│ ▼ ▼ ▼ │ ┌─▼─┐ ┌─▼─┐│
│ weight decreases │ │ C │──part_of──>│ C ││
│ over time unless │ └───┘ └───┘│
│ accessed/critical │ Concepts + Relations │
├──────────────────────┴──────────────────────────┤
│ SQLite + FTS5 + sqlite-vec │
│ Hybrid search: BM25 (30%) + cosine (70%) │
└─────────────────────────────────────────────────┘
Two memory models:
depends_on, contradicts, superseded_by, ...). Filter by label.The point of ICM: you stop re-explaining context every time you switch
AI tools. Tell Claude Code about your project's auth strategy on
Monday — Tuesday's Gemini session already knows it. Hit a Postgres
indexing gotcha in a Codex run — next week's Cursor session finds the
fix in errors-resolved.
This works because every AI tool you configure with icm init reads
and writes the same SQLite database at the OS-standard data
location (e.g. ~/.local/share/icm/memories.db on Linux,
~/Library/Application Support/icm/memories.db on macOS,
%APPDATA%\icm\icm\data\memories.db on Windows):
icm store -t decisions-myapp -c "..." from Claude Code is
immediately visible to Codex, Gemini, Cursor, Roo, Amp, Aider, ...icm recall "query" from any tool searches the same corpus.decisions-myapp, preferences, errors-resolved, ...)
are global — there is no per-tool partition.The multi-agent benchmark below confirms it end-to-end: facts seeded through ICM are recalled with 100% accuracy by Claude Code, Gemini CLI, Copilot CLI, Cursor Agent, and Aider — 98% cross-agent efficiency on the standard test.
If you want isolation (per-project, per-tool, etc.) pass --db <path>
or set ICM_DB_PATH; each path is an independent corpus.
# Homebrew (macOS / Linux)
brew tap rtk-ai/tap && brew install icm
# Quick install (macOS / Linux) — verifies SHA256 against the release checksums
curl -fsSL https://raw.githubusercontent.com/rtk-ai/icm/main/install.sh | sh
# Quick install (Windows PowerShell)
irm https://raw.githubusercontent.com/rtk-ai/icm/main/install.ps1 | iex
# From source
cargo install --path crates/icm-cli
Re-run the install command to upgrade to the latest release. To pin a version, pass --version icm-vX.Y.Z (sh: sh -s -- --version …).
# Auto-detect and configure all supported tools
icm init
Configures 18 tools in one command (full integration guide):
| Tool | MCP | Hooks | CLI | Skills |
|---|---|---|---|---|
| Claude Code | ~/.claude.json |
5 hooks | CLAUDE.md |
/recall /remember |
| Claude Desktop | JSON | — | — | — |
| Gemini CLI | ~/.gemini/settings.json |
5 hooks | GEMINI.md |
— |
| Codex CLI | ~/.codex/config.toml |
3 hooks (PostToolUse opt-in, see #288) | AGENTS.md |
— |
| Copilot CLI | ~/.copilot/mcp-config.json |
4 hooks | .github/copilot-instructions.md |
— |
| Cursor | ~/.cursor/mcp.json |
— | — | .mdc rule |
| Windsurf | JSON | — | .windsurfrules |
— |
| VS Code | ~/Library/.../Code/User/mcp.json |
— | — | — |
| Amp | JSON | — | — | /icm-recall /icm-remember |
| Amazon Q | JSON | — | — | — |
| Cline | VS Code globalStorage | — | — | — |
| Roo Code | VS Code globalStorage | — | — | .md rule |
| Kilo Code | VS Code globalStorage | — | — | — |
| Zed | ~/.zed/settings.json |
— | — | — |
| OpenCode | JSON | TS plugin | — | — |
| Continue.dev | ~/.continue/config.yaml |
— | — | — |
| Aider | — | — | .aider.conventions.md |
— |
| Pi | — | TS ext (TBD) | ~/.pi/agent/AGENTS.md |
/icm-recall /icm-remember |
Or manually:
# Claude Code
claude mcp add icm -- icm serve
# Compact mode (shorter responses, saves tokens)
claude mcp add icm -- icm serve --compact
# Any MCP client: command = "icm", args = ["serve"]
icm init --mode skill
Installs slash commands and rules for Claude Code (/recall, /remember), Cursor (.mdc rule), Roo Code (.md rule), and Amp (/icm-recall, /icm-remember).
icm init --mode cli
Injects ICM instructions into each tool's instruction file:
| Tool | File |
|---|---|
| Claude Code | CLAUDE.md |
| GitHub Copilot | .github/copilot-instructions.md |
| Windsurf | .windsurfrules |
| OpenAI Codex | AGENTS.md |
| Gemini | ~/.gemini/GEMINI.md |
icm init --mode hook
Installs auto-extraction and auto-recall hooks for all supported tools:
| Tool | SessionStart | PreTool | PostTool | Compact | PromptRecall | Config |
|---|---|---|---|---|---|---|
| Claude Code | icm hook start |
icm hook pre |
icm hook post |
icm hook compact |
icm hook prompt |
~/.claude/settings.json |
| Gemini CLI | icm hook start |
icm hook pre |
icm hook post |
icm hook compact |
icm hook prompt |
~/.gemini/settings.json |
| Codex CLI | icm hook start |
icm hook pre |
icm hook post¹ |
— | icm hook prompt |
~/.codex/hooks.json |
| Copilot CLI | icm hook start |
icm hook pre |
icm hook post |
— | icm hook prompt |
.github/hooks/icm.json |
| OpenCode | session start | — | tool extract | compaction | — | ~/.config/opencode/plugins/icm.ts |
What each hook does:
| Hook | What it does |
|---|---|
icm hook start |
Inject a wake-up pack of critical/high memories at session start (~500 tokens) |
icm hook pre |
Auto-allow icm CLI commands (no permission prompt) |
icm hook post |
Extract facts from tool output every N calls (auto-extraction) |
icm hook compact |
Extract memories from transcript before context compression |
icm hook prompt |
Inject recalled context at the start of each user prompt |
¹ Codex CLI PostToolUse is off by default. Codex fires PostToolUse on every shell command — a session generates ~14k events / 24h, which floods the store with tool-output bloat (issue #288). Opt in with icm init --with-codex-post-hook if you want it; tune [extraction] first (extract_every, min_score, store_raw = false). MCP + AGENTS.md alone still let Codex save via the icm_memory_store tool.
ICM can be used via CLI (icm commands) or MCP server (icm serve). Both access the same database.
| CLI | MCP | |
|---|---|---|
| Latency | ~30ms (direct binary) | ~50ms (JSON-RPC stdio) |
| Token cost | 0 (hook-based, invisible) | ~20-50 tokens/call (tool schema) |
| Setup | icm init --mode hook |
icm init --mode mcp |
| Works with | Claude Code, Gemini, Codex, Copilot, OpenCode (via hooks) | All 17 MCP-compatible tools |
| Auto-extraction | Yes (hooks trigger icm extract) |
Yes (MCP tools call store) |
| Best for | Power users, token savings | Universal compatibility |
``