# Constant — Portable Agent Cognition > Portable agent cognition. Seal one unedited Dry Master conversation record (turns, redacted tool calls, failing tool outputs, receipt, SHA-256, and runtime/git metadata), rewind before bad turns, triage past compaction cliffs, and verify across Codex, Claude Code, OpenCode, Antigravity (`agy`), ACP agents, and external plugins via native stdio MCP, parallel worktree `ask`, and counterfactual `replay`. Constant makes zero model calls on `record`, `search`, `recall`, or `carry`. It runs no API proxy and requires no account. Originals are read as seeds and never overwritten. ## Quick Start for Coding Agents - Install binary (macOS): `brew tap kennykankush/constant https://github.com/kennykankush/constant && brew install kennykankush/constant/constant` - Install binary (Linux x86_64 / macOS): `curl -fsSL https://raw.githubusercontent.com/kennykankush/constant/main/scripts/install.sh | sh` - Connect native MCP server in Claude Code: `claude mcp add constant -- constant mcp` - Connect native MCP server in Codex: `codex mcp add constant -- constant mcp` - Connect native MCP server in Antigravity (`agy`): `agy mcp add constant constant mcp` - Print MCP config snippets for Cursor, OpenCode, Windsurf, Cline, Goose: `constant integration mcp-config --json` - Install bundled CLI agent skill in all runtimes: `constant integration install all` ## Native MCP Tools (`constant mcp`) - `constant_ask`: Consult one or multiple independent runtimes or `harness:model` cells (`claude:sonnet`, `claude:opus`, `codex:o3`, `agy:gemini-3-pro`) in parallel on the same frozen Dry Master (`targets`, `session` or `from`, `question`, `with_tools`, `render`: `full|paged|triage`, `until_turn`, `isolate`: `auto|worktree|readonly|none`, `verify_cmd`, `verify_timeout_secs`, `timeout_secs`). Returns per-cell answers, isolated git worktree `files_touched` + `patch_diff`, objective `verify` pass/fail outcomes, and zero-LLM `divergence`. - `constant_record`: Seal an idempotent Dry Master snapshot (`schema: constant/v2`) keyed by `source_sha256` without writing any native runtime store. - `constant_search`: Deterministic zero-LLM lexical search across turns and (`tools: true`) redacted tool calls and outputs, returning exact recall coordinates. - `constant_recall`: Read verbatim turns and paired redacted tool traffic by handle, chapter, and turn range. - `constant_carry`: Materialize a native resumable session projection in `codex`, `claude`, `opencode`, or a `write_native` plugin, with anti-compaction `render: "triage"` and trajectory rewind `until_turn`. - `constant_sessions`: Discover local sessions on disk across Codex, Claude Code, OpenCode, Antigravity (`agy`), and legacy Gemini CLI. - `constant_runtimes`: List built-in codecs, configured ACP agents (`~/.constant/runtimes.json`), and discovered `constant-adapter-*` plugins with capabilities. ## Anti-Compaction, Rewind & Matrix Verification (v0.12.0) - **Anti-compaction triage (`--render triage`)**: Pins Turn 1 and constraint/decision user turns verbatim, rescues earlier failing tool errors, collapses bulky passing tool outputs (`> 400` chars) into exact `constant recall` pointers, and self-cleans on re-carry (full Dry Master stays untouched). - **Trajectory rewind (`constant rewind --turn K` / `--until-turn K`)**: Truncates projections cleanly after 1-based Turn K (keeping paired tool events through Turn K) and mints a fresh fork or headless consultation without thinning the sealed Dry Master. - **`Model × Harness` matrix + `--verify-cmd`**: Pass `:` cells to `ask`, `replay`, `rewind`, or `constant_ask`, and run `--verify-cmd "cargo test"` inside each target's ephemeral worktree before cleanup for objective pass/fail scoring. ## Machine-Readable Manuals - [Full Agent Manual](https://constant.sh/llms-full.txt): Complete CLI reference, MCP JSON-RPC tool schemas, ACP config, 4-verb plugin protocol, Dry Master v2 format, and trust boundary in one file. - [Bundled Agent Skill](https://constant.sh/skill.md): Exact `SKILL.md` embedded in the Constant binary (`constant --skill`). ## Documentation - [Overview](https://constant.sh/docs): What Constant does, Studio Re-Amping model, and supported runtimes. - [Installation](https://constant.sh/docs/installation): Homebrew, curl installer, Cargo from source, and `constant doctor`. - [Quickstart](https://constant.sh/docs/quickstart): First MCP connection, parallel multi-mind `ask`, Dry Master `record`/`search`, and native `carry`. - [Multi-Mind Ask & MCP](https://constant.sh/docs/ask-and-mcp): Parallel fan-out, ephemeral git worktree isolation, read-only flags, divergence JSON, and all 7 MCP tools. - [Universal Runtimes (ACP & Plugins)](https://constant.sh/docs/runtimes): Built-in codecs, `~/.constant/runtimes.json` ACP bus, and the 4-verb `constant-adapter-` plugin protocol. - [Counterfactual Replay](https://constant.sh/docs/replay): Benchmark models and harnesses from Turn K across archived Dry Masters with `--pin-commit`. - [The Dry Master Record](https://constant.sh/docs/record): `constant/v2` snapshots, `record`, `search`, `recall`, `restore`, `pack`/`unpack`, and atomic `purge`. - [Agents Guide](https://constant.sh/docs/agents): Connecting Claude Code, Codex, OpenCode, Cursor, and custom MCP hosts. - [Commands Reference](https://constant.sh/docs/commands): Full CLI flags, JSON output contracts, and environment variables. - [Trust Boundary](https://constant.sh/docs/trust-boundary): Exact filesystem writes, atomic temp+fsync+rename, `flock` ledger lock, secret redaction, and `purge` containment. - [GitHub Repository](https://github.com/kennykankush/constant): Rust source code, library crate (`src/lib.rs`), and examples.