Skip to content

Agent integrations

Straitjacket is a context and evidence sidecar, not a replacement coding harness. The harness owns the model and tool loop. The sidecar adds bounded capture, retrieval, and optional edit verification.

Claude Code Codex Antigravity Hermes Oh My Pi OpenCode DeepSeek Harness

Continue using Claude Code, Codex, Antigravity, Hermes, Oh My Pi, OpenCode, or DeepSeek Harness. Straitjacket adds evidence capture, bounded retrieval, and an optional verified edit workflow. Your coding agent retains its conversation, models, authentication, native tools, and permission prompts.

This guide covers the four new native integrations. For Claude Code, Codex, and Antigravity setup, see Getting started. The capability matrix distinguishes explicit tools from automatic interception.

The agent receives ctx for bounded navigation and retrieval, and ctx_edit for anchored patches and structural rewrites. Native plugins connect the same guard and edit-outcome ledger used by the existing integrations. Command execution stays in the agent’s native terminal tool: use ctx run -- pytest -q to capture a noisy run and ctx to retrieve follow-up evidence.

Hermes, OMP, and OpenCode can rewrite recognized command inputs and replace oversized text results. DSH gates calls and bounds text but cannot change sealed arguments; it returns the bounded command for an explicit retry. Native edits are observed in the edit ledger, not silently converted into verified transactions. Use ctx_edit when you need those guarantees.

Output replacement covers text, not image/audio blocks or metadata. OMP direct eval bridges bypass tool events, and error results can be rethrown unchanged. DSH preserves downstream canonical-value transformations; its content gate is not a confidentiality boundary for programmatic values. See the capability matrix for the complete scope.

ctx setup installs native hooks and MCP wiring. To configure ACP through the same setup command, select one host and model:

Terminal window
ctx setup --host opencode --acp --acp-model provider/model-id

Replace the model placeholder with the exact id your agent advertises. ACP setup covers all seven agents, adapter commands, and permissions. ACP workers receive MCP tools in their actual worktree; interactive setup persists in the agent’s native configuration.

Install Straitjacket and the chosen agent separately. This setup does not install an agent or configure provider credentials. The commands below require a Straitjacket build containing these integrations; they are not a claim that the current PyPI release already includes them.

From the repository where the agent will work:

If no agent is installed, automatic setup prepares project-local integrations and leaves Hermes for later: its active profile requires the Hermes CLI.

Terminal window
ctx wrap detect
ctx setup --host omp
ctx doctor

Use hermes, omp, opencode, or dsh for --host. The aliases open-hermes and oh-my-pi also work. Here, Open Hermes means Nous Research’s Hermes Agent, not the OpenHermes model family.

AgentConfigurationStart after setup
HermesActive profile’s MCP entry and enabled plugins/straitjacket/; local recipe in .ctx/hosts/hermes.jsonhermes chat
Oh My Pi.omp/mcp.json and .omp/hooks/pre/straitjacket.jsomp
OpenCodeExisting opencode.json or opencode.jsonc, and .opencode/plugins/straitjacket.jsopencode
DeepSeek Harness.ctx/hosts/dsh.cordis.patch.yml, loading MCP and .ctx/hosts/straitjacket-dsh.mjsctx wrap dsh -- --profile web

OMP setup merges unrelated JSON settings and MCP servers. OpenCode uses parsed source edits for JSON and JSONC, preserving comments, trailing commas and existing integrations. Preview with ctx setup --host opencode --preview, then accept safe additions with ctx setup --host opencode --apply. A conflicting entry, duplicate key, malformed file or symlink refuses the write. When both project configuration files exist, setup refuses rather than choosing precedence or creating another file. See setup and removal for ownership and repair behavior.

Preview a host’s native configuration without writing:

Terminal window
ctx wrap opencode --print-config

Install a Hermes version with config get <key> --json and config set. Setup adds the ctx-harness MCP entry, locates the active profile with hermes config path, installs its straitjacket plugin, and enables it with hermes plugins enable straitjacket. The plugin runs only where ctx.toml is present above the working directory. Existing models and other MCP servers remain configured. Hermes owns the YAML serialization; Straitjacket does not parse or rewrite that YAML.

