{
  "$schema": "https://bringyour.ai/schemas/claude-code-limit-fallback.v1.json",
  "id": "bringyour-claude-code-limit-fallback",
  "title": "Claude Code limit fallback runbook for Codex",
  "url": "https://bringyour.ai/claude-code-limit-fallback",
  "html_url": "https://bringyour.ai/claude-code-limit-fallback",
  "json_url": "https://bringyour.ai/claude-code-limit-fallback.json",
  "product": "Bring Your AI",
  "updated_at": "2026-05-08",
  "remote_invariant": {
    "harness_data_remote": false,
    "notes": "This runbook is descriptive only. Bring Your AI remote MCP and JSON routes do not accept harness files, generated memories, user rules, API keys, GitHub handles, repo paths, or file contents."
  },
  "fallback_trigger": {
    "use_when": [
      "Claude Code is rate-limited or unavailable mid-task",
      "A developer wants Codex to continue without rebuilding the harness by hand",
      "A repo has CLAUDE.md, AGENTS.md, skills, hooks, MCP servers, or validation notes that need a target-side audit"
    ],
    "do_not_claim": [
      "It does not raise Claude Code limits.",
      "It does not make Claude Code and Codex behavior identical.",
      "It does not upload or host the user's harness."
    ]
  },
  "recommended_sequence": [
    {
      "order": 1,
      "name": "Freeze the current task state locally",
      "outcome": "Capture changed files, failing command, next step, and any half-written assumptions in a repo-local handoff before switching tools."
    },
    {
      "order": 2,
      "name": "Run the first-party Codex import path if available",
      "outcome": "Let Codex create the first imported setup and import checklist before using Bring Your AI for the target-side audit."
    },
    {
      "order": 3,
      "name": "Preview the local Claude Code to Codex move",
      "command": "bringyour preview --from claude-code --to codex",
      "outcome": "Confirm support without changing source files or exposing mappings, file lists, generated content, or validation notes."
    },
    {
      "order": 4,
      "name": "Apply the paid merge only after the preview is acceptable",
      "command": "bringyour migrate --from claude-code --to codex --policy merge",
      "outcome": "Create rollback snapshots, merge portable harness pieces, and write validation notes for non-equivalent behavior."
    },
    {
      "order": 5,
      "name": "Run a local environment check",
      "command": "bringyour doctor",
      "outcome": "Confirm local tool state without sending harness data to Bring Your AI."
    }
  ],
  "agent_checks": [
    {
      "id": "handoff_state",
      "question": "Is there a repo-local handoff with changed files, failing commands, and the next executable step?",
      "why": "A harness migration cannot recover missing task state if the old session stopped mid-edit."
    },
    {
      "id": "instruction_scope",
      "question": "Which guidance belongs in active Codex instructions, and which old session artifacts should remain review-only?",
      "why": "Transcripts and old handoffs can contain stale goals that should not become always-on instructions."
    },
    {
      "id": "hook_equivalence",
      "question": "Which Claude Code hooks or per-agent restrictions cannot be enforced by Codex?",
      "why": "Non-equivalent behavior should become explicit validation notes rather than copied config."
    },
    {
      "id": "mcp_secret_refs",
      "question": "Do MCP configs preserve secret references instead of literal secret values?",
      "why": "Fallback work often happens under time pressure; the migration path must not turn env or keychain references into pasted secrets."
    },
    {
      "id": "rollback",
      "question": "Where is the rollback snapshot, and has it been kept outside the active instruction path?",
      "why": "The target Codex setup should be recoverable if the merge writes a bad instruction or config file."
    }
  ],
  "agent_readable_surfaces": {
    "codex_import_checklist": "https://bringyour.ai/codex-import-checklist.json",
    "openapi": "https://bringyour.ai/openapi.yaml",
    "agent_manifest": "https://bringyour.ai/.well-known/agent.json",
    "commerce_manifest": "https://bringyour.ai/.well-known/commerce.json",
    "catalog": "https://bringyour.ai/api/v1/catalog",
    "license_fulfillment": "https://bringyour.ai/api/v1/license"
  }
}
