CLI commands

Every weavekeep command and its options. The same help is built in: weavekeep <command> --help or weavekeep help <command>.

Overview

CommandWhat it does
installConnect Weavekeep to Claude Code, Cursor and Codex
uninstallDisconnect from your agents. Memory is kept unless --purge
statusWhat is stored and which agents are connected
doctorCheck that everything works, and how to fix what doesn't
searchFind memory from earlier sessions
recentRecent sessions for this project
rememberSave a decision or fact
forgetForget items by id
memoryThe editable decisions.md and facts.md files
exportAll memory as JSON lines
scanFind API keys and passwords your agents left in their transcripts
embeddingsThe local model for semantic search, on by default
serveRun the MCP server over stdio. Started by your agent
indexIndex long texts for search now. Runs on its own
hookHandle a hook event from stdin. Called by your agent

Run weavekeep with no command to see whether any agent is connected and the commands you will use most.

Global options

OptionWhat it does
-h, --helpShow help. Works on every command and never runs it
weavekeep help <command>Same as weavekeep <command> --help
-v, --version, versionPrint weavekeep <version>
--no-colorPlain output without colour

Colour is used only when the output is a terminal. It is also turned off when NO_COLOR is set to any non-empty value or TERM=dumb. FORCE_COLOR=1 turns it on even without a terminal; FORCE_COLOR=0 turns it off.

--json is available on status, doctor, search, recent, scan, embeddings and memory import. When such a command fails, it prints {"error": "..."} on stdout and exits 1. export always writes JSON lines.

Results go to stdout. Warnings, errors and progress go to stderr, so you can pipe the output safely.

Exit codes

CodeMeaning
0Success. Also when a search finds nothing, or a scan finds secrets
1The command ran and failed: a check failed, an id was not found, a file could not be written
2Usage error: unknown command or option, missing argument. The usage line is printed with a pointer to --help, for example Unknown option "--limt". Did you mean "--limit"?
130Cancelled: you pressed Ctrl-C at a question. Prints Cancelled.

weavekeep hook is the exception: it always exits 0, so it never blocks your agent.

On a Node older than 22.16, every command except hook prints one line naming your Node version and how to fix it, and exits 1. The standalone executable carries its own Node and is never affected.

A mistyped command gets a suggestion: weavekeep forgte prints Unknown command "forgte". Did you mean "forget"? and exits 2.

Short ids

Tables show the last 8 characters of each id, for example 43d63996. Commands accept the short id or the full id. See Search your memory.

install

weavekeep install [options]

Connect Weavekeep to the coding agents on this machine. Shows every change and asks before writing.

OptionWhat it does
--client <name>Only claude, cursor or codex. Repeat it, or separate names with commas. A named agent is connected even if it was not detected. Default: every agent found
--dry-runShow the changes without making them
--yes, -yDo not ask before writing
--verboseShow the full hook commands and every file change
--command <cmd>Custom hook command prefix, ending in hook. The event name is added after it. Install first runs it with --version (without hook) and refuses it unless it prints weavekeep <version>
--settings <path>Claude Code settings.json to edit. Default: ~/.claude/settings.json. Implies Claude Code
--cursor-rule <dir>Only write the Cursor rule to <dir>/.cursor/rules/weavekeep.mdc, then stop. Works with --dry-run; cannot be combined with --client, --settings or --command. A rule you edited is left alone. Optional: Cursor already gets the Weavekeep skill
--claude-memoryShare Claude Code's own memory notes with your other agents, without asking. See memory import
--no-claude-memoryDo not share them, and do not ask
weavekeep install
weavekeep install --dry-run
weavekeep install --client claude --client codex
weavekeep install --cursor-rule ~/code/shop

