TermAl

Agent Integration Comparison

Cross-agent reference for TermAl adapter design.

Capability details in this document were last verified on 2026-08-13. Agent products and ACP are evolving independently, so implementation decisions must be based on the capability advertised by the connected runtime rather than on the agent name alone.

Protocol and transport

  Claude Code Codex Gemini CLI Cursor CLI
Wire protocol NDJSON (custom) JSON-RPC 2.0 stream-json stdout or ACP (experimental) ACP (JSON-RPC 2.0)
Transport stdin/stdout only stdin/stdout or WebSocket Spawned CLI stdout or stdio (ACP) stdin/stdout only
Bidirectional Yes Yes No (stream-json) / Yes (ACP) Yes
Server mode No codex app-server --experimental-acp cursor agent acp
Best TermAl integration Spawn child and speak NDJSON over stdio Spawn shared app-server and speak JSON-RPC over stdio (fire-and-forget writer, resilient reader) Spawn CLI in ACP mode over stdio Spawn agent acp and speak JSON-RPC over stdio

Session persistence

  Claude Code Codex Gemini CLI Cursor CLI
Storage format Append-only .jsonl JSONL rollout plus SQLite cache Single .json per session Managed by Cursor
Location .claude/sessions/{id}.jsonl ~/.codex/sessions/YYYY/MM/DD/rollout-{id}.jsonl ~/.gemini/tmp/<project>/chats/session-{ts}-{id}.json Managed internally
Resume mechanism --resume <session-id> thread/resume --resume <index\|latest> (CLI) or session/load (ACP) session/load
Session discovery Scan .claude/sessions/ Query SQLite threads table Scan chats/ directory Via ACP session management
Cross-session memory File-based CLAUDE.md SQLite-backed memory pipeline save_memory writes to GEMINI.md .cursor/rules

Context and instructions

  Claude Code Codex Gemini CLI Cursor CLI
Instructions file CLAUDE.md AGENTS.md GEMINI.md .cursor/rules
Hierarchy Global plus Project Global plus Project plus Subdirectory Global plus Extension plus Project Global plus Project
Memory file ~/.claude/memory.md N/A ~/.gemini/memory.md N/A
Ignore file .claudeignore N/A .geminiignore .cursorignore
JIT subdirectory discovery No No Yes No

Approval and permissions

  Claude Code Codex Gemini CLI Cursor CLI
Mechanism control_request and control_response JSON-RPC server requests Policy engine and confirmation bus session/request_permission
TermAl can intercept Yes Yes No (stream-json) / Yes (ACP) Yes
Authenticated structured reviewer submit Yes, qualified injected MCP tool identity Yes, MCP-server-authenticated elicitation No over ACP v1 No over ACP v1
Persist decisions Settings file N/A auto-saved.toml Via allow-always option
Safety checkers Built-in Sandbox model Pluggable Built-in

ACP v1 permission requests identify a tool call by toolCallId and a human-readable title, but do not carry a portable authenticated MCP server/tool identity. Current runtimes also diverge in their extensions: Cursor has emitted a flat toolName, Gemini emits the standard nested tool call without a name, and OpenCode uses its permission category as the title. TermAl therefore does not infer control-plane authority from any of those presentation fields. mode: reviewer is accepted only for Claude and Codex; Cursor, Gemini, and OpenCode can still use mode: explorer where their write policy is supported. This is a fail-fast protocol boundary, not an agent-name workaround: ACP reviewers can be enabled together when ACP exposes an authenticated tool-origin contract.

Advanced features

  Claude Code Codex Gemini CLI Cursor CLI
Thread forking CLI fork at the current head; Agent SDK supports up_to_message_id thread/fork, optionally through lastTurnId Saved restore points can branch earlier history “Duplicate Chat” from a selected message in Cursor UI; not exposed by TermAl’s ACP path
Compaction Auto summarization thread/compact/start Two-pass summarization Managed internally
Rollback /rewind can restore conversation, code, or both thread/rollback exists but is deprecated /rewind can restore conversation, code, or both No documented rollback method in TermAl’s ACP path
Archival No thread/archive and thread/unarchive No No
Loop detection Repetition detection No Multi-stage detection Built-in
Hooks Pre-commit style No 11 lifecycle events Session start/end, prompt, stop
Sub-agents Via tools Single agent Local plus remote via A2A cursor/task sub-agent
Checkpointing Per-prompt conversation and edit checkpoints Persisted thread turns and Git Conversation snapshots plus shadow Git repo Managed internally
Mid-turn interrupt control_request interrupt Yes via JSON-RPC No IPC path (stream-json) session/cancel
Agent modes N/A N/A N/A agent, plan, ask
Cloud handoff No No No Yes (push to cloud via & prefix)

Point-in-time conversation branching and rewind

TermAl must distinguish two operations that can look similar in the UI:

Truncating only TermAl’s local message list is not a conversation rewind. The provider would still retain the removed turns in model-visible context, leaving the transcript and the live agent state inconsistent.

Capability matrix

