---
name: coding-agent-clis
description: "Delegate coding tasks to external agent CLIs such as Claude Code, Codex, and OpenCode."
version: 1.0.0
author: Hermes Agent
license: MIT
platforms: [linux, macos, windows]
metadata:
  hermes:
    tags: [Coding-Agent, CLI, PTY, automation, refactoring, review]
---

# Coding Agent CLIs

Use this skill when you want Hermes to orchestrate an external coding agent CLI rather than doing the work directly.

Covered backends:

- Claude Code
- OpenAI Codex CLI
- OpenCode

## Shared pattern

All three tools follow the same basic shape:

1. verify the CLI is installed and authenticated
2. run a bounded one-shot task when possible
3. use an isolated workdir or worktree for code edits
4. monitor long tasks without blocking the parent session
5. verify the result with git diff and tests

## Choose the right mode

### One-shot / print mode

Use this for a single task that should start, finish, and exit.

Good for:

- fixing a bug
- writing tests
- summarizing a diff
- creating a small refactor
- reviewing code once

### Interactive mode

Use this for iterative work where the agent needs back-and-forth.

Good for:

- exploratory refactors
- long debugging sessions
- PR review with follow-up questions
- tasks that need checkpoints

## Claude Code

Claude Code is strong for interactive coding and review work.

Prefer:

- `claude -p` for one-shot tasks
- `tmux` for interactive TUI sessions
- explicit workdirs or worktrees for edits
- `--allowedTools` when you want to constrain capabilities

Watch for the trust and permission dialogs if you launch the interactive TUI.

## Codex

Codex is best treated as an interactive terminal app that expects a PTY.

Prefer:

- `codex exec` for short tasks
- `pty=true` for anything that opens the TUI
- `--full-auto` only when the task is scoped and safe
- a git repository, even for scratch work

If the environment is brittle, isolate the task with a clean worktree or temp repo.

## OpenCode

OpenCode works well for autonomous runs and parallel edits.

Prefer:

- `opencode run` for one-shot tasks
- background TUI sessions for longer work
- separate workdirs for concurrent tasks
- explicit binary checks if PATH resolution looks wrong

## Orchestration rules

- Prefer the smallest scope that can succeed.
- Keep each agent in its own workdir when parallelizing.
- Never let multiple agent CLIs edit the same tree at once.
- Review the final diff yourself before reporting success.
- If the agent reports a result, verify it against the filesystem or git state.

## Common pitfalls

- interactive CLIs usually need a PTY
- worktrees are safer than shared directories
- background sessions still need supervision
- every external agent can hallucinate success, so verify the actual files and tests

## When to use which

- **Claude Code**: best for rich interactive coding sessions
- **Codex**: best for task-oriented automation and sandboxed edits
- **OpenCode**: best for configurable autonomous runs and parallel jobs

