Commands
The kcap CLI command surface, grouped by what you’d reach for. For every command, kcap <command> --help gives the full flag list. This page is a navigable summary.
Setup and auth
Section titled “Setup and auth”kcap setup # interactive wizardkcap setup --server-url <url> --no-prompt # scripted / CIkcap login # sign in (browser)kcap login --device # device flow (SSH / headless)kcap login --discover # re-discover which servers you can reachkcap logout # delete stored tokenskcap whoami # show authenticated userkcap status # server health checkTokens are stored at ~/.config/kcap/tokens.json and refresh automatically; if the cached token can’t be refreshed, the next CLI call reprompts you to sign in.
See Setup CLI for the wizard walkthrough.
Session lookup
Section titled “Session lookup”kcap recap <sessionId> # AI-generated summarykcap recap --full <sessionId> # complete transcriptkcap recap --chain <sessionId> # across the continuation chainkcap recap --chain --full <sessionId>kcap recap --per-turn <sessionId> # compact per-turn indexkcap recap --get-turn <N> <sessionId> # full transcript for turn N
kcap errors <sessionId> # extract tool-call errorskcap errors --chain <sessionId>
kcap validate-plan <sessionId> # verify all plan items completedThe identifier can be a session GUID or a meta-session slug. Inside any agent session with Capacitor hooks installed, the session ID is resolved from the environment automatically.
More: Session recap, Errors & plan validation.
Recording control
Section titled “Recording control”kcap hide # mark current session owner-onlykcap hide <sessionId> # specific session
kcap disable # stop recording + delete server data (irreversible)kcap disable <sessionId>
kcap ignore . # ignore current directory (no capture for sessions under it)kcap ignore ~/code/xkcap ignore --listkcap ignore --remove ~/code/xMore: Visibility & sharing.
Evaluations and review
Section titled “Evaluations and review”kcap eval <sessionId> # LLM-as-judge, 13 questionskcap eval --model opus <sessionId>kcap eval --chain <sessionId>kcap eval --questions safety <sessionId>kcap eval --skip efficiency <sessionId>kcap eval --threshold 5000 <sessionId>kcap eval --list-questions
kcap review <pr-url> # Claude with MCP context toolsMore: Evaluations, PR review.
Curation
Section titled “Curation”kcap curate apply # write promoted CLAUDE.md guidelines into this repokcap curate apply --dry-run # preview the changes, write nothingkcap curate apply --yes # apply without the confirmation promptRun inside a git repo; the owner/name come from its remote. More: Curation write-back.
MCP servers (for agents)
Section titled “MCP servers (for agents)”kcap mcp sessions # stdio MCP server: search past sessionskcap mcp flows # stdio MCP server: run iterative review flowskcap mcp workitems # stdio MCP server: declare/list a session's work itemsThe Capacitor plugin (installed by kcap setup) auto-registers kcap mcp sessions for both Claude Code and Codex CLI, so it’s available out of the box on either harness. Other MCP-aware clients — Cursor, Gemini CLI, Kiro, OpenCode, Antigravity, GitHub Copilot CLI — can point at kcap mcp sessions directly; see Session recall.
The server is repo-aware — cd into a project before launching the agent and search_sessions defaults to that repo. Four tools: search_sessions, get_session_summary, get_session_transcript, get_turn. See Session recall.
kcap mcp flows is a separate server for review flows — the iterative findings → fix → re-review → sign-off loop, distinct from kcap review. Register it per agent (e.g. claude mcp add kcap-flows -- kcap mcp flows).
kcap mcp workitems exposes two tools — declare_work_item and get_session_work_items — for attaching the current session to a work item and listing its attachments. It’s auto-registered by the kcap Claude Code plugin and is Claude Code only. See Work items.
Importing past sessions
Section titled “Importing past sessions”kcap import # everything detectedkcap import --all # every session/repokcap import --claude # only Claude sessionskcap import --codex # only Codex sessionskcap import --gemini # only Gemini CLI sessionskcap import --pi # only Pi sessionskcap import --copilot # only Copilot CLI sessionskcap import --cursor # only Cursor agent sessionskcap import --kiro # only Kiro agent sessionskcap import --opencode # only OpenCode sessionskcap import --antigravity # only Antigravity sessionskcap import --org # narrow by scope: org reposkcap import --repo owner/name # narrow by scope: one repokcap import --repo . # narrow by scope: current cwd's repokcap import --org --yes # skip confirmationkcap import --org --private # mark as Only Visible to Youkcap import --org --since 2026-01-01 # on or after this datekcap import --org --cwd /path/to/project # filter by working directorykcap import --org --session abc123 # single session (dashed or dashless GUID)OpenCode imports from its local SQLite database (~/.local/share/opencode/opencode.db). The first OpenCode import fetches a small SQLite native library into ~/.cache/kcap (mirror it with KCAP_SQLITE_NATIVE_BASE_URL for airgapped installs). OpenCode is still captured live via the shipped plugin too (kcap plugin install --opencode).
Antigravity is Google’s agent IDE (it shares the ~/.gemini home). kcap import --antigravity backfills conversations from ~/.gemini/antigravity/brain/, and kcap plugin install --antigravity captures new ones live — both are supported. Imported Antigravity sessions carry their transcript but not per-generation cost.
More: Import your history.
Hooks and plugin
Section titled “Hooks and plugin”kcap plugin install # Claude hooks, user scopekcap plugin install --codex # Codex hooks + agent skills, user scopekcap plugin install --gemini # Gemini CLI hooks (merged into ~/.gemini/settings.json)kcap plugin install --pi # Pi extension (~/.pi/agent/extensions/kcap.ts)kcap plugin install --opencode # OpenCode plugin (~/.config/opencode/plugins/kcap.ts)kcap plugin install --antigravity # Antigravity plugin (~/.gemini/config/plugins/kcap/)kcap plugin install --copilot # Copilot CLI hooks (~/.copilot/hooks/kcap.json)kcap plugin install --cursor # Cursor hooks (~/.cursor/hooks.json)kcap plugin install --kiro # Kiro agent (~/.kiro/agents/kcap.json)kcap plugin install --skills # Agent skills only (~/.agents/skills/), no Codex hookskcap plugin install --project # Claude hooks, current repokcap plugin install --codex --project # Codex hooks in <repo>/.codex/hooks.json, skills user-widekcap plugin remove --codex # Remove Codex hooks + agent skillskcap plugin remove --gemini # Remove Gemini CLI hooks from ~/.gemini/settings.jsonkcap plugin remove --pi # Remove the Pi extensionkcap plugin remove --opencode # Remove the OpenCode pluginkcap plugin remove --antigravity # Remove the Antigravity pluginkcap plugin remove --cursor # Remove Cursor hookskcap plugin remove --kiro # Remove the Kiro agent (restores the previous default)kcap plugin remove --copilot # Delete kcap's Copilot hooks filekcap plugin remove --skills # Remove agent skills--skills installs the five kcap skills (kcap-recap, kcap-errors, kcap-hide, kcap-disable, kcap-validate-plan) to ~/.agents/skills/. Codex, Cursor, and any agent that honours the .agents/skills/ convention picks them up automatically. Use --codex instead to also install Codex hooks.
Project-scope installs must be run from inside a git working tree. Skills are always user-wide; --project only affects hooks.
Refresh on upgrade
Section titled “Refresh on upgrade”The simplest way to upgrade is kcap update — it runs the npm upgrade and then refreshes your user-scope skills (~/.agents/skills/kcap-*), Codex hook commands (~/.codex/hooks.json), Gemini CLI / Pi / OpenCode / Kiro hooks, Cursor hooks (~/.cursor/hooks.json), Copilot hooks file (~/.copilot/hooks/kcap.json), and Claude plugin registration (~/.claude/settings.json) in one step. It works even when npm is configured to skip install scripts (see Install from npm).
If you upgrade with npm install -g @kurrent/kcap instead, the same refresh runs via the npm postinstall hook. Either way, each refresh is gated on a marker file written by your previous setup — fresh systems that never opted in are left untouched, and project-scope installs (--project) are not auto-refreshed.
You can also run the refresh commands by hand:
kcap plugin install [--codex|--gemini|--pi|--opencode|--antigravity|--cursor|--kiro|--copilot] --if-installed # Refresh one agent's hooks if previously installedkcap plugin install --skills --if-installed # Refresh agent skills if previously installedkcap plugin install --if-installed # Refresh the Claude plugin registration if previously installedErrors during a --if-installed refresh are swallowed so the upgrade never breaks npm install.
Daemon
Section titled “Daemon”kcap daemon start # foreground (default --name = OS username)kcap daemon start -d # backgroundkcap daemon start --name laptop -dkcap daemon statuskcap daemon status --name laptopkcap daemon stop --name laptopkcap daemon stop --yes # stop all, no promptkcap daemon doctor # diagnose lock-file statekcap daemon doctor --clean # also remove stale lock/pid files
kcap daemon service install # supervise as a launchd/systemd/Scheduled Task service (auto-restart on crash/SIGKILL)kcap daemon service statuskcap daemon service stop # stop the service but keep it installedkcap daemon service start # start it again after a stopkcap daemon service uninstall # stop and remove the service
kcap run-agent claude # run a daemon-hosted agent in your terminal (Unix only)kcap run-agent codex --worktree # ...in a throwaway git worktreekcap run-agent claude --private # ...purely local (not registered with the server)kcap attach <agent-id> # re-attach to a running agent (Ctrl-Q then d to detach)kcap ls # list the daemon's agents (id, status, repo)
kcap repos # list known reposkcap repos add .kcap repos remove ~/dev/oldMore: Hosted agents.
Configuration and profiles
Section titled “Configuration and profiles”kcap config showkcap config set <key> <value>
kcap profile add work --server-url https://acme.kcap.aikcap profile listkcap profile show workkcap profile remove work
kcap use work # bind 'work' to current repokcap use work --global # set as global defaultkcap use work --save # write .kcap.json (team-share)More: Configuration & profiles.
kcap update # upgrade the CLI and refresh agent pluginsFor npm-global installs, kcap update upgrades to the latest published version and refreshes your agent plugins (skills, Codex/Gemini/Pi/OpenCode/Antigravity/Cursor/Kiro/Copilot hooks, Claude plugin) in one step — regardless of whether npm runs install scripts. It exits early if you’re already up to date, and prints the right command for non-npm installs (e.g. Homebrew). The CLI also checks for a newer release lazily in the background (24-hour cache) and prints a hint when one is available.
Uninstall
Section titled “Uninstall”To remove kcap from this machine, run:
kcap uninstall # interactive, user-scope removalkcap uninstall --yes # non-interactivekcap uninstall --project --yes # also strip project-scope hooks in cwd's repokcap uninstall --keep-config # remove integrations, keep ~/.config/kcapuninstall covers every supported agent in one go: it stops running daemons and watcher processes, strips kcap entries from user-level Claude Code, Codex CLI, Gemini CLI, Cursor, and Kiro hook files (preserving any non-kcap entries), deletes the Pi live-ingest extension (~/.pi/agent/extensions/kcap.ts) the OpenCode plugin (~/.config/opencode/plugins/kcap.ts), and the Antigravity plugin (~/.gemini/config/plugins/kcap/), deletes kcap’s Copilot hooks file (~/.copilot/hooks/kcap.json), removes agent skills under ~/.agents/skills/ (plus the legacy ~/.codex/skills/kcap-* folders), and deletes ~/.config/kcap/.
--project additionally cleans up <repo>/.claude/settings.local.json and <repo>/.codex/hooks.json in the current git working tree (errors if you’re not inside one). Cursor only has a user-scope hooks.json, so --project does not affect it. Project-scope hooks in other repos are not touched — re-run from each repo that has them.
Use --keep-config to preserve profiles, tokens, and ignore lists when you plan to reinstall. For finer-grained removal — a single agent’s hooks, or just the skills — use kcap plugin remove [--codex|--gemini|--pi|--opencode|--antigravity|--cursor|--kiro|--copilot|--skills] instead.