Agent or protocol Native capability Current TermAl support
Codex Exact non-destructive fork through thread/fork(lastTurnId). The destructive thread/rollback method is deprecated. Partial: TermAl can fork only from the current thread head and exposes rollback by trailing turn count. It does not yet persist the Codex turn ID needed to fork from a selected visible turn.
Claude Code /rewind can restore conversation, code, or both. The Claude Agent SDK can create an exact fork with fork_session(..., up_to_message_id=...). Not exposed. TermAl’s persistent stream-json bridge retains the Claude session ID but does not persist native message UUIDs for visible TermAl messages.
Gemini CLI /rewind can restore conversation, code, or both. Named saved restore points can be resumed as a separate history branch. Not exposed. TermAl runs Gemini through ACP, which does not expose Gemini’s interactive rewind workflow.
OpenCode The native TUI supports /undo and /redo; the CLI can fork a resumed session, and the native SDK/API has message revert/unrevert operations. Not exposed. OpenCode documents /undo and /redo as unsupported in ACP mode, which is the transport TermAl uses.
Cursor Cursor UI can duplicate a chat from any selected message while preserving the original. Not exposed by Cursor’s TermAl ACP connection. Cursor CLI documents resume, but no stable point-specific fork or rewind method available through this path.
Generic ACP session/fork exists as an unstable, capability-negotiated method. Point-specific fork by message ID is a future extension, not a stable cross-agent contract. TermAl currently records only ACP session/load and session/resume capabilities and does not dispatch session/fork.

TermAl implementation constraints

An exact action needs a durable mapping from a TermAl turn boundary to the provider’s native anchor:

Provider path Required anchor
Codex App Server turnId passed as lastTurnId
Claude Code / Agent SDK Claude transcript message UUID passed as up_to_message_id
ACP Stable messageId plus an advertised point-fork capability; a generic ACP message ID alone is insufficient
Provider-specific fallback The provider’s documented checkpoint or revert identifier

Message array indices and “remove the last N messages” are not safe anchors. History paging, bounded-window trimming, transcript repair, tool cards, and multiple assistant items inside one provider turn can all change the number and position of visible TermAl messages. In particular, codex_thread_messages_from_json currently allocates fresh TermAl message IDs and does not retain the enclosing Codex turn ID.

Conversation state and workspace state must also remain separate. The default action should preserve files exactly as they are. A distinct Also restore files choice may be offered only when the provider can describe what it will restore and after TermAl accounts for concurrent sessions and manual changes. Provider checkpoints generally do not cover arbitrary shell commands, remote side effects, or edits made by another process.

An approximate fallback may create a fresh session and replay the visible transcript prefix, but it must be labelled approximate. Visible messages do not fully reproduce hidden tool results, hooks, provider compaction state, system context, approvals, or provider-specific reasoning items.

  1. Add Branch from here for completed Codex turns using thread/fork(lastTurnId), while preserving the source TermAl session.
  2. Retire or clearly mark the Codex rollback-by-count UI as legacy because the upstream thread/rollback method is deprecated.
  3. Persist Claude native message UUIDs and add exact Claude branching through the supported Agent SDK session-fork primitive.
  4. Extend ACP capability capture to include session/fork, but expose it only when the connected runtime advertises support. Treat point-specific fork as unavailable until the runtime explicitly advertises that stronger contract.
  5. Add provider-specific Gemini, OpenCode, and Cursor actions only through their documented programmatic surfaces; do not synthesize destructive rewind by editing the local transcript.

Primary references:

Pricing

  Claude Code Codex Gemini CLI Cursor CLI
Model Subscription plan Per-token API key Per-token API key or OAuth Cursor subscription

VS Code extension

  Claude Code Codex Gemini CLI Cursor CLI
Extension anthropic.claude-code No official extension vscode-ide-companion Native (Cursor is the editor)
Connects via Spawns CLI and speaks NDJSON N/A HTTP plus MCP Built-in
Context sync File context via tools N/A Active file, cursor, selection, open files Full editor context
Auth Same process N/A Bearer token via env var Same process

ACP protocol convergence

Both Cursor CLI and Gemini CLI (experimental) implement the Agent Client Protocol (ACP), a JSON-RPC 2.0 over stdio standard originally developed between Zed and Google. This means a shared ACP adapter in TermAl could serve both agents, with differences isolated to:

Concern Cursor CLI Gemini CLI (ACP)
Executable cursor gemini
Subcommand agent acp --experimental-acp
Auth methods cursor agent login, --api-key, --auth-token OAuth, GEMINI_API_KEY, Vertex AI
Extended methods cursor/ask_question, cursor/create_plan, cursor/update_todos TBD
Stability Stable Experimental, but already used by TermAl

See individual feature briefs for full protocol details:

Future candidate: Kimi CLI

Kimi is not currently a supported TermAl agent, but it is a strong future-work candidate because Kimi CLI now documents ACP support through kimi --acp. The preferred path is to extend the shared ACP adapter with AcpAgent::Kimi rather than adding a separate OpenAI-compatible chat runtime.

Concern Kimi CLI
Status in TermAl Future work
Executable kimi
Subcommand --acp
Protocol ACP over stdio
Default model candidate kimi-k2.6
Auth/API key Moonshot/Kimi API key, usually MOONSHOT_API_KEY
Platform caveat Kimi CLI is currently documented for macOS and Linux only
Main risk Technical-preview CLI and provider-specific ACP behavior

See kimi-cli-integration.md for the future-work brief.