---
name: Run Real Codex Test
slug: run-real-codex-test
category: Quality
description: Run Real Codex Test runs Codex with a prompt and captures events for development-time debugging and verification. Use it to inspect event order, token usage, rate limits, and response behavior.
github: "https://github.com/blitzdotdev/BlitzOS/tree/main/vendor/lody-adapters/codex/.claude/skills/run-codex"
language: TypeScript
stars: 179
forks: 21
install: "npx degit https://github.com/blitzdotdev/BlitzOS/tree/main/vendor/lody-adapters/codex/.claude/skills/run-codex ~/.claude/skills/run-codex"
installs_to: ~/.claude/skills/run-codex
source_path: vendor/lody-adapters/codex/.claude/skills/run-codex/SKILL.md
collection_size: 4
category_size: 1817
collection_url: "https://dirskills.com/collections/blitzdotdev/blitzos"
added: 2026-09-07T05:20:45.566Z
last_synced: 2026-09-07T05:20:45.566Z
canonical_url: "https://dirskills.com/skills/run-real-codex-test"
---

# Run Real Codex Test

Run Real Codex Test runs Codex with a prompt and captures events for development-time debugging and verification. Use it to inspect event order, token usage, rate limits, and response behavior.

**Install:**

```bash
npx degit https://github.com/blitzdotdev/BlitzOS/tree/main/vendor/lody-adapters/codex/.claude/skills/run-codex ~/.claude/skills/run-codex
```

## README

# Run Real Codex Test

This skill runs real Codex with a prompt and captures all events for analysis during development.

## When to Use

- Testing new event handlers
- Debugging event processing issues
- Understanding Codex response format and event order
- Validating implementation changes against real Codex behavior
- Seeing actual token usage, rate limits, and other metadata

## How to Run

Execute the test script using npm:

```bash
npm run codex-test -- -p "Your prompt here"
```

### Options

| Option | Short | Description | Default |
|--------|-------|-------------|---------|
| `--prompt` | `-p` | Prompt to send to Codex (required) | - |
| `--cwd` | `-c` | Working directory for the session | Current dir |
| `--output` | `-o` | Output format: `all`, `codex`, `acp`, `summary` | `all` |
| `--json` | - | Output events as JSON | false |
| `--help` | `-h` | Show help message | - |

### Examples

```bash
# See all events for a simple prompt
npm run codex-test -- -p "What files are in this directory?"

# Test with specific working directory
npm run codex-test -- -p "Read the README" -c /path/to/project

# See only Codex events (raw server notifications)
npm run codex-test -- -p "Hello" -o codex

# See only summary (token usage, timing, event counts)
npm run codex-test -- -p "Hello" -o summary

# Get JSON output for analysis with jq
npm run codex-test -- -p "Hello" --json | jq '.method'
```

## Output

The script outputs events in real-time as they arrive:

1. **Codex Events** (`[CODEX]`): Raw events from Codex app server
   - `thread/started`, `turn/started`, `turn/completed`
   - `item/started`, `item/completed`, `item/agentMessage/delta`
   - `thread/tokenUsage/updated`, `account/rateLimits/updated`

2. **ACP Events** (`[ACP]`): Events sent to ACP connection
   - `sessionUpdate` with various update types

3. **Summary**: Aggregated statistics
   - Stop reason, duration, event counts
   - Token usage breakdown (input, cached, output, reasoning, total)
   - Event type frequency

4. **PromptResponse**: Full response object including `_meta.quota.token_count`
