openthink / home · think stamp ui-leaf audit pm @openthink/think · MIT
v0.0.0 think · MIT
[M]AIN
v0.0.0 · open source · MIT

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.

$npm install -g @openthink/think
requires Node 22.5+ · works with Claude Code out of the box

// one mind, many workers

your laptop — ship a feature, log it
$ think cortex setup --fs ~/Dropbox/think-cortex
✓ Cortex folder: ~/Dropbox/think-cortex
$ think sync "rewrote auth middleware — AES-256-GCM for all session tokens"
✓ [personal] 2026-07-04 17:41 stored memory
$ think sync "fixed race condition in token refresh — concurrent 401s resolved"
✓ [personal] 2026-07-04 18:02 stored memory
your workstation — same folder, synced by Dropbox
$ think recall "auth"
── memories (2) ──
2026-07-04 Auth middleware rewritten — AES-256-GCM encryption for all
session tokens.
2026-07-04 Race condition in token refresh fixed — concurrent 401s
resolved by serializing rotation.
your agent on the workstation picks up where you left off
> Refactor the session middleware
 
! Before I refactor, I should note: I rewrote the auth middleware
on my laptop yesterday with AES-256-GCM and fixed a token refresh
race condition. Let me build on that rather than duplicate it.

// alignment, in practice

you say what you mean, not the whole procedure
> Merge the PR
the agent recalls how merges actually work here — and does what you meant
$ think recall "merge process"
── retros (1) ──
2026-05-25 Never plain-merge to main — merges here are stamp-gated:
stamp review → stamp status → stamp merge. An unsigned merge
commit breaks verification on the next PR.
 
! This repo gates merges through stamp — running the review flow
instead of a plain git merge.
$ stamp review --diff main..feature

"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.

[01]

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.

$ think sync "shipped auth refactor"
✓ [personal] 2026-07-04 17:41 stored memory
[02]

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.

$ think retro "merges here are stamp-gated — never plain git merge to main"
✓ [personal] (context: openthink-web) stored retro
[03]

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.

$ think cortex create personal
✓ Created cortex: personal
$ think cortex switch work
✓ Active cortex: work
[04]

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.

$ think recall "token expiry edge case"
── memories (1) ──
2026-07-04 Auth refactor: AES-256-GCM for session tokens...
[05]

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.

$ think daemon status
status=running · model loaded
socket=~/.think/daemon.sock
[06]

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.

$ think cortex setup --fs ~/Dropbox/think-cortex
✓ Cortex folder: ~/Dropbox/think-cortex

// 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.

  1. Install & initialize

    $npm install -g @openthink/think
    $think init

    Requires Node 22.5+. think init writes 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 update installs 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.

  2. Point cortex at a folder

    $think cortex setup --fs ~/Dropbox/think-cortex
    $think cortex create personal

    A cortex is your AI's memory workspace. Pass --fs a 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 --fs for 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.

  3. 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 sync writes 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

// where things live

think · ready
↑↓nav ⏎select ggithub iinstall ?help