🤖 Complete guide to setting up and troubleshooting Hermes Agent with native Codex CLI integration.
Based on real-world enterprise development and common integration issues.
use codex to fix these TypeScript errors
use codex to implement authentication
When Codex runtime is active, all normal Hermes tools automatically use Codex:
patch→ becomes Codexapply_patchterminal→ becomes Codexshellwrite_file→ handled by Codex sandbox
No special syntax needed! Just request tasks normally.
"I need to run Codex CLI in parallel with Hermes"
"Like swapping out an engine while keeping the car"
When Codex runtime is active:
- Hermes keeps: Session management, memory, skills, messaging gateway
- Codex takes over: Terminal commands, file editing, sandbox operations
- Same driver interface, different execution engine
# 1. Install Codex CLI
npm i -g @openai/codex
# 2. Verify installation
codex --version # Should be 0.33.0+
# 3. Separate authentication required
codex login # This is separate from hermes auth
# 4. Install plugins BEFORE enabling runtime
codex plugin install linear github gmail# Enable Codex runtime
/codex-runtime codex_app_server
# IMPORTANT: Restart your Hermes session
# Runtime takes effect on NEXT session, not current# Check runtime status
/codex-runtime
# Test tools (should work transparently)
"Fix the TypeScript errors in this project"
# Behind the scenes: uses Codex apply_patch instead of Hermes patchProblem: Used /codex-runtime codex_app_server but no change
Solution: Session restart required
/codex-runtime codex_app_server
# Exit and restart Hermes completely
# Runtime persists but needs new session to activateProblem: Codex CLI not authenticated
Solution: Separate login required
codex login # Different from hermes authProblem: Installed plugins after enabling runtime
Solution: Plugin installation order matters
# Install plugins FIRST
codex plugin install linear github
# THEN enable runtime
/codex-runtime codex_app_serverProblem: Expecting all Hermes tools to work
Solution: 4 Hermes tools are NOT available
delegate_task- No sub-agents (needs agent loop)memory- No persistent memory storesession_search- No conversation searchtodo- Use Codexupdate_planinstead
| Standard Hermes | Codex Runtime | Notes |
|---|---|---|
patch |
apply_patch |
Structured multi-file edits |
terminal |
shell |
Sandboxed execution |
write_file |
Sandbox operations | Controlled file access |
todo |
update_plan |
Codex internal tracker |
- File reading - Same interface
- Web operations - Via MCP callbacks
- AI generation - Via MCP callbacks
- Skills system - Via MCP callbacks
- Heavy development work (multi-file refactoring)
- Cost-sensitive projects (ChatGPT subscription vs API)
- Plugin workflows (Linear, GitHub, Gmail integration)
- Structured operations (benefit from apply_patch)
- Planning & architecture (needs memory/session_search)
- Multi-agent coordination (needs delegate_task)
- Cross-session analysis (conversation history required)
- Quick configuration (overhead not worth switch)
/codex-runtime codex_app_server # Enable Codex
/codex-runtime auto # Back to standard
# Both require session restartProject: 40+ API routes to enterprise security patterns
Stack: TypeScript, Next.js, Supabase
With Codex Integration:
- Structured operations: Multi-file permission updates as single operations
- Cost efficiency: Entire migration on ChatGPT subscription
- Sandbox safety: TypeScript validation in controlled environment
- Pattern consistency: apply_patch maintains formatting across files
Key insight: Development felt more structured and efficient, even though the interface was identical.
- Codex CLI installed and updated
- Both Hermes and Codex authenticated
- Plugins installed before runtime switch
- Session restarted after runtime command
- Using normal requests (not "use codex to...")
# Check Codex installation
codex --version
# Check authentication
codex auth status
# Check runtime status
/codex-runtime
# Test plugin detection
codex plugin listRuntime is active when:
- File operations feel snappier (native sandbox)
- Multi-file edits are more structured
- No API token charges for development work
- Terminal commands run in controlled environment
- Setup Guide - Complete installation process
- Tools Comparison - Detailed runtime differences
- Case Studies - Real-world implementations
hermes codex runtime not working, use codex to command not found, codex-runtime takes effect next session, hermes codex native integration setup, codex app server runtime troubleshooting
This guide prevents the #1 confusion: expecting special syntax when the integration is actually transparent.