Agents are found by their config folder (~/.claude, ~/.cursor, ~/.codex) or their command on PATH (claude, cursor or cursor-agent, codex). --client cursor on a machine without Cursor is refused, so no ~/.cursor folder is made. Install also adds the Weavekeep skill, which tells each agent when to save and search memory: ~/.claude/skills/weavekeep/SKILL.md for Claude Code, and ~/.agents/skills/weavekeep/SKILL.md, shared by Codex and Cursor. It never edits your CLAUDE.md or AGENTS.md. Every changed config file is backed up first, as <file>.bak-<timestamp>; a file Weavekeep created itself is not. Weavekeep keeps the newest 3 of its backups of each file, plus the one from before it first changed the file, and deletes older ones. On a terminal you are asked Apply these changes? [Y/n]; answering no changes nothing and exits 0. Without a terminal the changes are applied. When Claude Code is connected and you have not decided yet, install also asks once whether to share Claude Code's own memory notes with your other agents; --yes and runs without a terminal skip that question and share nothing.

The hooks and the MCP server run Weavekeep by absolute path: the node that ran install and the installed CLI file, or, when install runs from the standalone executable the install script puts in ~/.local/bin, that executable alone ("/home/you/.local/bin/weavekeep" hook session-start, /home/you/.local/bin/weavekeep serve). After upgrading the npm package or Node, run weavekeep install again; the install script replaces the executable in place, so its hooks keep working. weavekeep doctor warns when the hooks run a different copy than the one on your PATH.

Exits 1 when no agent is found or an agent could not be connected. See the agent pages for what changes per agent.

uninstall

weavekeep uninstall [options]

Undo every change install made. Your memory is kept unless you pass --purge.

OptionWhat it does
--client <name>Only claude, cursor or codex (repeatable). Default: every agent with Weavekeep
--dry-runShow the changes without making them
--purgeAlso delete this machine's memory, the whole ~/.weavekeep folder
--yes, -yDo not ask. Required for --purge when there is no terminal
--verboseShow every file change and the backups
--settings <path>Claude Code settings.json to edit. Default: ~/.claude/settings.json
weavekeep uninstall
weavekeep uninstall --client cursor
weavekeep uninstall --purge

See Uninstall for what is restored.

status

weavekeep status [options]

Show what Weavekeep has stored and which agents it is connected to. Never creates a database.

OptionWhat it does
--project <path>Project whose memory files to show. Default: the current project, as for search
--jsonPrint JSON
Memory
  Database   ~/.weavekeep/keep.db (192.0 KB)
  Stored     3 sessions, 8 events across 1 project
  Facts      3 current, 0 replaced or forgotten
  Forgotten  0 events
  Last seen  just now

This project ~/projects/shop
  2 decisions in ~/.weavekeep/memory/shop-3f2a91c0/decisions.md
  1 fact in ~/.weavekeep/memory/shop-3f2a91c0/facts.md

Agents
  ✓ Claude Code  connected: memory tools on, capture on (7 hooks), skill on
  ✓ Cursor       connected: memory tools on, capture on (5 hooks), skill on
  ✓ Codex        connected: memory tools on, capture on (5 hooks), skill on

"Capture" means the recording hooks. The skill is "skill on" when it is current, "skill missing" or "skill outdated" when weavekeep install should be run again (status then says so), "skill edited by you" when you changed the file, and "skill not Weavekeep's" when another file is in its place.

doctor

weavekeep doctor [options]

Check Node, the database, permissions and every connected agent, and say how to fix each problem.

OptionWhat it does
--jsonPrint JSON: a list of checks with check, status (ok, warn, fail), detail and fix

It checks the Node version, SQLite full-text search, the ~/.weavekeep folder and its permissions, the database (that it reads, and that you can write it and its folder), each detected agent's hooks, hook command paths, which Weavekeep the hooks run (an old copy after an upgrade, another install such as the standalone executable next to an npm install, or one in pnpm's versioned store folder), memory tools and skill, and Codex hook trust. Then it runs a test hook and a test MCP server in a temporary folder. It never changes your memory or your agent config.

Exits 1 if any check failed. Warnings alone exit 0. See Troubleshooting.

weavekeep search <words...> [options]

Find memory from earlier sessions: decisions, facts, prompts and replies.

OptionWhat it does
--project <path>Only this project. Default: the current project (see below)
--allEvery project. Cannot be combined with --project
--limit <n>How many results, 1 to 50. Default: 10
--jsonPrint JSON
weavekeep search cart rounding
weavekeep search "src/cart/total.ts" --limit 20

