activeloopai/hivemind
Hivemind turns your traces into reusable skills across agents
About activeloopai/hivemind
activeloopai/hivemind is an open-source project on GitHub, mainly written in TypeScript. Hivemind turns your traces into reusable skills across agents It currently holds 1,618 stars and 0 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).
Project Overview
AI Homed tracks it on the AI Agent Memory board.
GitHub Repository Details
README
Hivemind
One brain for all your agents
Auto-learning, cloud-backed shared brain for Claude Code • OpenClaw • Codex • Cursor • Hermes • pi • Claude Cowork (Alpha) agents.
One engineer's agent figures out a tricky migration on Monday.
> Tuesday, every agent on the team can execute the pattern.
On LoCoMo, the public long-context memory benchmark, Hivemind is 25% cheaper, 1.7× fewer tokens, and 31% fewer turns than running without shared memory. (See the numbers below.)
Beyond memory. Hivemind doesn't just remember. It mines your team's traces for repeated patterns and codifies them into reusable skills that propagate back into every agent on the team. The agent your junior engineer used this morning is sharper because of what your senior engineer's agent figured out last week.
- 📥 Captures every session's prompts, tool calls, and responses as structured traces in Deeplake
- 🧠 Codifies patterns into reusable
SKILL.mdfiles, available to every agent on your team - 🔍 Searches traces and skills with hybrid lexical + semantic retrieval (ILIKE lexical fallback when embeddings off)
- 🔗 Propagates capability across sessions, agents, teammates, and machines in real time
- 📁 Intercepts file operations on
~/.deeplake/memory/through a virtual filesystem backed by SQL - 📝 Summarizes sessions into AI-generated wiki pages via a background worker at session end
- ☁️ BYOC: keep data in your own GCS, Azure, S3, or on-prem bucket. See Security & storage
Benchmarks
On the LoCoMo long-context memory benchmark (100 QA pairs, Claude Haiku via claude -p, hybrid lexical + semantic retrieval), Hivemind cuts cost, tokens, and turns versus a no-memory baseline:
| Metric | Baseline | Hivemind | Improvement | |-------------------|----------|----------|------------------| | Cost / 100 QA | $8.94 | $6.65 | 25% cheaper | | Tokens / question | 1,700 | 1,008 | 1.7× fewer | | Turns / question | 8.9 | 6.2 | 31% fewer |
The agent reaches the answer in fewer turns with less context, because the prior work is already in scope at recall time, not re-derived per session.
Quick start
One command, all your agents.
macOS / Linux
curl -fsSL https://deeplake.ai/hivemind.sh | sh
Windows — in PowerShell:
irm https://deeplake.ai/hivemind.ps1 | iex
Any platform, via npm — for CI and Dockerfiles, or where policy blocks piping a downloaded script to a shell. Skips the checks the installers do, so Node 22+ and a writable npm prefix are on you:
npm i -g @deeplake/hivemind && hivemind install
The installer detects every supported assistant on your machine (table below), wires up the hooks, and shows a one-line consent prompt before opening a browser for sign-in. Restart your assistants after install.
Headless / CI installs: pass an API token instead of using the browser flow:
HIVEMIND_TOKEN= hivemind install
or
hivemind install --token
Get a token from your account settings on https://deeplake.ai. With no token in a non-interactive shell, the install completes with hooks but skips sign-in; run hivemind login later to enable shared memory.
Install for a specific assistant only:
hivemind install --only claude
hivemind claude install # equivalent
hivemind codex install
hivemind claw install
hivemind cursor install
hivemind hermes install
hivemind pi install
hivemind claude_cowork install # Alpha
Check what's wired up:
hivemind status
Supported assistants:
| Platform | Integration | Auto-capture | Auto-recall |
|------------------|--------------------------------------------------|--------------|-------------|
| Claude Code | Marketplace plugin | ✅ | ✅ |
| OpenClaw | Native extension | ✅ | ✅ |
| Codex | Hooks (hooks.json) | ✅ | ✅ |
| Cursor | Hooks (hooks.json 1.7+) | ✅ | ✅ |
| Hermes Agent | Shell hooks (config.yaml) + skill + MCP server | ✅ | ✅ |
| pi | Extension API (pi.on(...)) + skill + AGENTS.md | ✅ | ✅ |
| Claude Cowork 🅰️ | MCP server (Claude Desktop) | 🅰️ Alpha¹ | ✅ |
🅰️ Claude Cowork is Alpha. Auto-recall (the hivemind_search / read / index tools) is solid. ¹Auto-capture covers Local Agent Mode sessions only — those write a transcript we can tail; plain desktop-chat turns leave no readable local trace and aren't captured (why).
Alternative install paths
Claude Code plugin marketplace
If you prefer Claude Code's native plugin marketplace:
/plugin marketplace add activeloopai/hivemind
/plugin install hivemind
/reload-plugins
/hivemind:login
Auto-updates on each session start. Manual update: /hivemind:update.
OpenClaw ClawHub
openclaw plugins install clawhub:hivemind
Then type /hivemind_login in chat, click the auth link, and sign in.
Commands
| Command | Description |
|---------|-------------|
| /hivemind_login | Sign in via device flow |
| /hivemind_capture | Toggle capture on/off |
| /hivemind_whoami | Show current org and workspace |
| /hivemind_orgs | List organizations |
| /hivemind_switch_org | Switch organization |
| /hivemind_workspaces | List workspaces |
| /hivemind_switch_workspace | Switch workspace |
| /hivemind_update | Check for plugin updates |
Auto-recall and auto-capture are enabled by default. Data is stored in the same sessions table as Claude Code and Codex.
Coexistence with memory-core
Hivemind runs alongside OpenClaw's built-in memory-core plugin. It does not claim the memory slot, so memory-core's dreaming cron ("0 3 *") and other memory-slot-dependent jobs keep working. Hivemind captures session activity and exposes its own commands; memory-core keeps owning recall/promotion/dreaming.
Troubleshooting
- Hivemind seems slow or unresponsive. Check the agent model in
~/.openclaw/openclaw.jsonunderagents.defaults.model. Hivemind makes many small tool calls per turn; a large reasoning model like Opus will feel sluggish. Recommended default:anthropic/claude-haiku-4-5-20251001. openclaw modelsays "plugins.allow excludes model". Themodelplugin CLI is disabled by default. Edit~/.openclaw/openclaw.jsondirectly (keyagents.defaults.model) and restart the gateway:systemctl --user restart openclaw-gateway.service.- Model switch rejected as "not allowed". Use the exact dated provider-prefixed ID (
anthropic/claude-haiku-4-5-20251001,anthropic/claude-sonnet-4-6). Legacy IDs likeclaude-3-5-haiku-latestand unprefixed bare IDs are not on OpenClaw's allowlist. - Self-update via Telegram fails with "elevated is not available".
tools.elevated.allowFrommust includetelegrambefore elevated commands work from that channel. Safer alternative: run the upgrade in a local shell withopenclaw plugins update hivemind. npm error EACCESduring self-update. OpenClaw was installed under a root-owned npm prefix (e.g./usr/lib/node_modules/openclaw). Reinstall under a user-writable prefix, or run the update with appropriate privileges locally, not via a channel.
Codex (manual)
Tell Codex to fetch and follow the install instructions:
Fetch and follow instructions from https://raw.githubusercontent.com/activeloopai/hivemind/main/harnesses/codex/INSTALL.md
Or run the installer script directly:
git clone https://github.com/activeloopai/hivemind.git ~/.codex/hivemind
~/.codex/hivemind/harnesses/codex/install.sh
Restart Codex to activate.
First launch — trust the hooks. Codex shows a "Hooks need review" prompt before it will run hivemind's hooks:
Hooks need review
2 hooks are new or changed.
Hooks can run outside the sandbox after you trust them.
1. Review hooks
› 2. Trust all and continue
3. Continue without trusting (hooks won't run)
Choose 2. Trust all and continue — otherwise the hooks won't run and hivemind stays inactive.
Cursor (1.7+)
The unified installer wires six lifecycle events in ~/.cursor/hooks.json: sessionStart, beforeSubmitPrompt, postToolUse, afterAgentResponse, stop, sessionEnd. Hooks fork a Node bundle at ~/.cursor/hivemind/bundle/ per event. Restart Cursor after install to load.
hivemind cursor install
Auto-capture is enabled the same way as Claude Code / Codex / OpenClaw.
Hermes Agent
Wires shell hooks into ~/.hermes/config.yaml (pre_llm_call / post_tool_call / post_llm_call / on_session_end) for auto-capture, drops the bundle at ~/.hermes/hivemind/bundle/, registers the shared MCP server (~/.hivemind/mcp/server.js) under mcp_servers.hivemind, and installs agentskills.io-compatible skills at ~/.hermes/skills/hivemind-memory/ (recall), hivemind-goals/ and hivemind-graph/. Re-running install (or hivemind update) syncs these directories: files a previous version wrote that the current one no longer ships are removed; anything else under ~/.hermes/skills/ is left untouched.
hivemind hermes install
pi (badlogic/pi-mono coding-agent)
Upserts an idempotent BEGIN/END marker block into ~/.pi/agent/AGENTS.md (auto-loaded every turn) and drops a TypeScript extension at ~/.pi/agent/extensions/hivemind.ts. The extension subscribes to pi's lifecycle events (session_start / input / tool_result / message_end) for auto-capture and registers hivemind_search, hivemind_read, hivemind_index as first-class pi tools.
hivemind pi install
Note: no per-agent SKILL.md is dropped under ~/.pi/agent/skills/; pi reads skills from both that directory AND the shared ~/.agents/skills/ location. If the codex installer has run on the same machine, pi picks up the hivemind skill from the shared ~/.agents/skills/hivemind-memory symlink automatically. The AGENTS.md block plus the registered tools cover the action surface in either case.
Claude Cowork (Alpha)
Claude Cowork is Anthropic's agentic assistant inside the Claude Desktop app. It has no hook lifecycle like the other agents — it only talks to Hivemind through MCP — so the integration works differently and ships as Alpha.
hivemind claude_cowork install
This registers the shared MCP server (~/.hivemind/mcp/server.js) under mcpServers.hivemind in Claude Desktop's claude_desktop_config.json. Fully quit and reopen Claude Desktop to load it.
Recall (stable). Cowork gains hivemind_search, hivemind_read, and hivemind_index — the same shared memory every other agent reads. On the first tool use per host, a one-time data-collection notice is prepended to the result.
Auto-capture (Alpha) — how it works. With no SessionStart/Stop hooks to capture from, the MCP server runs a background ingester that tails Cowork's Local Agent Mode transcripts (~/Library/Application Support/Claude/local-agent-mode-sessions//.claude/projects//.jsonl). For each new line it writes a row to the sessions table with agent="claude_cowork" (user prompts, assistant messages, tool calls + results), de-duplicated by a per-transcript line watermark. When a transcript has been idle for 5 minutes it is treated as finished, and the same wiki-worker / skillify workers every other agent uses run for it (summary tagged claude_cowork → it shows up in hivemind_index).
Known limitation. Only Local Agent Mode** sessions (where Cowork opens its sandbox/agent and works) write a transcript we can read. Plain desktop-chat turns are not captured: by MCP design a server never sees the conversation (only the tool calls the model makes), and the chat itself lives in Anthropic's cloud + a compressed claude.ai IndexedDB cache with no supported read surface. Capturing those would need an official Anthropic export/hook.
Uninstall
hivemind uninstall # remove from every detected assistant
hivemind codex uninstall # remove from one
How it works
Capture → Codify → Propagate → Compound. Every coding-agent interaction (prompt, tool call, response) is captured as a structured trace in Deeplake. A background worker mines traces for repeated patterns and codifies them into SKILL.md files, scoped to your workspace. Codified skills propagate into every Hivemind-connected agent's context at inference time. The agent your junior engineer used this morning is sharper because of what your senior engineer's agent figured out last week.
Features
🔍 Natural search
Just ask your agent naturally:
"What was Emanuele working on?"
"Search traces for authentication bugs we've solved"
"What did we decide about the API design?"
"Show me skills my team has codified for handling migrations"
🔒 Privacy controls
Disable capture entirely:
HIVEMIND_CAPTURE=false claude
Disable capture for a specific directory tree (persistent, travels with the repo) by dropping a .hivemind file with { "collect": false }. See Per-directory config.
Enable debug logging:
HIVEMIND_DEBUG=1 claude
⚠️ Data collection notice
This plugin captures session activity and stores it in your Deeplake workspace:
| Data | What's captured | |-----------------------|------------------------------------| | User prompts | Every message you send | | Tool calls | Tool name + full input | | Tool responses | Full tool output | | Assistant responses | The agent's final response | | Subagent activity | Subagent tool calls and responses | | Codified skills | Patterns extracted from traces |
All users in your Deeplake workspace can read this data. That's the design. Shared capability requires shared substrate. A DATA NOTICE is displayed at the start of every session. Workspace-level isolation prevents data leakage between orgs.
Configuration
| Variable | Default | Description |
|---------------------------|---------------------------|--------------------------------------------|
| HIVEMIND_TOKEN | _(none)_ | API token (auto-set by login) |
| HIVEMIND_ORG_ID | _(none)_ | Organization ID (auto-set by login) |
| HIVEMIND_WORKSPACE_ID | default | Workspace name or id (hivemind workspaces) |
| HIVEMIND_API_URL | https://api.deeplake.ai | API endpoint |
| HIVEMIND_TABLE | memory | SQL table for summaries and virtual FS |
| HIVEMIND_SESSIONS_TABLE | sessions | SQL table for per-event session capture |
| HIVEMIND_MEMORY_PATH | ~/.deeplake/memory | Path that triggers interception |
| HIVEMIND_CAPTURE | true | Set to false to disable capture |
| HIVEMIND_CAPTURE_ONLY_CLI | _(none)_ | Set to true to capture only interactive CLI sessions. Sessions spawned by the Claude Agent SDK (Python/TypeScript) are skipped; their CLAUDE_CODE_ENTRYPOINT is sdk-py / sdk-ts, so they fail the substring check for cli. |
| HIVEMIND_SKILLIFY_EVERY_N_TURNS | 20 | Assistant turns between auto skill-mining attempts. Lower = more frequent mining (cheaper sessions, noisier output); higher = fewer attempts on longer histories. |
| HIVEMIND_SUMMARY_EVERY_N_MSGS | 50 | Captured events between periodic session summaries. The first summary of a session runs at 10 events regardless. Raise it to cut background summary runs. |
| HIVEMIND_SUMMARY_EVERY_HOURS | 2 | Time-based summary cadence, used when at least one new event has arrived since the last summary. |
| HIVEMIND_WIKI_WORKER | _(none)_ | Set to 1 to disable the background session-summary worker entirely (no claude -p summary runs). Also set automatically inside the worker as a recursion guard. Capture and recall keep working. |
| HIVEMIND_GRAPH_ON_STOP | _(none)_ | Set to 0 to disable the code-graph rebuild that runs on Stop / SessionEnd. |
| HIVEMIND_EMBEDDINGS | _(none)_ | Read once, when ~/.deeplake/config.json has no embeddings.enabled yet: unset or false seeds it off, any other value (true, 1, ...) seeds it on. Afterwards only hivemind embeddings install/enable (persist on) and disable/uninstall (persist off) change it. |
| HIVEMIND_DEBUG | _(none)_ | Set to 1 for verbose hook debug logs |
Per-directory config (.hivemind)
The variables above set one global identity for the whole machine. A .hivemind file lets a specific directory tree override that: either route it to a different org/workspace, or opt out of capture entirely.
Routing is symmetric — a routed directory both writes its traces to that workspace and reads memory from it. Sessions started under it search, recall, and browse ~/.deeplake/memory in the routed workspace, and hivemind whoami reports it.
Drop a .hivemind JSON file at the root of the tree you want to configure:
{
"orgId": "acme-corp",
"workspaceId": "client-work",
"collect": true
}
| Field | Effect |
|---------------|-------------------------------------------------------------------------------|
| orgId | Route this tree to this org — captured traces and memory reads. |
| workspaceId | Route to this workspace. |
| collect | false → never capture traces from this tree. Reads still route. |
Any field may be omitted; omitted fields fall back to your global identity.
orgId / workspaceId are identity (they apply to reads and writes alike); collect is a capture switch (writes only). The two are independent, which is what makes the read-only recipe below work.
Three common recipes:
// route this repo to a client org/workspace — reads and writes both land there
{ "orgId": "acme-corp", "workspaceId": "client-work" }
// never collect traces from this folder (e.g. a personal or sensitive repo)
{ "collect": false }
// read a shared workspace's memory, but never write to it
{ "workspaceId": "client-work", "collect": false }
Routing never carries a token — auth stays in ~/.deeplake/credentials.json, so a .hivemind only ever takes effect against orgs your existing login already authorizes. An HIVEMIND_ORG_ID / HIVEMIND_WORKSPACE_ID set in your environment wins over a .hivemind for that field; hivemind whoami discloses which one is in effect.
Committed vs local
Two filenames are recognized, mirroring the .env / .env.local convention every dev already knows:
| File | Commit it? | For |
|------|-----------|-----|
| .hivemind | Yes (like .editorconfig) | The repo declaring where its traces belong (or that it's off-limits). Teammates who clone inherit it. |
| .hivemind.local | No (gitignore it) | Your personal override or opt-out, not imposed on teammates. Wins over .hivemind in the same directory. |
There's nothing to hide: a .hivemind can't carry a token (see below), so committing one is safe. It just declares intent. Use .hivemind.local only when a choice is yours alone (add it to your repo's .gitignore, like .env.local).
A copy-ready template lives at .hivemind.example. Run cp .hivemind.example .hivemind and edit. (The .example file is inert; Hivemind only reads .hivemind and .hivemind.local.)
How it resolves
When a session starts, Hivemind walks up from the working directory (cwd, its parent, its grandparent, and so on) and uses the first file it finds (a .hivemind.local beats a .hivemind in the same directory). Nearest wins; ancestors above it are ignored. This is the .git/.gitconfig model, not .gitignore-style merging. There is no inheritance: a leaf file that wants both its parent's org and its own workspace must state both.
~/work/.hivemind { "orgId": "acme-corp" }
~/work/client/.hivemind { "workspaceId": "sensitive", "collect": false }
session in ~/work/client/svc/ → uses client/.hivemind ONLY
(collect:false wins; the org above is NOT inherited)
session in ~/work/other/ → no .hivemind found → global identity
Precedence is the conventional env > file > login: an explicitly-set HIVEMIND_ORG_ID / HIVEMIND_WORKSPACE_ID overrides a .hivemind routing value (that field is left untouched), which in turn overrides your logged-in default. collect: false is a fail-safe opt-out and is always honored.
Safety: routing is disclosed, not hidden
Because a .hivemind travels with a rep