Getting started
Agentmine (agentmine) needs Node.js 24+. This page covers installing it and running the first
import.
Requirements
- Node.js 24+
- macOS or Linux; Windows users can run Agentmine in WSL
rsyncfor transcript sync andtarfor backup/history imports- pnpm, when building from source
- SQLite via Node’s built-in
node:sqlite(no native build / prebuilt binary)
Optional:
- Ollama with
nomic-embed-textfor local semantic search
Install
Install the published package globally:
npm i -g agentmineOr build from source:
pnpm installpnpm buildalias agentmine="node $PWD/dist/cli.js"Quick start
Choose the source you have installed:
# Claude Code, Cursor, Codex, Gemini CLI, Qwen Code, or Cline (pick one)agentmine ingest --source claude-codeagentmine ingest --source cursoragentmine ingest --source codexagentmine ingest --source geminiagentmine ingest --source qwenagentmine ingest --source cline
# Current OpenCode SQLite storeagentmine normalize --source opencode-dbagentmine extract
# Current Kilo Code SQLite storeagentmine normalize --source kiloagentmine extract
# Current Goose SQLite storeagentmine normalize --source gooseagentmine extract
agentmine statsRun only one of the six source-specific ingest examples. Each runs
sync -> normalize -> extract for that file-based source. An unfiltered agentmine ingest
imports all file-backed sources and picks up available OpenCode, Kilo Code, and Goose databases
during normalize, but expects the default Claude Code transcript directory to exist. Live SQLite
stores are not sync targets; for one live-DB source, run its normalize --source ... command plus
extract as shown above. See The pipeline for what each stage does and why
the sequence is safe to rerun.
For Cline, the source directory follows Cline’s own override precedence:
CLINE_SESSION_DATA_DIR, then CLINE_DATA_DIR/sessions, then CLINE_DIR/data/sessions, then
~/.cline/data/sessions. See Data paths for details.
After the first import creates sessions.db, run agentmine backup before forced rebuilds or
other destructive maintenance.
When Claude Code is in scope, normalize also ingests its workflow manifests and journals.
extract then derives workflow rollups that you can browse with:
agentmine workflows --sort tokensagentmine workflow <run-id>Incremental imports
To only parse recently touched files from file-backed sources, pass --since to normalize:
agentmine normalize --since 1dagentmine normalize --since 2026-06-01SQLite-backed sources (opencode-db, kilo, and goose) remain eligible because their session
IDs are not filesystem paths and therefore have no modification time to compare.
Scoping to selected projects
To permanently keep only sessions from selected project paths, set a comma-separated allowlist of
case-sensitive project_path substrings before ingest. When the filter is set, sessions with a
null project_path are skipped.
AGENTMINE_PROJECT_PATH_ALLOW=my-workspace agentmine ingestPurge already-ingested sessions outside the same allowlist from the SQLite DB. The first command is
a dry run; pass --yes to delete.
agentmine purge --project-path-allow my-workspaceagentmine purge --project-path-allow my-workspace --yesOverriding the database path
AGENTMINE_DB=/path/to/sessions.db agentmine statsNext steps
- The pipeline explains each stage and why the pipeline is safe to rerun.
- CLI command overview lists common browse, search, pipeline, and maintenance commands.
- Agent CLI contract describes the JSON envelope and error codes;
run
agentmine schemato discover the contract at runtime.
For coding agents
Agentmine ships a using-agentmine skill in the package (skills/using-agentmine/SKILL.md, also
referenced from the agentskills field in package.json). A coding agent working in a repo that
has agentmine installed can load it to learn when and how to query prior sessions — for example,
before starting non-trivial work, run agentmine similar "<task description>" to check whether you
solved something like it before.
To wire it into Claude Code, Cursor, or another agent so it triggers on its own, see Set up the agent skill.