continuous alignment
for agentic systems.
Before an agent acts, it thinks about your system. It recalls what's been decided, done, and learned across every session and machine you run. The think cli allows you to log retrospectives for codebase footguns and gotchas so your agents quit falling for them. Alignment at runtime is a context problem — and think provides injectable context through intelligent vector recall.
// one mind, many workers
// alignment, in practice
"Merge the PR" meant stamp-gated merge — and the agent knew, because another session already learned it. An aligned agent does what you meant, not just what you typed: it doesn't contradict settled decisions, doesn't repeat a mistake another agent already made, and never needs the same correction twice.
// get started
Jump to install to set it up in 2 minutes, or read the concepts to understand the full pipeline.
// concepts
Memories are written when meaningful pieces of work are completed.
Retros capture what the agent would do different next time.
Cortex is a workspace that those memories and retros live in.
Recall injects memories and retros into a fresh agent.
memories
The primary write. Every think sync stores a memory directly to a local file. A background LLM folds each new entry into a single self-contained summary (write-time compaction), so every memory stands on its own and reads stay fast.
retros
What an agent would do different next time, recorded where the next agent will find it. think retro captures a footgun, gotcha, or convention scoped to a codebase; think brief surfaces them at task start for whoever works there next — you, or an agent that has never run there before.
cortex
The workspace your memories and retros live in. Each cortex is a named scope — personal, work — with its own local database and its own folder of JSONL files that propagates memories between your machines. You can have several and switch between them; the active cortex is where new writes land.
recall
The read path. think recall pulls the memories and retros relevant to the task at hand — and agents don't have to ask: a UserPromptSubmit hook injects context at prompt-submit, and an MCP server gives any agent mid-turn recall. Reads are pure local lookups: sub-100 ms, offline, no model call.
vector embedding
Why recall finds the right thing. Every entry is embedded with a local bge-small-en-v1.5 model and searched by semantic similarity, fused with BM25 keyword matching — the right memories come back even when the query shares no vocabulary with the stored text. A resident daemon keeps the model warm, and embeddings never leave your machine.
cloud
How one mind spans machines. Point your cortex at any folder you already sync (iCloud, Dropbox, Syncthing) and memories propagate on their own — or sync through a hub: self-host one against the open wire protocol, or use think cloud, the managed hub (coming soon). Local is the source of truth either way.
// architecture
Three stages, each with a clear job. Writes go through the daemon and get compacted. The local store answers every read. The cortex folder carries memories to your other machines.
+- write ------------------+ +- local store ------------+ +- propagation ------------+ | | | | | | | think sync | ───>| memories + events + | ───>| memories as .jsonl | | → daemon (socket) | | vector index, all in | | in your cortex folder, | | → compaction (LLM) | | one SQLite file | | synced via iCloud / | | | | | | Dropbox / Syncthing / | | | | ~/.think/index/ | | Drive / any folder | | | | <cortex>.db | | | +--------------------------+ +--------------------------+ +--------------------------+
Local-first by design. All reads and writes go to local SQLite first. Memories, events and retros all propagate to your other machines through the cortex folder. No server, no relay; the folder is the propagation layer.
// install
Two minutes from zero to persistent agent memory.
-
Install & initialize
$npm install -g @openthink/think$think initRequires Node 22.5+.
think initwrites auto-logging instructions into your project's CLAUDE.md — your agents start logging work immediately. The summary feature uses the Claude Agent SDK and requires a Claude subscription.Already running think?
think updateinstalls the latest version and crosses majors on its own — first daemon start after upgrading migrates anything stranded and refreshes your instruction blocks automatically, no manual step. -
Point cortex at a folder
$think cortex setup --fs ~/Dropbox/think-cortex$think cortex create personalA cortex is your AI's memory workspace. Pass
--fsa path inside any sync tool you already use (iCloud, Dropbox, Google Drive, Syncthing) and the same memories will land on every machine you own. The folder is created if it doesn't exist. Skip--fsfor offline-only.Prefer a git remote?
think cortex setup <git-remote-url>is an equally first-class backend — it's what powers team cortexes and is what the daemon's push/pull loop is built on. Pick whichever fits: a synced folder with--fs, or a git remote for shared history across a team. -
You're done
$think sync "shipped the feature"$think recall "what did I ship?"Agents log work with
think sync— each entry is stored as a memory immediately, no curation step needed. Recall pulls it back next session.think cortex syncwrites memories out to the folder so your other machines can pick them up.
// docs
Reference, source, and where to find help.
// all commands
think sync <message> Record a memory entry to the active cortex (or local think.db) think list List entries with optional filters think summary Generate a summary of entries (AI-powered or raw) think delete Soft-delete entries from the active cortex (tombstoned, propagated to peers) think supersession Inspect and revert supersession links (hidden entries can be restored) think supersession list List superseded (hidden) entries in the active cortex, most recent first think supersession show <id> Show the supersession state of an entry: what hid it, and what it hid think supersession revert <id> Clear a supersession link, restoring the entry to active recall on this machine think export Export entries as a sync bundle (file-based sync) think import <file> Import a sync bundle from another device think init Set up CLAUDE.md (and AGENTS.md) for auto-logging and retros think audit Show sync audit log — what data was sent or received think audit prune Drop audit entries older than the given date (--before <iso-date>) think cortex Manage cortexes (team memory workspaces) think cortex setup [repo] Configure a sync backend for cortex storage (git or local-fs) think cortex create <name> Create a new cortex think cortex list Show all cortexes think cortex switch <name> Set the active cortex think cortex current Show the active cortex think cortex push Push local memories to remote think cortex pull Pull remote memories to local think cortex sync Sync memories with remote (pull + push) think cortex status Show sync status for the active cortex think cortex migrate Migrate cortex storage from git to a local folder think cortex migrate-layout [cortex] One-time: nest cortex files under <branch>/ for every branch think recall <query> Search memories, events and retros think memory Show current memories from local store think memory add <message> Add a memory directly, bypassing curation think pull <cortex> Read another cortex's memories from local store think pause Pause event creation — think sync will silently skip until resumed think resume Resume event creation after a pause think config View or update think configuration think config show Print current configuration think config set <key> <value> Set a configuration value think update Update think to the latest version (restarts the daemon if needed) think migrate-engrams Re-submit entries stranded in the legacy pre-daemon table think long-term Manage long-term memory events (durable decisions, transitions, milestones) think long-term backfill One-time extraction of long-term events from historical memories think long-term list List long-term events chronologically think long-term record Manually record a long-term event (interactive) think serve Boot the open-think proxy server (env-driven; see `docs/serve.md`) think serve status Print the persisted proxy state without starting the server think serve subscribe <kind> <pattern> Add a connector subscription to the running proxy think serve unsubscribe <kind> <pattern> Remove a subscription from the running proxy think serve creds Manage encrypted source credentials stored in the proxy vault. think serve creds add <kind> <pattern> Store or replace a credential for a proxy subscription think subscribe Subscribe to external event sources via the open-think proxy think subscribe configure Set the proxy URL and bearer token used by other subscribe commands think subscribe add <kind> <pattern> Create a subscription on the proxy (e.g. `think subscribe add mock 3`) think subscribe list List subscriptions registered on the proxy think subscribe remove <id> Delete a subscription on the proxy (cascades to events/credential) think subscribe set-credential <id> Store an encrypted credential for a subscription (stdin preferred) think subscribe poll [DEPRECATED] No-op — use `think pull <team-cortex>` instead think subscribe install-agent Install a LaunchAgent that polls on session load + on a timer think subscribe disable Remove the auto-subscribe LaunchAgent for this workspace think subscribe status Show auto-subscribe scheduler status think subscribe show Show the configured proxy URL (token is redacted) think subscribe redact-set <id> [paths...] Set per-subscription JSONPath-subset redact selectors (e.g. `$.user.email`) think retro <content> Record a durable lesson onto your home cortex, tagged by repo context think retro-migrate Fold legacy per-repo cortices into your home cortex (dry-run by default) think event <message> Record a notable event (milestone, deploy, decision, incident) think curate-retros Run retro curator: dedupe, promote, and relegate retros (no deletion) think brief [query] Task-start brief: home-cortex context + retros scoped to this repo think daemon Manage the think resident daemon process think daemon start Start the think daemon in the background (no-op if already running) think daemon stop Send the shutdown RPC to the daemon and wait up to 5s for it to exit. think daemon status Print the daemon's running state, pid, socket path, and version think reindex [cortex] Rebuild the search index for one or all cortexes from the raw log think hook Manage Claude Code hook integration for think. think hook install Register the think UserPromptSubmit hook in Claude Code settings. think hook uninstall Remove the think UserPromptSubmit hook from Claude Code settings. think mcp Manage the think MCP server (start in stdio mode, or install/uninstall). think mcp install Register the think MCP server in Claude Code MCP config. think mcp uninstall Remove the think MCP server from Claude Code MCP config. think retro-usage Open a report of how your retros surface in recall/brief think dashboard Open a status dashboard (today's work) with an AI prompt box think doctor Report this machine's think install health, and repair what is safe
// links
- githubgithub.com/OpenThinkAi/think-cli
- npmnpmjs.com/package/@openthink/think
- architecturegithub.com/OpenThinkAi/think-cli/blob/main/docs/architecture.md
- issuesgithub.com/OpenThinkAi/think-cli/issues
- licenseMIT
// where things live
- ~/.think/data directory (override with
$THINK_HOME) - index/<cortex>.dbper-cortex SQLite (memories, events, vector index, sync state)
- daemon.sockUnix socket the CLI uses to talk to the resident daemon
- repo/git-backed canonical log the index is rebuilt from (
think reindex) - cortex folderJSONL files for synced memories (path you set with
--fs) - ~/.config/think/config.json