The current project is the folder you run the command in, or, inside a git repository, the repository: from ~/code/shop/src/cart, the nearest folder up to ~/code/shop that already has memory, else ~/code/shop. A --project that does not exist prints a warning. See Search your memory.

recent

weavekeep recent [options]

List recent sessions for this project, newest first.

OptionWhat it does
--project <path>Only this project. Default: the current project, as for search
--allEvery project
--limit <n>How many sessions, 1 to 200. Default: 10
--jsonPrint JSON
weavekeep recent
weavekeep recent --all --limit 20

remember

weavekeep remember <text...> [options]

Save a decision for this project. With --subject and --predicate, save a fact instead.

OptionWhat it does
--project <path>Project to save it under. Default: the current project, as for search
--userSave it for every project, not just this one
--subject <name>What the fact is about
--predicate <rel>The relation, for example uses or deploys_with
--question <text>A question it answers, in your words. Repeat it for 2 to 4. search, recall and prompt memory find it by them; they are never shown
weavekeep remember "Cart totals round half-even"
weavekeep remember "Use pnpm, never npm" --question "which package manager?" --question "how do I install dependencies?"
weavekeep remember sqlite --subject storage --predicate uses

The text can be up to 4,000 characters, and --subject and --predicate up to 200 each. Longer input is refused, not cut: remember exits 1 and saves nothing. --subject and --predicate go together; giving only one is a usage error. A fact replaces the current fact with the same subject, relation and project. Decisions add up and replace nothing. The memory files are updated at once. If the text holds something that looks like a secret, it is saved as [REDACTED:<kind>] and remember says so.

forget

weavekeep forget <id...> [options]

Forget memory items. Ids come from search; the 8-character short id works.

OptionWhat it does
--yes, -yDo not ask first
weavekeep forget 4c9e21aa
weavekeep forget 4c9e21aa 0b77f3d1 --yes

Exits 1, and forgets nothing, if any id is unknown or matches more than one item. An id that is already forgotten is reported as such and skipped. See Forget and export.

memory

weavekeep memory <path|sync|open|import> [options]

Work with this project's Markdown memory files, or copy Claude Code's own memory notes.

SubcommandWhat it does
pathPrint the folder that holds decisions.md and facts.md
syncApply your edits to the files now
openOpen decisions.md in $VISUAL or $EDITOR (or the system default), then apply your edits
importCopy the notes Claude Code saved in its own memory for this project into Weavekeep, read-only
OptionWhat it does
--project <path>Project. Default: the current project, as for search
--allimport only: every project that has Claude Code memory notes
--onimport only: also keep the copies current, at every session start and end
--offimport only: stop, and remove the copies made on this device from Weavekeep. Claude Code's own files are untouched
--jsonimport only: print JSON
weavekeep memory open
weavekeep memory sync
weavekeep memory import --all --on

memory import reads the notes in Claude Code's memory folder for the project and never changes them. A note that has not changed since the last import is skipped; a changed note replaces its earlier copy; a deleted note's copy is removed from memory. Your other agents see each note's name and one-line description at session start and recall finds the full note. Claude Code itself is not given its own notes again. A note you forget stays forgotten until Claude Code changes it. weavekeep status shows how many notes were copied and whether copying is on, and weavekeep doctor says whether it is on.

memory open only starts an editor when it runs in a terminal; otherwise it prints the file's path. Set WEAVEKEEP_OPEN_WITHOUT_TTY=1 to allow a graphical editor such as code -w anyway. See Memory files.

export

weavekeep export [options]

Write everything Weavekeep stores as JSON lines, for backup or inspection. Secrets were removed when stored.

OptionWhat it does
--project <path>Only this project
--include-forgottenAlso forgotten and replaced items
--blobsInclude the full text of large items
--out <file>Write to a file (readable only by you) instead of stdout. - means stdout
weavekeep export > memory.jsonl
weavekeep export --project . --out backup.jsonl

scan

