Reverie
Enables GitHub Copilot to access persistent project context, stored commands, and structured data through the MCP server's 19 tools, improving consistency across sessions.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Reverie
Bicameral memory for AI-assisted development.
A CLI + MCP server that bootstraps persistent project context for any AI agent — Claude Code, Copilot, ChatGPT, Cursor, and beyond. Agents read the project's "other voice" at session start, write back what they learn, and Reverie grows session over session.
A SeaBear Studios product · seabear.dev/work/reverie
Previously known as codexCLI. See the CHANGELOG for the rebrand provenance and migration notes.
Table of Contents
Related MCP server: mcp-project-context-router
Overview
Reverie is a command-line tool and AI agent knowledge base. It stores structured information using hierarchical dot notation (similar to JSON) and exposes it to AI agents via MCP. The goal: make AI agents more effective by giving them persistent, shared project context across sessions.
Features
Hierarchical Data Storage: Store data using intuitive dot notation paths (e.g.,
server.production.ip)Command Runner: Execute stored shell commands with dry-run, composition (
:) and chaining (&&), and optional per-entry confirmationInterpolation: Reference stored values with
${key}, execute stored commands with$(key), and use conditional defaults${key:-fallback}— all resolved at read timeAliases: Create shortcuts to frequently accessed paths
Encryption: Password-protect sensitive values
Search: Find entries by searching keys or values
Tree Visualization: Display nested data in a tree-like structure
Clipboard Integration: Copy values directly to clipboard (macOS, Linux, Windows)
Inline Editing: Open entries in
$EDITOR/$VISUALfor quick editsStructured Output: A global
--jsonflag — orRVR_OUTPUT=jsonfor the whole session — wraps every command (reads and mutations) in one versioned envelope (reverie/ok/command/result/warnings/error) with a frozenerror.codeset and a non-zero exit on failure, so AI agents can drive Reverie through the CLI when MCP isn't availableCommand Manifest:
rvr manifest --jsonemits the full command/flag tree plus the MCP-tool ↔ CLI-command map — thetools/listanalog for CLI-driven agentsStdin Values: Pipe values into
setfrom other commands, or feed a multi-line value from a heredoc or a fileProject-Scoped Data: Opt-in
.reverie/per project — project entries take precedence, fall through to globalSmart Init:
rvr initscans your codebase, populates.reverie/with project/commands/files/deps/conventions/context entries, generatesCLAUDE.mdand an agent-agnosticAGENTS.md, and seeds the three-file knowledge conventionAuto-Backup: Automatic timestamped backups with configurable rotation (
max_backupssetting)File Locking: Advisory locking prevents data corruption from concurrent access
Shell Tab-Completion: Full tab-completion for Bash and Zsh (commands, flags, keys, aliases)
Staleness Detection: Track when entries were last updated, find stale knowledge (
rvr stale), inline[untracked]/[Nd]warnings ongetandcontextoutputSchema Validation: Check entries against recommended namespaces (
rvr lint)MCP Server: 20 tools for any MCP-compatible AI agent (Claude Code, Copilot, ChatGPT, etc.) via the Model Context Protocol
Telemetry & Audit: Track usage patterns with scope-aware telemetry (
rvr stats) and full audit log with before/after diffs, hit/miss tracking, and per-entry metrics (rvr audit --detailed). Includes net token savings with self-calibrating exploration cost estimates, miss-path tracking, and per-agent breakdown.Cross-Session Handoff:
reverie_contextsurfaces a top banner fromcontext.next_sessionso the next session reads where things stand before any other work (auto-staled past 7 days)Project-Resolution Guardrail: writes refuse with a structured
PROJECT_UNRESOLVEDerror when no.reverie/resolves and no explicit scope is given — prevents project-shaped data from silently landing in the global storeIndex-First Bootstrap:
reverie_context/rvr contextis a front page — pinned namespaces (project.*,commands.*,conventions.*by default; override per store with asystem.bootstrap.pinnedentry) render in full, and every other entry is one line: key, first-line gist, and the bytes you get by opening it withrvr get <key>. Nothing is hidden, and entries that fit on one line render wholeBootstrap Size Budget: when the projected response exceeds
bootstrap_max_response_bytes(default 28KB — under the 30,000-character inline cap of the Claude Code Bash tool, so the bootstrap arrives in context rather than in a saved file), pinned namespaces are demoted to index lines first (largest first, nothing lost), then every index gist narrows to one shared width (80 → 40 characters → keys only, so every key stays visible), and only then are entries dropped by priority —files.*, thenarch.*, then largecontext.*— with notices naming what changed.tier:"full"opts outWrite-Amp Guard:
reverie_set/rvr setwarns on the 3rd+ write of the same key in a session within 30 minutes — informational, the write still succeeds. Helps agents notice when a key is being used as scratch space rather than a stable seed. Thecontext.next_sessionhandoff is exempt: it is rewritten by designCLI Agent Sessions: separate
rvrinvocations count as one session — automatically inside Claude Code (its session id is detected), elsewhere by exportingRVR_SESSION=<any-id>— so the write-amp guard (aWRITE_AMPwarning in the JSON envelope'swarnings[]) and miss-path telemetry work across invocations, the same session guardrails MCP agents getSize Projection:
rvr context --size-only(or MCPsizeOnly: true) reports per-namespace entry/byte counts and the effective budget — answers "how big is my bootstrap" without paying for the bootstrap;find --keysreturns matching keys without their values
Installation
Homebrew (macOS / Linux)
brew tap seabearDEV/reverie
brew install rvrDownload Binary
Download the latest release for your platform from GitHub Releases.
# macOS (Apple Silicon)
curl -fsSL https://github.com/seabearDEV/reverie/releases/latest/download/rvr-macos-arm64 -o rvr
chmod +x rvr && sudo mv rvr /usr/local/bin/
# macOS (Intel)
curl -fsSL https://github.com/seabearDEV/reverie/releases/latest/download/rvr-macos-x64 -o rvr
chmod +x rvr && sudo mv rvr /usr/local/bin/
# Linux (x64)
curl -fsSL https://github.com/seabearDEV/reverie/releases/latest/download/rvr-linux-x64 -o rvr
chmod +x rvr && sudo mv rvr /usr/local/bin/
# Linux (ARM64)
curl -fsSL https://github.com/seabearDEV/reverie/releases/latest/download/rvr-linux-arm64 -o rvr
chmod +x rvr && sudo mv rvr /usr/local/bin/
# Windows (x64) — download from:
# https://github.com/seabearDEV/reverie/releases/latest/download/rvr-win-x64.exe
# First run will prompt to install shell completions
rvrInstall from Source
Note: Installing from source registers the development binary
rvr-dev(notrvr). All examples in this README uservr, but substitutervr-devif you installed from source. The productionrvrbinary is available via Homebrew or the GitHub Releases download above.
Building and running from source needs Bun on your PATH: the build output is a Bun script, and the test runner is Bun's.
Ensure npm's global binaries are in your PATH by adding the following to your shell profile (.bashrc, .zshrc, or equivalent):
export PATH="$(npm config get prefix)/bin:$PATH"git clone https://github.com/seabearDEV/reverie.git
cd reverie
bun install
bun run build
npm install -g .If rvr-dev is not found after installing, verify that npm's global bin directory is in your PATH:
echo $PATH | grep -o "$(npm config get prefix)/bin"Environment Variables
Reverie honors a small set of environment variables for deployment-time configuration. All are optional — sensible defaults work for most users. (For interactive UI preferences like color and pager, see Configuration under Usage.)
Variable | Purpose | Default |
| Override the global data directory. Must be an absolute path. All global state lives here: the entry store ( |
|
| Explicit path to a | unset (walk up from |
| MCP-server launcher hint — the directory the server should treat as the project root. Equivalent to passing | unset |
| Disable project-file lookup entirely. Set to any non-empty value (e.g. | unset |
| Identifier recorded in the audit and telemetry logs for the calling agent. Used by | unset (ambient detection) |
| Set to | unset |
| When set to | unset |
| Shared session id for CLI-driven agents: invocations with the same id count as one session, with guardrail state (write-amp window, miss-path tracking) persisted to | unset |
| How long, in milliseconds, a |
|
| Test-only. When set to | unset |
Notes
RVR_DATA_DIRmust be absolute. Relative paths (./mydata,~/foo) are rejected with a hard error rather than silently resolved againstprocess.cwd(). Pass an expanded absolute path.Verify your data directory at any time with
rvr info— theDataline shows the resolved path and is annotated with(RVR_DATA_DIR)when the env var is set.Pin the project root for the MCP server in
.claude.jsonby setting"env": { "RVR_PROJECT": "<repo path>" }in the reverie MCP block. This is more deterministic than relying oncwdwalk-up.
Usage
Storing Data
# Set a simple entry
rvr set mykey "my value"
# Set a nested entry using dot notation
rvr set server.production.ip 192.168.1.100
# Set with an alias
rvr set server.production.ip 192.168.1.100 -a ip
# Overwrite without confirmation
rvr set server.production.ip 10.0.0.1 -f
# Read value interactively (avoids shell expansion of $, !, etc.)
rvr set secret.token -p
# Same, but with visible input
rvr set secret.token -p --show
# Encrypt a value
rvr set api.key sk-secret-123 -e
# Mark an entry as requiring confirmation before running
rvr set commands.deploy "./deploy.sh" --confirm
# Remove the confirmation requirement from an entry
rvr set commands.deploy --no-confirm
# Batch set multiple key=value pairs
rvr set a=1 b=2 c=3
# Pipe a value from stdin
echo "my value" | rvr set mykey
# Multi-line value from a heredoc (or `rvr set mykey < notes.txt`)
rvr set arch.cache <<'EOF'
Two layers: in-process LRU, then Redis.
Invalidate on write, never on read.
EOF
# Pipe from another command
curl -s https://api.example.com/token | rvr set api.tokenAfter setting an entry, you'll be asked interactively whether it should require confirmation to run. Use --confirm or --no-confirm to skip the prompt.
A set with no value and only -a, --confirm or --no-confirm updates the alias or the flag. If stdin is a pipe or a file with something on it, that is taken as the value. If stdin is open and nothing arrives within two seconds (an agent's shell often looks like this), the flag is applied alone and a warning on stderr says so (warnings[] code STDIN_SILENT in JSON); RVR_STDIN_WAIT_MS changes the wait. rvr alias set and rvr confirm set never read stdin.
Retrieving Data
When inside a project directory (one with a .reverie/ store), get shows project entries by default. Use -G for global entries or -A for both. Outside a project, get shows global entries. Looking up a specific key always falls through from project to global automatically.
# List keys in the current scope
rvr get
# List keys with values
rvr get -v
# Get a specific entry (leaf values always show their value)
rvr get server.production.ip
# List keys in a namespace
rvr get server
# List keys in a namespace with values
rvr get server -v
# Show global entries only (when inside a project)
rvr get -G
# Show entries from all scopes with section headers
rvr get -A
# Limit key depth (1 = top-level, 2 = two levels, etc.)
rvr get -k 1
rvr get -k 2 -v # two levels with values
# Display as a tree structure (keys only by default)
rvr get --tree
rvr get --tree --values # tree with values
rvr get --tree -k 2 # tree limited to 2 levels
# Output plain text without colors (for scripting)
rvr get server.production.ip -p
# Show stored value before interpolation
rvr get paths.myproject --source
# Decrypt an encrypted value
rvr get api.key -d
# Copy value to clipboard
rvr get server.ip -c
# Output as JSON (for scripting)
rvr get server --json
# List all aliases
rvr alias listRunning Commands
Commands run immediately by default. Entries marked with --confirm at set time will prompt before executing. Use -y to skip the prompt.
# Execute a stored command (runs immediately unless marked --confirm)
rvr run deploy.cmd
# Skip the confirmation prompt (for entries marked --confirm)
rvr run deploy.cmd -y
# Dry run (print without executing)
rvr run deploy.cmd --dry
# Chain multiple commands with &&
rvr run nav.project commands.list -y
# → cd /path/to/project && ls -l
# Compose a command from fragments using :
rvr run commands.cd:paths.project -y
# → cd /path/to/project
# Combine composition and chaining
rvr run commands.cd:paths.project commands.list -y
# → cd /path/to/project && ls -l
# Multiple colon-separated segments
rvr run commands.scp:files.config:targets.prod -y
# → scp ./config.yml admin@prod:/etc/app/
# Decrypt and run an encrypted command
rvr run secret.script -d -y
# Capture output for piping (instead of inheriting stdio)
rvr run cmd.echo --capture | tr a-z A-Z
# Stored command chain (macro) — value is space-separated key refs
rvr set macros.deploy "commands.build commands.test commands.deploy"
rvr run macros.deploy --chain -y
# → npm run build && npm test && ./deploy.shSearching
# Search keys and values
rvr find 192.168
# Search data entries only (skip aliases)
rvr find prod -e
# Search aliases only
rvr find ip -a
# Show results as a tree
rvr find server -t
# Output as JSON (for scripting)
rvr find prod --json
# Search with regex
rvr find "prod.*ip" --regex
# Search keys only (skip value matching)
rvr find "server" --keys
# Search values only (skip key matching)
rvr find "10.0" --valuesAliases
Aliases are shortcuts to frequently used key paths. Managed via the alias subcommand:
# Create an alias
rvr alias set ip server.production.ip
# List all aliases
rvr alias list
# Remove an alias
rvr alias remove ip
# Rename an alias
rvr alias rename ip sip
# Use an alias anywhere you'd use a key
rvr get ip
rvr run ip
# Create an alias inline when setting an entry
rvr set server.production.ip 192.168.1.100 -a ip
# Remove an entry and its alias
rvr remove server.production.ipEach store has its own aliases, and an alias command changes only the list of the store it writes: the project's without -G (outside a project the command is refused), the global one with it. A name looks through both, the project's first. So without -G, alias remove removes the project's alias of that name and says when a global alias of the same name still resolves; when only the global store has the alias, it changes nothing, says so, and asks for -G. The MCP tools (reverie_alias_remove, reverie_remove with is_alias) behave the same way: without a scope they remove the project's alias, and scope: "global" removes the global one.
An alias is looked up before an entry, so an alias named after an entry would stand in for it wherever the name is used. Every command that adds an alias (alias set, alias rename, set -a, rename --set-alias, an import, and their MCP counterparts) refuses a name that is the key of an entry in either store, in another case too, with INVALID_INPUT. A flagged command is gated under the name you type as well as the entry an alias points it to (see Run Confirmation).
Copying Data
Copy an entry (or an entire subtree) to a new key:
# Copy a single entry
rvr copy server.ip server.ip.backup
# Copy an entire subtree
rvr copy server server.backup
# Overwrite destination without confirmation
rvr cp server.ip server.ip.backup -fRenaming
Rename entry keys or aliases without re-creating them:
# Rename an entry key (moves the value, updates aliases, flags the new key if the old one required confirmation)
rvr rename server.old server.new
# Rename an alias
rvr alias rename oldalias newalias
# Rename a key and set a new alias on it
rvr rename server.old server.new --set-alias snA rename is one step: the value, the aliases that point at it and the new keys' confirmation flags move together, or nothing changes. The aliases re-pointed are those of the store the rename writes: without -G, the project's. A global alias that points at the old key is left as it is, since in another project that key may be the project's own entry, and the rename says so. Renaming onto a name that is also an alias's works, but the alias is looked up first and hides the entry; the rename says so. Name the entry as it is stored. On a filesystem that ignores case, rvr rename Commands.Deploy … opens the file of commands.deploy, and the rename is refused with the stored name rather than copying the entry. The same name in another Unicode normalization counts as the stored one. A rename is also refused while either store's confirmation list cannot be read.
Editing Data
Open a stored value in your $EDITOR (or $VISUAL) for inline editing:
# Edit an entry in your default editor
rvr edit server.production.ip
# Edit an encrypted entry (decrypts before editing, re-encrypts on save)
rvr edit api.key --decryptRemoving Data
Removing an entry prompts for confirmation. Use -f to skip.
# Remove an entry (prompts for confirmation)
rvr remove server.old
# Remove without confirmation
rvr remove server.old -f
# Remove an alias only (keep the entry)
rvr alias remove myaliasInterpolation
Reference stored values inside other values with ${key} syntax. References are resolved at read time.
# Store a base path
rvr set paths.github "/Users/me/Projects/github.com"
# Reference it in another entry
rvr set paths.myproject 'cd ${paths.github}/myproject'
# Resolves at read time
rvr get paths.myproject
# → cd /Users/me/Projects/github.com/myproject
# Works with run too
rvr run paths.myproject -y
# Use --source to see the raw stored value
rvr get paths.myproject --source
# Use --prompt (-p) when setting to avoid shell expansion of ${}
rvr set paths.myproject -pA reference resolves in the store of the entry that holds it. In a global entry, ${key} and $(key), and the aliases they name, read the global store only, all the way down: inside a project, even one you just cloned, your own global commands neither show nor run that project's entries, with or without -G. In a project entry they read the project, then the global store, the way a lookup by key does; a global entry reached that way still resolves its own references in the global store. get, find, lint, run and its preview, and the MCP tools all follow this rule, so what a read shows is what a run runs. A command that has to pick up a project's values belongs in that project's store.
A reference that does not resolve — no such key — does not make the entry unreadable. get returns the value as written and warns (on stderr; warnings[] with code INTERPOLATION_UNRESOLVED in JSON), set warns when it stores one, and rvr lint lists them. At set, a value that is encrypted, or typed at the masked --prompt, is not inspected, because the warning quotes the reference. run still refuses to execute a command with an unresolved reference. For text that only looks like a reference, such as documentation for a tool that uses ${VAR} itself, escape it:
rvr set conventions.robot 'Use \${EMPTY} to clear the field'
rvr get conventions.robot
# → Use ${EMPTY} to clear the fieldConditional Interpolation
Use bash-style modifiers for fallback values and required-key checks:
# Default value — use fallback when key is not found
rvr set greeting 'Hello, ${user.name:-stranger}!'
rvr get greeting
# → Hello, stranger! (if user.name doesn't exist)
# → Hello, Alice! (if user.name is "Alice")
# Required value — throw a custom error when key is not found
rvr set deploy.cmd 'ssh ${deploy.host:?deploy.host must be set first}'
rvr run deploy.cmd
# → Error: deploy.host must be set first
# Nested defaults — the fallback can itself contain ${} references
rvr set url '${api.url:-${api.default_url}}/endpoint'
# Empty default — resolves to empty string when key is missing
rvr set optional '${maybe.key:-}'Exec Interpolation
Use $(key) inside a stored command to run another stored command and paste its output in. The key must reference a stored string value containing a shell command. Only rvr run (and reverie_run) executes it; reads, --dry and previews show $(key) as written.
# Store a command
rvr set system.user "whoami"
# Reference it with $(key) — at run time it executes and its output is pasted in
rvr set cmd.home 'ls /Users/$(system.user)'
rvr run cmd.home --dry
# → $ ls /Users/$(system.user)
rvr run cmd.home # runs: ls /Users/kh
# Aliases work too
rvr set system.user -a user
rvr set cmd.home 'ls /Users/$(user)'Exec interpolation supports:
Recursion: stored commands can contain
${key}or$(key)references that resolve before executionCaching: in one
rvr run, an entry's command is executed once, however often it is referenced;reverie_runwithchain: trueexecutes it once per chain memberCircular detection:
$(a)→$(b)→$(a)throws an errorTimeout: commands are killed after 10 seconds
Cross-type references:
${key}values can contain$(key)and vice versa
The output is data, not code:
Plain output only. Trailing newlines are dropped, as the shell does. If what remains holds shell syntax (
`$;&|<>()'"\#or a newline), the run stops with an error naming the key, and nothing further executes. Plain output (words, paths, versions) is pasted as is and splits into arguments like any unquoted text.Not scanned again. Text that output or a
${key}value put into a command is never read for$(key)references, and a$(…)cannot take its key from a${…}. Write the key itself.
Encryption
# Encrypt a value (prompts for password twice)
rvr set api.key sk-secret-123 -e
# Encrypted values show as [encrypted]
rvr get api.key
# → api.key: [encrypted]
# Decrypt to view
rvr get api.key -d
# Decrypt and copy to clipboard
rvr get api.key -d -c
# Decrypt and run
rvr run secret.deploy -d -y
# Clear terminal after setting sensitive data
rvr set api.key -p -e -cConfiguration
# Show all settings
rvr config
# Get a specific setting
rvr config get theme
# Change a setting
rvr config set theme dark
rvr config set colors false
# Return a setting to its default
rvr config unset theme
# Show version, stats, and storage paths
rvr info
# Show usage examples
rvr config examplesAvailable settings:
Setting | Values | Description |
|
| Enable/disable colored output |
|
| UI theme |
| integer (default: | Number of auto-backups to keep ( |
| integer (default: | Reject import files larger than this (bytes) to prevent OOM |
| integer (default: | Size budget for |
| integer (default: | Longest gist on a bootstrap index line |
config.json (in the data directory) stores only the settings you changed; every other setting is its current default, so a default that changes in a later release reaches you. Setting a value equal to the default stores nothing, the same as rvr config unset. rvr config get always reports the value in effect. Earlier releases wrote every default to the file on first run, so until this install's first config write, a value equal to a default any release shipped, or to today's default, counts as unset. Reading never rewrites config.json; the first config set or config unset stores the cleaned form, and every write lists the settings it stored in config.format beside it. If an older Reverie still running (an MCP server started before the upgrade, say) rewrites config.json whole, the settings in that list keep their values and any other setting it wrote at an old default follows the current one, with a one-line note; rvr config unset <key> returns a setting to the default. config.format belongs with config.json: copy or restore the two together. A write refuses a config.json that does not parse rather than replacing it.
Project-Scoped Data
Reverie supports per-project knowledge stores that live alongside your code. The .reverie/ directory is designed to be committed to version control, creating a shared knowledge base that persists across sessions, team members, and AI agents. As of v1.10.0, each entry is its own JSON file inside the directory (.reverie/arch.storage.json, .reverie/commands.build.json, etc.) — this eliminates merge conflict churn when multiple devs add different entries on parallel branches. Two branches that write the same entry still conflict in that entry's file; Reverie reports such a file instead of reading or overwriting it (see "When a store file cannot be read" in the schema guide). Use CLI or MCP tools to edit; hand-editing the wrapper files is unsupported. The store seeds its own .gitignore for per-clone state (_epoch.json, the crash-safety counter) so only entries and shared sidecars are committed; repos created before that landed untrack it once with git rm --cached .reverie/_epoch.json.
# Initialize a project — scans codebase, creates .reverie/ and CLAUDE.md
rvr init
# Preview what init would create
rvr init --dry-run
# Init without CLAUDE.md generation
rvr init --no-claude
# Init without codebase scan (empty .reverie/)
rvr init --no-scan
# Store project knowledge
rvr set commands.build "npm run build"
rvr set commands.test "npm test"
rvr set arch.api "REST endpoints in src/routes/, validated by Zod schemas"
rvr set conventions.errors "Always use AppError class from src/utils/errors.ts"
rvr set context.auth "JWT tokens expire after 1h, refresh via /api/refresh"
# get shows project entries only (when inside a project)
rvr get
# Single-key lookups fall through to global transparently
rvr get paths.github # not in project → found in global
# Use -G to see global entries only
rvr get -G
# Use -A to see both scopes with section headers
rvr get -A
# Use -G to explicitly write to global while inside a project
rvr set server.ip 192.168.1.100 -G
# Remove the project store
rvr init --removeScope flags: The -G / --global flag is available on set, get, run, find, copy, edit, rename, and remove. Data management commands (export, import, reset) also support -P / --project, which needs a project: outside one, -P is refused with PROJECT_UNRESOLVED before any prompt or backup, and nothing is changed. With -G, a name you type resolves through the global aliases only, so a project's _aliases.json cannot point a -G command at another global entry; without it, the project's aliases apply over the global ones, and a write still lands in the project store.
Recommended Schema
Deep dive: See the Schema Guide for the full rationale behind the file structure, what makes a good entry, and a walkthrough of the Reverie project's own
.reverie/as a reference implementation.
When using Reverie as a project knowledge base (especially with AI agents via MCP), we recommend organizing entries under these namespaces:
Namespace | Purpose | Examples |
| Basic metadata |
|
| Build, test, deploy commands |
|
| Architecture and design decisions |
|
| Coding patterns, naming, style |
|
| Non-obvious gotchas, edge cases |
|
| Key file paths and their roles |
|
| Notable dependencies and why |
|
Keep values concise — one sentence or a short command. Use multiple keys under the same namespace for detail. Don't store things easily derived from package.json or the code itself; store insights, decisions, and context that would otherwise be lost.
AI Agent Workflow
When an AI agent connects via MCP, the recommended workflow is:
Call
reverie_contextas your first tool call to bootstrap session knowledge. Pick the right tier for the task:tier:"essential"— answering questions, small fixes, single-file editsomit /
tier:"standard"— multi-file changes, bug fixes, new features (default)tier:"full"— refactoring subsystems, changing architecture, onboarding to the codebase
Check relevant namespaces (
arch,conventions,context,files) before exploring the codebaseRecord non-obvious discoveries with
reverie_setas you workUpdate stale entries when you find they no longer match the code
Agent usage is tracked automatically — run rvr stats to see bootstrap rate, write-back rate, and namespace coverage trends.
The Knowledge Flywheel
Every AI session has the same problem: the agent starts from zero, spends thousands of tokens exploring the codebase, and all that understanding vanishes when the session ends. Reverie turns that into a compounding asset.
Here's how it works in practice:
You run
rvr initin a new project. The CLI scans the codebase in milliseconds and creates a skeleton.reverie/with project metadata, commands, file paths, dependencies, and conventions it can detect from the filesystem.First AI session begins. The agent calls
reverie_context, sees the skeleton, and recognizes it's a fresh project (context.initialized: scaffold). Before starting your task, it reads the actual source code — entry points, core modules, config files — and populates the deep knowledge: architecture decisions inarch.*, non-obvious gotchas incontext.*, and rich file descriptions infiles.*. This deep analysis runs once.Every session after that — whether it's Claude, Copilot, Cursor, ChatGPT, or any other MCP-compatible agent — bootstraps the full knowledge base in a single
reverie_contextcall. No re-exploration. No wasted tokens.The flywheel accelerates. Agent A discovers a database migration gotcha on Monday and stores it in
context.migration. Agent B (different tool, different session) hits the same area on Tuesday and benefits immediately — it already knows about the gotcha. Agent B discovers an API pattern and stores it inarch.api. Agent C benefits on Wednesday.
The knowledge base grows with every session. The token cost per session drops. rvr stats shows you the trend: bootstrap rate, hit rate, estimated tokens saved, per-namespace coverage. The more you use it, the more efficient every agent becomes.
Because the knowledge lives in .reverie/ (plain JSON files committed to your repo), it works across machines, across team members, and across AI tools. No vendor lock-in, no cloud dependency, no API keys. Just files that get smarter over time.
Data Management
All data (entries, aliases, confirm metadata) is stored in a directory with one JSON file per entry plus _aliases.json and _confirm.json sidecars — ~/.reverie/store/ for global data, .reverie/ for project-scoped data. Pre-v1.10.0 unified .codexcli.json / data.json files are automatically migrated on first access and the old file is renamed to .backup.
# Export data to a timestamped file
rvr data export entries
# Export to a specific file
rvr data export aliases -o my-aliases.json
# Export with pretty-printed JSON
rvr data export entries --pretty
# Export confirm metadata
rvr data export confirm
# Export everything to a single file (roundtrips with `data import all`)
rvr data export all -o backup.json
# Legacy behavior: write per-section files (entries/aliases/confirm)
rvr data export all -o backup.json --split
# Export only global data (when a project file exists)
rvr data export entries -G
# Import data from a file (replaces existing)
rvr data import entries backup.json
# Import and merge with existing data
rvr data import entries backup.json --merge
# Preview changes without importing
rvr data import entries backup.json --merge --preview
# Reset data to empty state (prompts first)
rvr data reset entries
# Reset without confirmation
rvr data reset all -fAuto-backup: Before destructive operations (
data reset, non-mergedata import), Reverie automatically creates a timestamped backup in~/.reverie/.backups/. The last 10 backups are kept by default — configure withrvr config set max_backups <n>(set to0to disable rotation).
Context (Knowledge Summary)
Get a compact summary of stored project knowledge — the same view AI agents get via reverie_context:
# Front page (standard tier — pinned namespaces in full, one line per other entry)
rvr context
# Pinned namespaces only (project/commands/conventions by default)
rvr context --tier essential
# Show everything
rvr context --tier full
# Output as JSON
rvr context --json
# Plain text without colors
rvr context -pRun Confirmation
Mark commands that should prompt before executing:
# Require confirmation before running
rvr confirm set commands.deploy
# List keys requiring confirmation
rvr confirm list
# Remove confirmation requirement
rvr confirm remove commands.deploy
# Skip confirmation at run time with -y
rvr run commands.deploy -yThe key has to name an entry, in the project store or the global one, whichever list -G picks: confirm set and set <key> --confirm refuse a key that is in neither, and a namespace. The flag is listed under the name the entry is stored as, so it gates wherever the store is copied: on a default macOS volume, rvr confirm set commands.DEPLOY lists commands.deploy, and commands.fix (with the fi ligature) lists commands.fix. Inside a project, an entry stored only in the global store gets its flag in the global list, which every project reads and every rename sees; an entry in the project store gets it in the project's list, or the global one with -G. If the global list cannot be used (the store cannot be written, or its list cannot be read), a global-only entry's flag goes in the project's list, with a warning that it applies only in that project. Where the two stores spell one entry differently, the flag is listed under each spelling. The success line says when the name or the list is not the one you gave. set <key> <value> --confirm stores the value and its flag (and a -a alias) in one write: all of it, or nothing.
A flagged command asks for confirmation under any spelling that reaches it, directly, through a ${reference} or through an alias: on a filesystem that ignores case, rvr run commands.Deploy opens the entry stored as commands.deploy, and is gated like it. A flag also gates its name wherever the name is used, whatever an alias makes of it: every key given to run, a --chain entry and each key it lists, and every ${…} and $(…) a run reaches are checked as written and as their alias resolves. So a cloned project's _aliases.json cannot point a name you flagged at a command of its own and run it unasked. confirm remove clears the flag listed under the name it is given, in the list it is given for. If the key is still gated afterwards — by a flag under another spelling, by the other store's list, or by a list that cannot be read — it names every one of them; it exits 1 only when it removed nothing. Renaming an entry or a namespace flags the new keys of the gated entries it moves and leaves the old names flagged (a rename is refused while either list cannot be read, since it could not carry a flag from that list), and removing one leaves its flags listed too: a flag gates its name in every project, and the global list may be gating another project's entry of the same name. Clear a flag with confirm remove once nothing uses it.
While the global _aliases.json cannot be read, every run in a project asks, except a -G one (MCP: scope: "global"): the check cannot see whether a project alias stands in front of a global alias to a flagged command. While a _confirm.json cannot be read, every run asks.
The check is made once, before the command runs, over the store as it is at that moment. A $(…) command that writes entries partway through a run, or another session that writes one while rvr run waits at its prompt, can change what a later reference in that run reads, and that change is not checked. The flag is a prompt for what a run names and refers to, not a sandbox for what its commands do: a command that can write the store could as well run rvr run <flagged> --yes itself.
Staleness Detection
Track when entries were last updated and find stale knowledge that may need refreshing.
# Show entries not updated in 30 days (default)
rvr stale
# Show entries not updated in 7 days
rvr stale 7
# Output as JSON
rvr stale --jsonTimestamps are tracked automatically when entries are set, copied, or renamed.
Staleness is also surfaced inline — rvr get and reverie_context (MCP) append tags to stale or untracked entries:
[untracked]— entry has no update timestamp (predates staleness tracking). Most suspect.[47d]— entry hasn't been updated in 47 days. Verify before trusting version numbers, URLs, or commands.
The CLI get command prints a yellow warning for stale/untracked entries. Fresh entries show no tag.
Schema Validation
Check entries against the recommended namespace schema to keep your knowledge base organized.
# Check for entries outside recommended namespaces
rvr lint
# Output as JSON
rvr lint --json
# Check global store only
rvr lint -GDefault namespaces: project, commands, arch, conventions, context, files, deps, system. Entries outside them are listed as guidance and lint still exits 0. Declaring extra namespaces is not supported for directory stores yet.
lint exits 1 when the store itself needs repair: a file that does not parse, two keys that differ only by case, or a key stored both as an entry and as a namespace (ns.k.json beside ns.k.sub.json, after a hand edit or a git merge). In that last case listings show only the entry, and rename refuses it; rvr copy what you want to keep to a free key, then rvr rm ns.k removes both. --json lists such keys in result.entryNamespacePairs.
Shell Wrapper
By default, rvr run executes commands in a child process. This means shell builtins like cd, export, and alias have no effect on your current shell.
After running rvr config completions install, a shell wrapper function is added to your shell profile that fixes this. When you use rvr run (or rvr r), the wrapper:
Calls the real
rvrbinary with--source, which prints the resolved command to stdout instead of executing it — the command and nothing else; warnings and everything else go to stderrCaptures that output and
evals it in your current shell
All other rvr commands pass through to the binary unchanged. So does a run with --json (or with RVR_OUTPUT=json set) or --dry: what it prints is a JSON envelope or a preview, and the wrapper never evaluates it. --source itself never prints JSON: given --json or RVR_OUTPUT=json, it prints the command as usual and notes on stderr that JSON output is off.
# Store a navigation command
rvr set paths.myproject 'cd ~/Projects/my-project'
# This actually changes your directory (with the wrapper installed)
rvr r paths.myproject -y
# Without the wrapper, cd would run in a child process and have no effectThe wrapper is installed automatically by rvr config completions install. If you already have completions installed, run it again to add the wrapper, then source your shell profile. Running it again also updates a wrapper installed by an earlier version, which evaluated --json output; one you have edited by hand is left alone, and the install tells you how to remove it. If your shell profile is read-only (home-manager, for one), the install saves the current wrapper in ~/.reverie/shell-wrapper.sh for you to paste where the profile is generated from.
Shell Tab-Completion
Reverie supports tab-completion for Bash and Zsh, including commands, flags, stored keys, alias names, and more.
Quick Setup
rvr config completions installThis appends a completion loader and shell wrapper to your ~/.zshrc or ~/.bashrc and tells you to restart your shell (or source the file).
Manual Setup
If you prefer to set it up yourself:
# Zsh - add to ~/.zshrc
eval "$(rvr config completions zsh)"
# Bash - add to ~/.bashrc or ~/.bash_profile
eval "$(rvr config completions bash)"What Gets Completed
Context | Completions |
| All commands ( |
| Flags + stored data keys + aliases + namespace prefixes |
| Flags + stored data keys + aliases |
| Data keys + aliases (completes the segment after |
| Flags + namespace prefixes (one level at a time) |
| Subcommands ( |
| Subcommands ( |
| Subcommands ( |
| Config keys ( |
| Subcommands ( |
|
|
Scripting Tips
# Use plain output in other commands
ssh $(rvr get server.ip -p)
# Decrypt and copy to clipboard
rvr get api.key -d -c
# Decrypt and run without prompt
rvr run deploy.cmd -d -y
# Preview a command with interpolation
rvr run paths.myproject --dry -yStructured JSON Output
Pass the global --json flag (rvr --json <cmd>) or set RVR_OUTPUT=json once for the session to make every command — reads and mutations — print exactly one versioned envelope on stdout. Diagnostics and prompts go to stderr; failures set a non-zero exit code. This is the path for AI agents that can't run the MCP server (rvr init also writes an AGENTS.md describing it).
rvr --json get server.ip
# { "reverie": "1", "ok": true, "command": "get", "result": { "server.ip": "10.0.0.1" } }
RVR_OUTPUT=json rvr set deploy.cmd "kubectl apply -f ." # session-wide
rvr --json manifest # full command/flag tree + MCP↔CLI map (the tools/list analog)On failure, ok is false, the envelope carries error.code from a frozen set, and the process exits non-zero — branch on the code, not on prose:
rvr --json get missing.key
# { "reverie": "1", "ok": false, "command": "get", "error": { "code": "NOT_FOUND", "message": "Entry 'missing.key' not found" } }Error codes: PROJECT_UNRESOLVED, NOT_FOUND, INVALID_INPUT, REQUIRES_CONFIRMATION, ENCRYPTED_NO_PASSWORD, DECRYPT_FAILED, COMMAND_FAILED, INPUT_REQUIRED, IO, STORE_UNREADABLE, RUNTIME. (Note: --json on reads nests the value under result — a deliberate break from the pre-1.1.0 bare-value shape.) Non-fatal notices (e.g. context [trimmed]) appear in warnings[]; run on a --confirm entry without --yes returns REQUIRES_CONFIRMATION with the resolved command in error.preview.
Debugging
rvr --debug get server.productionCommand Reference
Command | Alias | Signature | Description |
|
|
| Set an entry (value optional with |
|
|
| List keys (default) or retrieve entries with |
|
|
| Execute stored command(s) ( |
|
|
| Find entries by key or value (also: |
|
|
| Open an entry's value in |
|
|
| Copy an entry to a new key |
|
|
| Remove an entry and its alias |
|
|
| Rename an entry key or alias |
|
| Bootstrap front page (essential, standard, full) | |
| Show version, stats, and storage paths | ||
|
| Command/flag tree + MCP↔CLI map (the | |
|
| Manage key aliases (set, remove, list, rename) | |
|
| Manage run confirmation (set, remove, list) | |
| Initialize project ( | ||
|
| Show entries not updated in N days (default 30) | |
| Check entries against namespace schema ( | ||
| View usage telemetry and trends, incl. organic vs bulk write split ( | ||
|
| Query audit log with before/after diffs ( | |
|
| View or change configuration settings | |
|
| Manage stored data (export, import, reset) |
Alias subcommands: set <name> <path>, remove <name>, list, rename <old> <new>
Confirm subcommands: set <key>, remove <key>, list
Config subcommands: set <key> <value>, get [key], unset <key>, info, examples, llm-instructions [--surface <mcp\|cli>], completions <bash\|zsh\|install>
Data subcommands: export <type>, import <type> <file>, reset <type>
Scope flags: -G / --global targets the global store. -A / --all on get shows both scopes with section headers.
Structured output: the global --json flag (rvr --json <cmd>) or RVR_OUTPUT=json wraps any command's output in the JSON envelope — see Scripting Tips.
MCP Server (AI Agent Integration)
Reverie includes a built-in Model Context Protocol (MCP) server, allowing any MCP-compatible AI agent to read and write your Reverie data store as a native tool. Works with Claude Code, Claude Desktop, GitHub Copilot, ChatGPT, and any other client that supports MCP.
Setup
Claude Code
Homebrew / binary install (global):
claude mcp add reverie -- rvr mcp-serverPer-project (recommended — enables project-scoped data):
claude mcp add reverie --scope project -- rvr mcp-server --cwd .The --scope project makes the registration per-project in Claude Code, and --cwd . tells the MCP server to use the project root for .reverie/ detection. You can also use the RVR_PROJECT_DIR environment variable instead of --cwd.
npm global install (npm install -g .) — dev mode:
claude mcp add reverie -- rvr-dev mcp-serverFrom source (development):
claude mcp add reverie -- bun /absolute/path/to/dist/mcp-server.jsThe standalone
rvr-dev-mcpcommand also still works for npm installs.
Claude Desktop
Homebrew / binary install:
{
"mcpServers": {
"reverie": {
"command": "rvr",
"args": ["mcp-server"]
}
}
}npm global install (dev mode):
{
"mcpServers": {
"reverie": {
"command": "rvr-dev",
"args": ["mcp-server"]
}
}
}From source:
{
"mcpServers": {
"reverie": {
"command": "bun",
"args": ["/absolute/path/to/dist/mcp-server.js"]
}
}
}Available Tools
Tool | Description |
| Store project knowledge as a key-value entry (dot notation, optional alias, optional encryption) |
| Retrieve stored knowledge by dot-notation key, or list all entries (staleness tags on stale/untracked entries, optional decrypt) |
| Remove a stored entry or alias by key |
| Copy an entry to a new key (optional force to overwrite) |
| Rename an entry key or alias (re-points the aliases of the store it writes, carries confirm flags to the new keys) |
| Search stored knowledge by keyword (keys, values, or both; regex supported) |
| Create or update an alias for a dot-notation path |
| Remove an alias |
| List all defined aliases |
| Execute a stored shell command by key (dry-run, interpolation, confirmation prompts) |
| Get one or all configuration settings |
| Set a configuration setting (colors, theme, max_backups) |
| Return a configuration setting to its default |
| Export data and/or aliases as JSON text |
| Import data and/or aliases from a JSON string (merge, replace, or preview) |
| Reset data and/or aliases to empty state |
| Bootstrap front page — pinned namespaces in full, one-line gists for the rest (use at session start; tiers: essential, standard, full; staleness tags on stale/untracked entries) |
| Find entries not updated recently (threshold in days, default 30) |
| View usage telemetry and token savings (hit rate, exploration cost avoided, per-namespace breakdown, trends) |
| Query the audit log of data mutations (before/after diffs, agent identity, scope, success/fail) |
All data-touching tools accept an optional scope parameter ("project" or "global"). When listing entries (no key), reverie_get defaults to project-only if a .reverie/ exists — pass all: true to see both scopes. Single-key lookups fall through from project to global automatically. scope: "project" needs a project (found through RVR_PROJECT, the client's roots or the server's working directory): with none, every tool refuses it with PROJECT_UNRESOLVED, reads and reverie_run included, and changes nothing. Omit scope to read through to the global store, or pass "global". The server looks for the project once and keeps the answer: after rvr init creates one under a server that started without it, restart the server — until then its unscoped writes and scope: "project" calls refuse rather than land in the wrong store, and every reverie_run asks first.
LLM Instructions
When an AI agent connects via MCP, Reverie sends built-in instructions that guide how the agent interacts with the data store (schema, scope, tool tips, effective usage patterns). These defaults are immutable and stay up to date as features are added.
To add project-specific guidance, set system.llm.instructions — your text is appended to the defaults as a PROJECT CONTEXT section, not a replacement:
# Add project-specific instructions for AI agents
rvr set system.llm.instructions "This is a monorepo. Always check arch.modules before modifying shared code. Never store secrets, even encrypted."
# View the effective instructions (defaults + your additions)
rvr config llm-instructions
# View just the built-in defaults
rvr config llm-instructions --default
# View the CLI-surface instructions (for agents driving rvr instead of MCP)
rvr config llm-instructions --surface cli
# Remove your custom additions (reverts to defaults only)
rvr rm system.llm.instructionsInstructions are surface-aware: the mcp surface (default) guides agents using the MCP tools; the cli surface (--surface cli) guides agents driving the rvr CLI with --json — the same workflow rvr init writes into AGENTS.md. For the cohort that can't run an MCP server, the CLI is a first-class agent target (see Scripting Tips and rvr manifest --json).
Verifying the MCP Server
# Binary / Homebrew install:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0.1.0"}}}' | rvr mcp-server
# From source:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0.1.0"}}}' | node dist/mcp-server.jsA successful response will include "serverInfo":{"name":"reverie"} in the JSON output.
Documentation
Document | Description |
How to structure your | |
How Reverie measures AI agent efficiency — every metric explained, estimation methodology, limitations | |
Completed features, upcoming milestones, long-term vision | |
How Reverie found and fixed its own bugs using its own MCP tools |
Development
bun install # Install dependencies
bun run build # Build the project
bun run test # Run all tests (not `bun test`: the script runs files in parallel workers, which also isolates them)
bun run test:watch # Run tests in watch mode
bun run dev:watch # Watch mode — recompiles on file changes
bun run lint # Run ESLintLicense
This project is licensed under the MIT License - see the LICENSE file for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Share one project context across ChatGPT, Claude, Telegram and any MCP client.
Cross-tool persistent memory and context for AI assistants over MCP.
Shared memory for your AI tools: tasks, notes and context every tool can read and write over MCP.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceA local-first MCP server that gives AI coding assistants persistent, structured, human-readable memory for a software project by storing project knowledge as Markdown files in the project's .dev-context-memory/ folder.71MIT
- FlicenseNot gradedqualityBmaintenanceA local-first MCP server and CLI that gives coding agents structured project memory, task contracts, context packs, backlog workflows, and verification evidence, storing data in reviewable Markdown/YAML with a fast SQLite index.4-
- AlicenseCqualityAmaintenanceLocal-first MCP server that turns project documentation and source code into durable, evidence-backed context for AI agents, with bounded retrieval and explicit gap reporting.8256 npmApache 2.0
- AlicenseNot gradedqualityCmaintenanceStandardize Context, Not Intelligence. An open protocol and native MCP server for preserving, organizing, and serving structured project context (architecture, decision logs, domain rules, and roadmap) to AI coding assistants (Cursor, Claude Desktop, Antigravity) with built-in CLI verificationMIT