Multi-mind ask & MCP
constant ask and constant mcp make Constant agent-native: an active coding
agent can consult one or multiple independent runtimes on its exact, unedited
conversation (including failing tool outputs) without taking over your terminal
or losing context to a summary.
Parallel multi-mind ask & harness:model matrix
Pass comma-separated targets (--to claude:sonnet,claude:opus,codex:o3,antigravity)
or repeat --to to fan out concurrently from a single frozen Dry Master snapshot:
constant ask \
--to claude:sonnet,claude:opus,codex:o3,antigravity \
--session "$CLAUDE_CODE_SESSION_ID" \
--with-tools \
--render triage \
--isolate worktree \
--verify-cmd "cargo test" \
--question "Audit this root cause and propose a minimal patch." \
--jsonWhat happens under the hood, in-process:
- Constant reads the source session once and seals one immutable Dry Master
chapter (
chNN) under~/.constant/snapshots/. - Native forks (
codex,claude,opencode) are materialized sequentially so registries and SQLite never race; Antigravity (agy), ACP agents, and external plugins receive the projected Dry Master directly (optionally sliced with--until-turn Kor compressed with anti-compaction--render triage). - All targets execute in parallel via
std::thread::scopeagainst a shared deadline (--timeout SECS, default300), each pinned to its explicit--modelwhen<harness>:<model>is specified. - When
--verify-cmdis set, Constant runs the verification command inside each target's workspace/ephemeral worktree before teardown and captures its pass/fail status, exit code, and output tails alongsidefiles_touchedand unifiedpatch_diff. - Constant computes a deterministic zero-LLM
divergencesummary comparing answers, shared vs. unique file references per target, worktree diffs, and objectiveverify_passed_by/verify_failed_byoutcomes.
Workspace isolation (--isolate)
| Mode | Behavior |
|---|---|
auto (default) | Uses worktree when querying multiple targets inside a git repo; none for single target. |
worktree | Creates one RAII-guarded detached git worktree per target, mirrors uncommitted tracked changes as a temporary detached baseline commit, captures net edits (including new files), and deletes every worktree unconditionally on drop. |
readonly | Passes verified read-only flags (codex exec -s read-only, claude --permission-mode plan, plugin readonly: true; ACP cancels permission prompts automatically). |
none | Runs directly in the conversation's working directory. |
Multi-target JSON envelope
Single-target constant ask --json keeps its flat response shape (ok, to,
answer, session, resume, receipt, snapshot). Multi-target runs emit:
{
"ok": true,
"all_ok": true,
"multi": true,
"handle": "cobalt-37",
"trail": "ch03",
"isolation": "worktree",
"targets": ["codex", "claude", "opencode"],
"results": [
{
"ok": true,
"to": "codex",
"adapter_kind": "builtin",
"answer": "...",
"files_touched": ["src/auth.rs", "src/session.rs"],
"patch_diff": "...",
"elapsed_ms": 4120
}
],
"divergence": {
"targets_succeeded": 3,
"targets_failed": 0,
"answers_identical": false,
"shared_references": ["src/auth.rs"],
"unique_references_by_target": {
"codex": ["src/session.rs"],
"claude": ["src/retry.rs"]
},
"patches_differ": true,
"summary": "3/3 answered · divergent answers · 1 shared file ref(s) · worktree patches differ"
}
}Native stdio MCP server (constant mcp)
Constant ships a zero-dependency JSON-RPC 2.0 stdio MCP server directly inside the binary. All 7 tools run in-process with diagnostics strictly on stderr.
Connect your host
# Claude Code
claude mcp add constant -- constant mcp
# Codex
codex mcp add constant -- constant mcp
# Print exact snippets for OpenCode, Cursor, Windsurf, Cline, Goose
constant integration mcp-config
constant integration mcp-config --jsonGeneric .mcp.json / .cursor/mcp.json:
{
"mcpServers": {
"constant": {
"command": "constant",
"args": ["mcp"]
}
}
}Tools exposed
| Tool | Description |
|---|---|
constant_ask | Consult 1 or N runtimes in parallel (targets[] or to, session or from, question, with_tools, isolate, timeout_secs). |
constant_record | Seal an idempotent Dry Master snapshot (session or from, force). |
constant_search | Deterministic zero-LLM lexical search across turns and (tools: true) redacted tool calls/outputs. |
constant_recall | Read verbatim turns and paired redacted tool traffic by handle, chapter, and range. |
constant_carry | Materialize a native resumable projection in codex, claude, opencode, or a write_native plugin. |
constant_sessions | Discover local sessions on disk linked to Constant handles. |
constant_runtimes | List built-ins, configured ACP agents, and discovered constant-adapter-* plugins. |