Skip to content

CLI Reference ​

Setup ​

CommandDescription
somtum initClaude Code: capture hooks (SessionEnd, PreCompact), recall hook (UserPromptSubmit), MCP server, project database
somtum init --no-cacheCapture only: memories are saved but not injected into prompts
somtum init --no-mcpSkip registering the MCP server in .mcp.json
somtum init --file-gatingAlso install the opt-in PreToolUse file-gating hook and turn it on for this project
somtum init --allEverything, including file gating
somtum backfillExtract memories from the 5 most recent past Claude Code and Codex sessions of this project. Shows each session's token cost and asks first
somtum backfill --dry-runShow the sessions and the cost estimate, extract nothing
somtum backfill --limit 10 --agent codex --yesMore sessions, one agent, no prompt
somtum init --forceReinstall even if hooks are already present
somtum init --agent codexInstall for Codex: capture + auto-inject hooks in .codex/hooks.json, MCP server in .codex/config.toml
somtum doctorCheck setup: backend, hooks, database, migrations, stale memories, and whether file gating pays off

Memory ​

CommandDescription
somtum listList stored memories (most recent first)
somtum list --kind decisionFilter by kind: decision | learning | bugfix | command | file_summary
somtum list --limit 20Limit to 20 results
somtum list --jsonMachine-readable JSON output
somtum search <query>Search observations (default: bm25 strategy)
somtum search <query> --strategy hybridForce a specific retrieval strategy
somtum search <query> -k 16Return more results
somtum show <id>Print the full body of an observation
somtum rememberManually store an observation
somtum forget <id>Soft-delete an observation by id
somtum forget --branch <name>Soft-delete the memories captured on a git branch, e.g. an abandoned experiment
somtum forget --allSoft-delete all observations in the current project
somtum edit <id>Open an observation body in $EDITOR
somtum rebuildRegenerate index.md from all observations
somtum reindexRecompute embeddings (after enabling embeddings or changing model)
somtum suggest-claude-mdSuggest CLAUDE.md additions from accumulated observations (interactive)
somtum suggest-claude-md --dry-runPreview suggestions without writing
somtum suggest-claude-md --yes --limit 20Auto-confirm, limit to top 20 by tokens saved

Stats & Visibility ​

CommandDescription
somtum statsMetered token use (extraction, injected context, file gating), memory counts, cache stats. See What Somtum Costs
somtum stats --since 7dLimit the metered numbers to the last N days
somtum stats --jsonMachine-readable JSON output; metered numbers are under ledger
somtum serveOpen the visual dashboard in the browser
somtum serve --port <n>Use a custom port (default: 3000)
somtum serve --no-openStart server without opening the browser

Data Management ​

CommandDescription
somtum exportExport observations to stdout as JSON
somtum export --format jsonl --output obs.jsonlExport as JSONL file
somtum export --format markdownExport as readable Markdown
somtum export --include-deletedInclude soft-deleted entries
somtum import <file>Import observations from JSON or JSONL
somtum purge --older-than 30dHard-delete soft-deleted entries older than 30 days
somtum purge --older-than 30d --dry-runPreview without deleting
somtum resetPermanently wipe all memories for the current project (asks to confirm)
somtum reset --yesSkip confirmation (useful in CI or scripts)

Configuration ​

CommandDescription
somtum config getPrint the full resolved config
somtum config get retrieval.strategyRead a single key (dot-separated)
somtum config set retrieval.strategy hybridWrite to .somtum/config.json
somtum config set retrieval.embeddings.enabled true --globalWrite to ~/.somtum/config.json

Sync ​

CommandDescription
somtum sync statusCompare local vs remote observation count
somtum sync pushExport and scp observations to remote
somtum sync pullscp from remote and merge into local DB

Set your remote:

bash
somtum config set sync.remote "user@host:/path/.somtum/projects/<id>"

Somtum uses hostname-aware syncing — merging observations from multiple machines without data loss.

Released under the MIT License.