cavemem

作者 JuliusBrussee已验证

Frozen — cross-agent persistent memory for coding assistants. Still works; the compressed-memory core now ships inside JuliusBrussee/caveman.

674
Stars
61
Forks
TypeScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/JuliusBrussee/cavemem

快速入门

使用 cavemem 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

cavemem

why agent forget when agent can remember

npm Stars Last Commit License

InstallHow it worksCLIMCPSettings

Status: frozen (August 2026). cavemem is no longer in active development. Everything below still installs and works, but expect no new features or fixes. Its compressed-memory core lives on inside caveman — the actively developed home of the family, alongside caveman-browse.


Cross-agent persistent memory for coding assistants. Hooks fire at session boundaries, compress observations with the caveman grammar (~75% fewer prose tokens, code and paths preserved byte-for-byte), and write to local SQLite. Agents query their own history through three MCP tools. No network. No cloud.

Supports: Claude Code · OpenCode · Codex · GitHub Copilot · Augment Code · Cursor (query-only) · Gemini CLI (query-only) · Antigravity (query-only) · IBM Bob (query-only)

  • Persistent memory across sessions. Hooks capture what happened; the store keeps it.
  • Compressed at rest. Deterministic caveman grammar, round-trip-guaranteed expansion for humans.
  • Progressive MCP retrieval. search, timeline, get_observations — agents filter before fetching.
  • Hybrid search. SQLite FTS5 keyword + local vector index, combined with a tunable ranker.
  • Local by default. No network calls. Optional remote embedding providers via config.
  • Web viewer. Read-only UI at http://localhost:37777 for browsing sessions in human-readable form. Token-protected: the worker generates a local bearer token on first start and injects it into the served page, so cavemem viewer still opens with zero friction while /api/* rejects requests without it.
  • Cross-IDE installers. Claude Code, OpenCode, Codex, GitHub Copilot, Augment Code capture observations; Cursor, Gemini CLI, Antigravity, IBM Bob are query-only (MCP search over memory captured elsewhere) — one command each, see the capability matrix.
  • Privacy-aware. <private>...</private> stripped at write boundary. Path globs exclude whole directories.

Install

npm install -g cavemem
cavemem install                    # Claude Code
cavemem install --ide cursor       # cursor | gemini-cli | opencode | codex | copilot | augment | antigravity | bob
cavemem status                     # see wiring + embedding backfill
cavemem viewer                     # open http://127.0.0.1:37777

No daemon to start. Hooks write synchronously. A local worker auto-spawns in the background on the first hook to build embeddings and serve the viewer; it self-exits when idle (set embedding.idleShutdownMs to 0 to keep it running until killed). Disable auto-spawn — and with it the HTTP listener — with cavemem config set embedding.autoStart false.

IDE capability matrix

"Query" means the MCP server can search memory captured elsewhere. "Capture" means this IDE's own sessions write new observations — without it, the DB never fills for that IDE no matter how healthy cavemem status otherwise looks (#58).

IDEcapture (hooks)query (MCP)notes
Claude Code5 hooks: SessionStart, UserPromptSubmit, PostToolUse, Stop, SessionEnd
OpenCodevia bundled bridge plugin¹
Codex CLIno SessionEnd event²
GitHub Copilotno SessionEnd event²
Augment Codeno UserPromptSubmit event²
Cursorquery-only — no hooks system
Gemini CLIquery-only — no hooks system
Antigravityquery-only — no hooks system
IBM Bobquery-only — no hooks system

