Install
openclaw skills install hermes-code-bridgeUse when connecting Hermes Agent to local coding CLIs such as Codex, Kimi Code, Claude Code, OpenCode, Gemini CLI, or other terminal-based coding assistants. Provides a general bridge workflow for discovering agents, reusing sessions, dispatching prompts, monitoring execution, collecting evidence, and reporting results without pretending Hermes did the delegated work.
openclaw skills install hermes-code-bridgeHermes Code Bridge turns Hermes Agent into a control layer for local terminal-based coding agents. The goal is not to replace Codex, Kimi Code, Claude Code, OpenCode, Gemini CLI, or similar tools. The goal is to let Hermes coordinate them safely: choose the right tool, reuse the right session, send a precise task prompt, monitor the run, collect raw evidence, and report what actually happened.
Use this skill when the user wants Hermes to connect to one or more local coding CLIs and make them do implementation, review, debugging, research, experiment management, documentation, or repository maintenance work.
The bridge pattern is:
User request
-> Hermes clarifies scope and chooses an existing local coding agent/session
-> Hermes sends a structured prompt through the real CLI
-> Local coding CLI executes in its own workspace/session
-> Hermes monitors output, verifies artifacts, and reports evidence
Hermes is the control plane. Local coding CLIs are execution backends. The terminal, tmux, session archives, and output files are the transport and evidence layer.
This is intentionally lighter than a full multi-agent workspace manager. Projects such as CCB (claude_codex_bridge) create visible tmux workspaces with configured panes, sidebars, team topology, worktrees, and inter-agent communication. Hermes Code Bridge is a Hermes skill: it does not require a new workspace system. It teaches Hermes how to drive whichever local coding CLIs are already installed, while preserving real sessions and verifiable outputs.
Use this skill when:
Do not use this skill when:
Use the real CLI. If the user asks for Codex, run Codex. If the user asks for Kimi Code, run Kimi Code. Do not use delegate_task, execute_code, or a Hermes subagent and claim that a different tool did the work.
Preserve session ownership. Existing coding-agent sessions contain context, decisions, tool history, and project assumptions. Reuse the correct session whenever possible. Do not create a new session just because it is easier.
Hermes coordinates; workers execute. Hermes can inspect, route, prompt, monitor, and summarize. The local coding CLI should own the actual code edits or experiment actions when the user requested that tool.
Confirm before dispatch when side effects matter. If the task may edit files, run expensive jobs, change git state, call external APIs, or resume an ambiguous session, show the chosen agent/session and prompt draft before sending it.
Report evidence, not vibes. Final reports should include the actual CLI invoked, working directory, session id when relevant, output summary, artifacts produced, verification checks, and any failure or uncertainty.
Keep it general and private. Public skills must not contain personal paths, private project names, private session IDs, credentials, private endpoints, or organization-specific assumptions.
Think of the bridge as four layers:
| Layer | Responsibility |
|---|---|
| Hermes control layer | Interpret user intent, choose backend, write prompt, monitor, verify, report. |
| Coding CLI backend | Codex, Kimi Code, Claude Code, OpenCode, Gemini CLI, or another terminal coding assistant. |
| Session/state layer | Existing CLI sessions, project directories, tmux panes, logs, JSONL archives, or CLI history files. |
| Evidence layer | Terminal output, final messages, diffs, generated files, test logs, screenshots, benchmark outputs. |
The skill should work with two operating styles:
Before dispatching work to a local coding CLI, gather enough context to avoid sending the wrong task to the wrong backend.
Map user language to a backend:
| User wording | Backend |
|---|---|
| Codex, OpenAI Codex | codex |
| Kimi Code, Kimi CLI | kimi or the user's configured Kimi command |
| Claude Code | claude |
| OpenCode | opencode |
| Gemini CLI | gemini or the user's configured Gemini command |
| coding agent, local agent, worker | Ask or infer from project/session context |
If the user names a backend, do not silently substitute another backend.
command -v codex || true
command -v kimi || true
command -v claude || true
command -v opencode || true
command -v gemini || true
If a command is missing, report it and suggest installation/configuration. Do not pretend dispatch succeeded.
Prefer the project root, not the user's home directory.
pwd
git rev-parse --show-toplevel 2>/dev/null || true
git status --short 2>/dev/null || true
For repository tasks, include the absolute working directory in the dispatch prompt and command.
Use the backend's session list, history files, or project metadata. The exact storage paths and commands vary by tool version, so treat the examples below as patterns, not immutable API contracts.
Codex examples:
# If supported by the installed CLI
codex --help
codex exec --help
codex resume --help
# Common local archive patterns; inspect read-only
find ~/.codex -maxdepth 4 -type f \( -name '*.jsonl' -o -name '*.json' -o -name '*.toml' \) 2>/dev/null | head -50
Kimi Code examples:
kimi --help
find ~/.kimi -maxdepth 4 -type f \( -name '*.jsonl' -o -name '*.json' -o -name '*.toml' \) 2>/dev/null | head -50
Claude Code examples:
claude --help
find ~/.claude -maxdepth 4 -type f 2>/dev/null | head -50
OpenCode examples:
opencode --help
find ~/.opencode ~/.config/opencode -maxdepth 4 -type f 2>/dev/null | head -50
Require confirmation before dispatch when any of these are true:
For read-only inspection or tiny status checks, it is usually acceptable to proceed directly and report results.
When multiple sessions exist, choose the session by role and project, not by recency alone.
Recommended matching signals:
Common session roles:
| Role | Use for |
|---|---|
main / lead / controller | Planning, high-level coordination, final integration. |
implementation / worker | Code edits, scripts, feature implementation. |
reviewer | Code review, risk analysis, PR feedback. |
debugger | Reproducing bugs, reading logs, root-cause analysis. |
research | Literature, library, API, or benchmark research. |
data / experiments | Dataset processing, experiment runs, result aggregation. |
docs / writer | README, docs, release notes, design docs. |
If no session fits, ask whether to create a new one or run a one-shot command. Do not silently create a new long-lived session when the user's workflow depends on existing session memory.
Use this template for non-trivial tasks:
You are the <ROLE> coding agent for this project.
Working directory:
<ABSOLUTE_PROJECT_DIR>
Background:
- <Relevant project context>
- <Relevant prior decisions or files>
- <What the user wants and why>
Task:
1. <Concrete step 1>
2. <Concrete step 2>
3. <Concrete step 3>
Constraints:
- Do not make unrelated changes.
- Do not add new abstractions, dependencies, configs, or features unless required for this task.
- Do not silently guess important missing requirements. If blocked, state the ambiguity and propose the smallest safe default.
- Preserve existing style and project conventions.
- If you find unrelated issues, mention them in the final report but do not fix them unless necessary for this task.
Success criteria:
- <Measurable criterion 1>
- <Measurable criterion 2>
- <Expected artifact path or command output>
Verification:
- Run or explain: <test command / lint command / manual check>
- Report exact commands run and whether they passed.
Final report format:
- Summary
- Files changed or artifacts created
- Commands run
- Verification results
- Remaining risks or blockers
For read-only research or review tasks, replace file-edit constraints with scope and evidence requirements:
Do not modify files. Read only the relevant files/logs/docs. Quote file paths, line numbers when possible, commands run, and confidence level for each conclusion.
When confirmation is required, show a concise confirmation block:
I understand the task as: <one-sentence summary>.
Proposed backend: <Codex/Kimi Code/Claude Code/OpenCode/...>
Working directory: <absolute path>
Session: <session name/id or "one-shot new run">
Reason: <why this backend/session fits>
Prompt draft:
---
<prompt>
---
Please confirm before I dispatch this to the local coding CLI.
Do not dispatch until the user confirms. If the user edits the prompt or selects a different backend, update the command accordingly.
CLI flags change over time. Always check <command> --help when a command fails or when using a new version.
Common patterns:
# One-shot non-interactive
codex exec "<PROMPT>"
# One-shot with automatic approval if supported by the installed version
codex exec --ask-for-approval never "<PROMPT>"
# Run from a project directory if supported
codex exec -C <PROJECT_DIR> "<PROMPT>"
# Resume an explicit session if supported
codex exec resume <SESSION_ID> "<PROMPT>"
# JSON output for easier parsing if supported
codex exec --json -o <OUTPUT_JSONL> "<PROMPT>"
Automation notes:
exec modes for Hermes terminal calls.Common patterns:
# One-shot non-interactive
kimi --print -p "<PROMPT>"
# Automatic approval if supported and appropriate
kimi --print --yolo -p "<PROMPT>"
# Resume an explicit session if supported
kimi -S <SESSION_ID> --print -p "<PROMPT>"
# Continue the latest session for the current directory if supported
kimi --continue --print -p "<PROMPT>"
# Specify working directory if supported
kimi -w <PROJECT_DIR> --print -p "<PROMPT>"
Automation notes:
--print or equivalent non-interactive output mode when calling from Hermes.--yolo or AFK-style modes only when the user has approved the risk.Common patterns:
# One-shot print mode
claude -p "<PROMPT>"
# With explicit working directory if supported
claude --cwd <PROJECT_DIR> -p "<PROMPT>"
# Inspect supported session/resume flags
claude --help
Automation notes:
Common patterns:
# Inspect installed CLI first because command syntax varies
opencode --help
# Typical one-shot pattern, if supported by installed version
opencode run "<PROMPT>"
# Project directory pattern, if supported
opencode run --cwd <PROJECT_DIR> "<PROMPT>"
Automation notes:
opencode --help before dispatch.Use the generic adapter pattern:
<AGENT_CMD> --help
<AGENT_CMD> <NON_INTERACTIVE_FLAGS> "<PROMPT>"
Record:
command -v <AGENT_CMD>For long-running interactive CLIs, tmux can provide a visible bridge. This is useful when the user wants to observe the agent, intervene manually, or keep multiple agents alive.
Create or attach a project tmux session:
tmux new-session -d -s <SESSION_NAME> -c <PROJECT_DIR>
tmux send-keys -t <SESSION_NAME> "<AGENT_CMD>" Enter
Send a prompt:
tmux send-keys -t <SESSION_NAME> "<PROMPT>" Enter
Capture output:
tmux capture-pane -t <SESSION_NAME> -p -S -200
Safety notes:
For bounded long-running tasks, run the CLI in the background with completion notification if available in the host environment.
Hermes tool pattern:
terminal(command="cd <PROJECT_DIR> && <AGENT_CMD> <FLAGS> '<PROMPT>'", background=True, notify_on_complete=True)
process(action="poll", session_id="<HERMES_PROCESS_ID>")
process(action="log", session_id="<HERMES_PROCESS_ID>", limit=80)
process(action="wait", session_id="<HERMES_PROCESS_ID>", timeout=180)
Monitoring checklist:
Collect evidence before reporting success.
Minimum evidence:
Useful commands:
# Git evidence
git status --short
git diff --stat
git diff -- <RELEVANT_PATHS>
# Artifact evidence
find <OUTPUT_DIR> -maxdepth 2 -type f -print
file <ARTIFACT_PATH>
# Test evidence
<TEST_COMMAND>
If the coding CLI claims it created a file, verify the file exists. If it claims tests passed, inspect the actual test command output. If the output is truncated, say so.
Use a report like this:
Dispatched to: <backend>
Working directory: <path>
Session/process: <session id / tmux pane / Hermes process id>
Command: <exact command, with secrets redacted>
Result:
- <What completed>
- <Files changed or artifacts created>
- <Verification result>
Evidence:
```text
<short raw output excerpt>
```
Risks / blockers:
- <Anything unresolved, failed, ambiguous, or not verified>
For user-facing summaries, keep the report concise, but do not omit failure state or verification gaps.
Never do these:
delegate_task or execute_code as a fake substitute for Codex/Kimi/Claude/OpenCode.Recommended defaults:
Before publishing or sharing this skill, inspect for private information.
Remove or replace:
/Users/<name>/... or /home/<name>/....Use placeholders instead:
<PROJECT_DIR>
<SESSION_ID>
<AGENT_CMD>
<PROMPT>
<OUTPUT_JSONL>
<TEST_COMMAND>
<ARTIFACT_PATH>
Run a quick privacy scan before release:
grep -RInE "(/Users/|/home/|API_KEY|TOKEN|SECRET|SESSION_ID_HERE|PRIVATE|@)" SKILL.md references templates scripts 2>/dev/null || true
A public skill should teach the workflow, not expose a particular user's workflow map.
Hermes Code Bridge can coexist with workspace tools such as CCB.
Use a dedicated workspace tool when the user wants:
/ask routing.Use Hermes Code Bridge when the user wants:
If CCB is installed, Hermes can treat ccb as another bridge backend: inspect .ccb/ccb.config, start or attach the workspace, send prompts to the appropriate pane/agent, and capture output. Do not rewrite CCB configuration unless the user asked for that.
Confusing Hermes with the worker. Hermes may be capable of doing the task, but if the user requested Codex/Kimi/Claude/OpenCode, run that real tool.
Using the wrong session. Recent is not always correct. Match by project, role, title, and history.
Trusting summaries without evidence. Agent-maintained notes may be stale. Check actual terminal output, git diff, files, or test logs.
Losing output from long jobs. Run bounded long jobs in the background with process tracking or redirect JSON/text output to a file.
Interactive picker in non-TTY. Many CLIs fail when an interactive session picker runs without a terminal. Use explicit session IDs or tmux/PTY.
Over-broad prompts. Large vague prompts cause unnecessary rewrites. Use narrow tasks, constraints, and success criteria.
Unsafe approval bypass. Flags like --yolo, full-auto, or sandbox bypass are convenient but risky. Use only with user approval and appropriate repository state.
Publishing private workflow details. A reusable public skill should not include one user's project map, collaborators, filesystem paths, private endpoints, or real session IDs.
Before reporting completion:
User asks: "Have Codex review this repository for risky changes."
Hermes should:
Example:
cd <PROJECT_DIR>
codex exec "Read-only review: inspect the current git diff and identify correctness, security, and maintainability risks. Do not modify files. Report file paths, line references when possible, severity, and recommended fixes."
Report:
Dispatched to: Codex
Working directory: <PROJECT_DIR>
Command: codex exec "Read-only review: ..."
Result:
- Found <N> issues / no blocking issues.
- No files modified.
Evidence:
<raw output excerpt>
Risks:
- Tests were not run because this was review-only.
User asks: "Ask one agent to implement and another to review."
Hermes should:
Implementation prompt should be scoped and surgical. Review prompt should be read-only unless the user asks for fixes.
Codex worker: implement the smallest change that satisfies <goal>; run <tests>; report files changed.
Claude reviewer: read the resulting diff only; do not modify files; list blockers, non-blockers, and test gaps.
If both agents need to edit concurrently, use git worktrees or isolated branches to avoid file conflicts.