apx-runtime

Delegates prompts to external coding CLIs like claude-code, codex, and opencode via apx run.

6|1|Updated May 8, 2026
One-click install
npx skills add https://github.com/agentprojectcontext/apx --skill apx-runtime-agentprojectcontext
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: apx-runtime
Source: https://github.com/agentprojectcontext/apx/tree/main/src/core/runtime-skills/apx-runtime
Command: npx skills add https://github.com/agentprojectcontext/apx --skill apx-runtime-agentprojectcontext

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Handing a task to an external AI coding CLI (Claude Code, Codex, OpenCode, Aider) requires knowing each tool's headless flags, session handling, and output capture. This Skill teaches how APX spawns those CLIs correctly, when to wrap the run in an APX agent's system prompt, and how to resume or reply into external sessions. ## Core Features & Use Cases - Pass-through delegation: Run apx run --runtime claude-code "<prompt>" to hand a task to the CLI with no APX system prompt, or add -a <agent> to wrap the run in that agent's persona. - Multi-runtime support: Covers claude-code, codex, opencode, aider, cursor-agent, gemini-cli, qwen-code, and antigravity, with apx env detect to check which are installed. - Session continuity and relay: Resume external sessions, inject replies with apx session resume <id> --continue --msg, and converse over multiple turns via apx send on the a2a channel. - Use Case: Ask the agent to review a diff for memory leaks; it runs apx run --runtime claude-code "Review the diff in src/host/daemon/api/ for memory leaks", captures stdout, and stores the run as a session file under ~/.apx/. ## Quick Start Ask the agent to delegate a code review to Claude Code by running apx run with the claude-code runtime and your prompt.

Frequently Asked Questions about apx-runtime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I delegate a task to Claude Code or Codex from APX?▼

Use apx run with the --runtime flag, for example apx run --runtime claude-code "Review the diff for memory leaks". This spawns the CLI headlessly with the right flags, captures stdout, and stores run metadata as a session file under ~/.apx.

When should I pass an agent with -a to apx run?▼

Pass -a <agent> only when you want that APX agent's system prompt to shape the external run, such as enforcing a house review style. Without it, the run is pass-through and the CLI acts as itself, which is the common case for simple delegation.

What is the difference between apx run and apx send?▼

apx run is a one-shot headless delegation: the CLI starts cold, does the task, and exits. apx send addresses the runtime as an a2a peer for multi-turn conversation, where the peer continues its own session between turns using resume flags.

Which external runtimes does APX support?▼

Supported runtimes include claude-code, codex, opencode, aider, cursor-agent, gemini-cli, qwen-code, and antigravity. Run apx env detect to see which binaries are installed and reachable before choosing one.

How do I reply back into an existing coding session?▼

Use apx session resume <session-id> --continue --msg "<reply>" to inject one message into the session's transcript with full context and capture its reply on stdout. This headless delivery currently works for Claude only; other engines report not supported yet.

Why should large prompts not be passed as command-line arguments?▼

Shell argument limits make prompts over roughly 10KB unreliable on the command line. Pipe the prompt through stdin instead using apx run --runtime codex -, or use a temp file for very large inputs.