weavekeep scan [options]

Find API keys, tokens and passwords your agents kept in their transcripts, and check the Weavekeep store holds none. Read-only; secrets are shown masked. Matches that look like placeholders or test values are counted but not listed.

OptionWhat it does
--agent <name>Only claude, codex or weavekeep (the store). Repeat it, or separate names with commas. Default: all three
--project <path>Only secrets seen in this project or below it. Default: every project
--allAlso list matches that look like placeholders or test values, marked [unlikely]
--limit <n>How many secrets to list, 1 to 10,000. Default: 20; --json lists all
--jsonPrint JSON, with every match and its confidence (likely or unlikely)
weavekeep scan
weavekeep scan --agent claude --project ~/code/shop
weavekeep scan --all
weavekeep scan --json > leaks.json

It reads Claude Code transcripts in ~/.claude/projects (or $CLAUDE_CONFIG_DIR/projects) and Codex transcripts in ~/.codex/sessions (or $CODEX_HOME/sessions), then the Weavekeep database, large-item files and memory files. It never changes a file and never creates a database. Each secret is listed once, with its kind, a masked value, a fingerprint, its projects and up to three files. Weavekeep hides matches that look like placeholders or test values, such as your-api-key or a documentation key ending in EXAMPLE; --all shows them. Cursor is not covered; --agent cursor is a usage error.

Exits 0 when the scan ran, with or without findings, and 1 when nothing could be read or the Weavekeep store check could not run (the database could not be read, or it changed during both reads). See Check what you leaked.

embeddings

weavekeep embeddings [status|on|off|download|index] [options]

The local embedding model that lets search find memory by meaning. On by default: the first weavekeep serve downloads the model (about 24 MB, once) in the background and embeds your memory. See Semantic search.

SubcommandWhat it does
statusOn, off or starting, the model files (checked by SHA-256, or downloading now), the vectors and the queue. The default
onTurn them back on after off: queue every stored prompt, reply, note, summary, decision and fact for embedding, and download the model (about 24 MB, once). They are embedded in the background
offStop, and drop the vectors. Your memory is unchanged
downloadDownload the model now
indexEmbed what waits now, with progress. Ctrl-C stops after the current row; the next run resumes
OptionWhat it does
--dry-runindex only: count what would be embedded
--max <n>index only: stop after n rows
--per-prompton or off only: switch the model's use for memory added to prompts. An experiment, off by default
--jsonPrint JSON
weavekeep embeddings
weavekeep embeddings off
weavekeep embeddings on
weavekeep embeddings index --dry-run

off and on are the lasting switch: stored with your memory (they create the store if nothing is stored yet), kept by every session on this machine, and never overridden by the default. off stays off until you run on. WEAVEKEEP_EMBEDDINGS=0 keeps embeddings off only in processes that inherit it, whatever the stored setting. download and index exit 1 when the model cannot be downloaded; index also exits 1 when embeddings are off. download also starts the count of failed background downloads again.

serve

weavekeep serve [options]

Run the MCP server over stdio. Your agent starts this; you do not need to run it yourself.

OptionWhat it does
--project <path>Default project for tool calls that do not name one. Default: the current folder

See MCP tools.

index

weavekeep index [--background]

Add long prompts, replies, notes and summaries that are waiting for the search index. Weavekeep does this on its own in the background; run it to finish now. --background prints nothing and always exits 0; it is what the hooks start.

hook

weavekeep hook <event> [--client claude|cursor|codex]

Handle one hook event, reading its JSON payload from stdin. Your agent calls this. It always exits 0, also when something goes wrong or Node is older than 22.16, so it never blocks your agent.

Events by client (--client defaults to Claude Code):

ClientEvents
Claude Codesession-start, user-prompt-submit, post-tool-use, post-tool-use-failure, stop, post-compact, session-end
Cursorsession-start, before-submit-prompt, post-tool-use, after-agent-response, session-end
Codexsession-start, user-prompt-submit, post-tool-use, stop, session-end

An unknown event or client is ignored with one line on stderr; for Cursor the hook still answers {}.

On this page