¹ OpenCode has no hooks.json-style event system. Capture instead goes through a bundled bridge plugin (opencodeBridge.js, symlinked into OpenCode's plugin dir on install) that subscribes to OpenCode's native event and tool.execute.after hooks and shells out to the same cavemem hook run handlers every other IDE uses — same lifecycle coverage, different wiring.

² Copilot's and Codex's hook payloads are close enough to Claude Code's shape that the same handlers are reused unmodified, but neither event set is complete: Codex and Copilot have no SessionEnd, and Augment has no UserPromptSubmit. Every other lifecycle moment still fires and gets written.

Run cavemem status after installing to see which IDEs are wired up, with query-only ones flagged inline (ides: claude-code, antigravity (query-only)).

Windows

Claude Code runs hook commands through sh -c even on Windows. If Git for Windows' Git\bin isn't on your user Path, sh doesn't resolve, hooks fail silently, and capture quietly stops — cavemem doctor/status keep reporting healthy because the failure never reaches the CLI. Add C:\Program Files\Git\bin (or <scoop dir>\apps\git\current\usr\bin for a Scoop install) to your user Path, then verify with where.exe sh. cavemem doctor and cavemem install both check sh resolvability on win32 and print a warning if it's missing.

Claude Code's hooks docs also describe a shell field ("bash" / "powershell") and a shell-free args exec form. We looked at emitting either instead of the plain sh-shaped command string, but held off: we can't verify those fields against every Claude Code version in the wild, and the current command has no shell metacharacters, so it already tokenizes the same way whether Claude Code runs it through sh or falls back to PowerShell. Once there's a way to gate on a minimum Claude Code version, switching to the shell-free args form would drop the sh dependency entirely.


How it works

session event  →  redact <private>  →  compress  →  SQLite + FTS5
                                                           ↑
                                                MCP queries on demand

What compression looks like in practice:

Input:  "The auth middleware throws a 401 when the session token expires; we should add a refresh path."
Stored: "auth mw throws 401 @ session token expires. add refresh path."
Viewed: "The auth middleware throws a 401 when session token expires. Add refresh path."

Code blocks, URLs, paths, identifiers, and version numbers are never touched. Hook handlers complete in under 150ms. Full bodies fetched on demand via get_observations.


CLI

Command
cavemem install [--ide <name>]Register hooks + MCP for an IDE
cavemem uninstall [--ide <name>]Remove hooks + MCP
cavemem statusSingle dashboard: wiring, DB counts, embedding backfill, worker pid
cavemem config show|get|set|openView/edit settings — schema is self-documenting
cavemem start|stop|restartControl the worker daemon (usually unnecessary — auto-starts)
cavemem viewerOpen the memory viewer in your browser
cavemem doctorVerify installation
cavemem search <query> [--limit N] [--no-semantic]Search memory (BM25 + cosine re-rank)
cavemem compress <file>Compress a file with caveman grammar
cavemem reindexRebuild FTS5 + vector index
cavemem export <out.jsonl>Dump sessions + observations to JSONL
cavemem import <file.jsonl> [--dry-run]Load a JSONL export back in (merge, safe to re-run)
cavemem mcpStart MCP server (stdio)

Manual cross-device transfer: on machine A, cavemem export backup.jsonl. Copy the file to machine B, then on B, stop the worker (cavemem stop), run cavemem import backup.jsonl, and restart it (cavemem start). Records already present are skipped, and imported observations whose ids clash with different local ones get fresh ids — nothing is overwritten, and importing the same file twice is a no-op. Imported observations keep their original compressed content and get picked up by the embedding backfill like any new write — vectors themselves aren't exported.


MCP

Progressive disclosure: search and timeline return compact results; get_observations fetches full bodies.

ToolReturns
search(query, limit?)[{id, score, snippet, session_id, ts}] — BM25 + optional cosine re-rank
timeline(session_id, around_id?, limit?)[{id, kind, ts}]
get_observations(ids[], expand?)Full bodies, expanded by default
list_sessions(limit?)[{id, ide, cwd, started_at, ended_at}]
enrich(query, note?){results: [{title, url, extract, observation_id}]}opt-in web enrichment

enrich is off by default. When enrich.enabled is false the tool is not registered and cavemem makes no network call, ever. When enabled, it searches DuckDuckGo, stores compressed plain-text extracts as observations (tagged source: web + URL for provenance), and returns them.


Settings

<cavemem home>/settings.json, where the cavemem home directory resolves in this order:

  1. CAVEMEM_HOME env var, if set.
  2. An existing ~/.cavemem — zero breaking change for current installs.
  3. $XDG_DATA_HOME/cavemem whenever XDG_DATA_HOME is explicitly set — on any platform, not just Linux. Without the var, Linux uses the XDG default ~/.local/share/cavemem; macOS/Windows keep ~/.cavemem.

Non-absolute env values (no leading / or ~) are ignored, per the XDG spec — otherwise hooks running from a project directory would fragment the store per-project.

Run cavemem doctor or cavemem status to see which directory is actually in use.

KeyDefault
dataDirresolved cavemem home (above)SQLite database, models, pidfile, logs — set this explicitly (e.g. "~/.cavemem") to relocate just the data, independent of where settings.json lives. Only an explicit value is written to settings.json; the default is re-resolved on every load, so the file stays portable across machines
compression.intensity"full"lite / full / ultra
compression.expandForModelfalseReturn expanded text to model
embedding.provider"local"local / ollama / openai
workerPort37777Local viewer port
search.alpha0.5BM25 / vector blend
search.defaultLimit10Default result count
privacy.excludePatterns[]Path globs (e.g. ["**/.env", "**/secrets/**"]) never captured
privacy.redactSecretstrueScrub secret-shaped substrings (API keys, tokens, passwords) with [REDACTED]
capture.excludeTools[]Tool names/globs never captured; wins over includeTools
capture.includeTools[]If non-empty, only these tool names/globs are captured
enrich.enabledfalseOpt-in web enrichment tool

Content inside <private>...</private> is stripped before write. Paths matching excludePatterns are never captured into memory, whether they appear in a tool's file_path/path/notebook_path field or embedded in a command string. The worker binds to 127.0.0.1 only, checks the Host/Origin headers on every request, and requires a local bearer token (<dataDir>/worker-token, mode 0600) on /api/*.


🪨 The Caveman Ecosystem

Four tools. One philosophy: agent do more with less.

RepoWhatOne-liner
cavemanOutput compression skillwhy use many token when few do trick — ~75% fewer output tokens across Claude Code, Cursor, Gemini, Codex
cavemem (you are here)Cross-agent persistent memorywhy agent forget when agent can remember — compressed SQLite + MCP, local by default
cavekitSpec-driven autonomous build loopwhy agent guess when agent can know — natural language → kits → parallel build → verified
cavegemmaGemma 4 31B fine-tuned on caveman pairswhy prompt every turn when weight remember — LoRA + merged bf16 on HF, no system prompt needed

They compose: cavekit orchestrates the build, caveman compresses what the agent says, cavemem compresses what the agent remembers, cavegemma bakes the compression into the model weights. Install one, some, or all — each stands alone.

Also by Julius Brussee

  • Revu — local-first macOS study app with FSRS spaced repetition. revu.cards

License

MIT

常见问题

What is cavemem?

cavemem is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by JuliusBrussee. Frozen — cross-agent persistent memory for coding assistants. Still works; the compressed-memory core now ships inside JuliusBrussee/caveman. It has 674 GitHub stars.

Is cavemem safe to use?

Yes. cavemem 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.

How do I install cavemem?

Clone the repository with "git clone https://github.com/JuliusBrussee/cavemem" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is cavemem written in?

cavemem is primarily written in TypeScript. It is open-source under JuliusBrussee on GitHub, so you can review or fork the full source.

Are there alternatives to cavemem?

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 cavemem against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情