Agents & skill guide
Constant is designed for coding agents to call directly, either through the
native stdio MCP server (constant mcp) or via --json CLI commands guided by
the bundled skill.
Option 1: Native stdio MCP server (recommended)
claude mcp add constant -- constant mcp
codex mcp add constant -- constant mcp
constant integration mcp-config --json # OpenCode, Cursor, generic .mcp.jsonThis exposes 7 in-process tools (constant_ask, constant_record,
constant_search, constant_recall, constant_carry, constant_sessions,
constant_runtimes) with zero external daemons or API proxies.
Option 2: Bundled agent skill
The binary embeds its own version-matched guide (constant --skill). Install it
into each runtime's skills folder:
constant integration install all # claude, codex, opencode
constant integration # check installed status
constant integration uninstall codex # remove only Constant's guide
constant --skill # print the guideThe same guide is mirrored at constant.sh/skill.md and in the
repo at skills/constant/SKILL.md (npx skills add kennykankush/constant).
Identifying the active session
| Running in | Session id |
|---|---|
| Claude Code | $CLAUDE_CODE_SESSION_ID |
| Codex | $CODEX_THREAD_ID |
| OpenCode / other | newest id for cwd from constant_sessions or constant sessions --json |
When an agent should invoke Constant
- Stuck after 2 attempts or pre-PR audit: call
constant_askwith multiple targets (["codex", "claude", "opencode"]),with_tools: true, andisolate: "worktree". - Post-compaction recall: call
constant_search(settools: trueto hit command errors and stack traces) followed byconstant_recall. - Passive snapshot before compaction: call
constant_record(idempotent bysource_sha256, writes only under~/.constant/). - Thread handoff: call
constant_carryand return the structured receipt and exact native resume command.
Guardrails in the bundled guide
- Treat
askas billable provider work; invoke only when the user asks or authorizes it. - Never run interactive TTY commands (
constant host,constant resume) from an agent; always pass--jsonor--plainon CLI reads. - Never run the
geminiCLI to inspect legacy stores; read Gemini sessions via Constant directly. - Never delete native runtime session stores; use
constant purgefor vault-confined cleanup of Constant-owned snapshots and ledger rows.
Next: The Dry Master record.