Skip to main content

Claude, Codex, and Harness

Agent Terminal is the context layer between an agent provider and execution. It keeps session history, asks Agent Brain for reusable context, and sends bounded work to Agent Harness when you choose delegation.

Install the adapters

From an Agent Terminal checkout, run:

node scripts/setup-agent-integration.mjs

The setup command backs up an existing ~/.claude/settings.json, adds the provider hooks without replacing unrelated settings, writes ~/.agent-terminal/integration.json, and installs the Codex launcher. It also supports native Windows, where the launcher is written to %LOCALAPPDATA%\AgentTerminal\bin\codex-terminal.cmd.

Set the service URLs when Terminal is not using the default local stack:

export AGENT_TERMINAL_URL=http://127.0.0.1:4302
export BRAIN_BASE_URL=http://127.0.0.1:9090
export HARNESS_BASE_URL=http://127.0.0.1:5001
node scripts/setup-agent-integration.mjs

Re-run with --force to replace the Codex launcher. Use --claude-only or --codex-only for a single provider.

Claude Code

Claude receives the full Terminal lifecycle:

  • UserPromptSubmit evaluates the prompt with the pre-send guard and returns bounded prior-context summaries as reference material
  • SessionStart requests a compact checkpoint for continuity
  • PostToolUse records tool activity
  • PreCompact returns a bounded handoff before compaction
  • Stop closes and summarizes the session, then asks Brain to consolidate it

The hooks fail open. If Terminal or Brain is unavailable, Claude continues without the enrichment rather than being blocked.

Codex

For non-interactive JSONL runs, use the installed launcher:

codex-terminal exec --json "Run the bounded task"

The wrapper records user, assistant, and tool events and closes the session with a compact checkpoint. For an interactive provider handoff, use Terminal's Resume/Handoff flow. It creates a reviewed context pack, keeps the workspace path explicit, and launches Codex or Claude in the selected workspace.

Agent Harness

When you delegate from Terminal, the request carries the selected context pack, Brain hints, task constraints, verification commands, and the requested worker profile to Harness. Terminal then tracks the run and exposes its artifacts and verification status. Harness remains usable directly when Terminal is offline; the context enrichment is simply unavailable.

Configure the optional service endpoints when running the complete local loop:

export BRAIN_BASE_URL=http://127.0.0.1:9090
export HARNESS_BASE_URL=http://127.0.0.1:5001

Verify the loop

curl -fsS http://127.0.0.1:4302/api/health
curl -fsS 'http://127.0.0.1:4302/api/history/sessions?limit=1'

Open a fresh Claude session or run a small codex-terminal exec --json task, then confirm the session appears in Terminal History. For a delegated task, inspect the run in the Runs view and verify its artifacts before accepting it.