The entry belongs to Hermes’ active profile and applies across its sessions. Its workspace argument uses Hermes’ ${workspaceFolder} interpolation. To target a profile, select it using Hermes’ profile controls before setup, or set HERMES_HOME to that profile directory for both setup and launch. Rerun setup when switching profiles. ctx doctor checks the currently active profile. The wrapper rejects launch-only --profile / -p flags so it cannot configure one profile and then launch another.

If Hermes is absent, setup can prepare the local recipe, but validation reports that the integration is not active. Install Hermes and rerun setup. Config command errors and administrator restrictions remain failures; setup does not bypass them.

DSH is in developer preview. Straitjacket renders a separate Cordis patch that inserts @deepseek-ai/dsh-mcp-client and the managed native hook module. DSH ships the MCP dependency. The patch is JSON, which is valid YAML, and loads the JavaScript plugin through Cordis’ normal plugin loader.

Terminal window
ctx wrap dsh -- --profile web
ctx wrap dsh -- --profile headless "Inspect this repository using the ctx MCP tool"

The wrapper prepends --patch <absolute-path> and preserves your remaining arguments and DSH’s exit status. You can instead use the complete dsh command printed by setup. A plain dsh web invocation does not load this overlay. ctx doctor verifies the patch contents, not a running DSH connection.

OMP, OpenCode, and Hermes can also be launched after setup in one command:

Terminal window
ctx wrap omp -- --model <your-model>
ctx wrap opencode -- run "Inspect this repository using ctx"
ctx wrap hermes -- chat

Replace <your-model> with an identifier supported by your OMP installation. Arguments after -- go to the agent without shell expansion. Configuration persists after exit. These are not ephemeral wrappers. Proxy, gateway, and orchestration wrapper options are unsupported for these four hosts and return an error.

First retrieve an anchored source span with ctx. Call ctx_edit with op: "replace", its ref and span, and the replacement text. The default is a preview: inspect its patch, then use op: "apply" with the returned planRef. Stale or ambiguous source is refused. Structural rewrites use op: "rewrite" with a pattern, replacement, language, and optional glob; op: "rewrite_apply" requires that preview’s receiptRef. Structural rewrites require ast-grep and refuse incomplete previews. Applying proves which bytes changed; verification checks whether they are correct.

ctx doctor validates configured entries. To check the running integration, start the host, locate its ctx-harness MCP server, and ask its ctx tool for {"op":"repo","workspace":"/absolute/path/to/project"}. Confirm that the result describes your repository. The explicit workspace is useful when a host’s terminal runs remotely or in a container: the MCP subprocess must have access to the same checkout. Setup targets the machine running ctx.

To remove, stop sessions using the integration, then:

  • OMP: remove mcpServers.ctx-harness from .omp/mcp.json and the managed .omp/hooks/pre/straitjacket.js plugin.
  • OpenCode: remove mcp.ctx-harness from the JSON or JSONC file you used and .opencode/plugins/straitjacket.js.
  • Hermes: run hermes config unset mcp_servers.ctx-harness in the same profile and hermes plugins disable straitjacket; remove the managed profile plugin and .ctx/hosts/hermes.json / .ctx/hosts/hermes-plugin/ recipes.
  • DSH: stop passing the patch; remove .ctx/hosts/dsh.cordis.patch.yml and .ctx/hosts/straitjacket-dsh.mjs.

Remove a host from .ctx/acp.json to restore its original orchestration transport. Stop existing sessions before removing their active integrations.

Keep unrelated settings and captured artifacts unless you also intend to remove them. Deleting a server entry leaves its surrounding config file; ctx doctor will report it missing until you remove that unused file or reinstall the integration.

The implementation follows these upstream contracts, reviewed on 2026-09-06:

Tests cover configuration preservation/refusal, executable Python/JavaScript callbacks, real MCP edit transactions, and stdio ACP protocol exchanges. Live agent/model sessions remain unverified. Successful rendering alone does not establish host-version compatibility or better task outcomes.

Native hook contracts: