Docs/Agents & skill guide▾

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.

claude mcp add constant -- constant mcp
codex mcp add constant -- constant mcp
constant integration mcp-config --json   # OpenCode, Cursor, generic .mcp.json

This 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 guide

The 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 inSession id
Claude Code$CLAUDE_CODE_SESSION_ID
Codex$CODEX_THREAD_ID
OpenCode / othernewest 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_ask with multiple targets (["codex", "claude", "opencode"]), with_tools: true, and isolate: "worktree".
  • Post-compaction recall: call constant_search (set tools: true to hit command errors and stack traces) followed by constant_recall.
  • Passive snapshot before compaction: call constant_record (idempotent by source_sha256, writes only under ~/.constant/).
  • Thread handoff: call constant_carry and return the structured receipt and exact native resume command.

Guardrails in the bundled guide

  • Treat ask as 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 --json or --plain on CLI reads.
  • Never run the gemini CLI to inspect legacy stores; read Gemini sessions via Constant directly.
  • Never delete native runtime session stores; use constant purge for vault-confined cleanup of Constant-owned snapshots and ledger rows.

Next: The Dry Master record.