Skip to main content

Runtimes

AI Runner provides a single interface across AI coding tools. Pick your runtime once, and the same flags, shebangs, and scripts work identically. AI Runner handles the mapping.

Supported Runtimes

Claude Code is the default when both are installed. If only Codex is installed, it becomes the default automatically.

Selecting a Runtime

In shebangs:

Universal Flags

Most flags work identically with both runtimes. AI Runner maps them to each tool’s native equivalents:

Cross-Interpreter Model Tiers

The same tier flag selects each runtime’s equivalent model: Claude Fable 5 (--fable/--best) is Anthropic-only. Under Codex it falls back to the High tier (gpt-5.4) with a notice.

Cross-Interpreter Effort Levels

Control how deeply the model reasons:

Cross-Interpreter Providers

--azure maps to different services per runtime: Azure Foundry (Anthropic) for Claude Code, Azure OpenAI (GPT) for Codex. The user writes the same flag; AI Runner handles the translation.

Cross-Interpreter Permissions

--skip bypasses ALL safety on both runtimes. Only use with trusted scripts in trusted directories.

Runtime-Specific Features

Claude Code Only

These flags require Claude Code and will error with Codex:
  • --aws — AWS Bedrock
  • --vertex — Google Vertex AI
  • --vercel — Vercel AI Gateway
  • --pro — Claude Pro subscription
  • --team — Agent Teams
  • --chrome — Browser automation

Codex CLI Only

  • --profile <name> — Select a named config profile from ~/.codex/config.toml
Configure profiles in ~/.codex/config.toml:

Authentication

Claude Code

Uses Anthropic authentication:
  • Claude Pro/Max subscription (browser login)
  • API key (ANTHROPIC_API_KEY)
  • Cloud provider credentials (AWS, GCP, Azure)

Codex CLI

Uses OpenAI authentication:
  • Browser login (default): Run codex login once, then Codex uses stored tokens
  • API key: Set OPENAI_API_KEY or CODEX_API_KEY in environment or ~/.ai-runner/secrets.sh
  • Use --apikey to force API key mode (for CI/CD)

Same Script, Both Runtimes

A script written for one runtime works on the other:
The runtime selection is orthogonal to the script content. Model tiers, effort levels, permissions, and streaming all adapt automatically.

Script Portability

Scripts are portable across runtimes. If a script includes interpreter-specific flags, running it on another runtime produces a warning but continues normally:
Running this with Codex:
AI Runner uses a flag firewall that discovers each tool’s supported flags from --help output and caches them by version. Unsupported flags are warned and skipped. Flag+value pairs (like --max-turns 5) are skipped together. This means you can write scripts that use the full power of one runtime and safely run them on another — they degrade gracefully instead of failing.