Codex Local

Wrapper around the Codex CLI bound to a cheap backend (DeepSeek V4 Flash via OpenRouter) for code-specific tasks with diff-based UX.

cleanexpo Updated

File contents

Codex Local — Cheap Code Lens

When to invoke

  • Multi-file refactor where a diff-first UX is faster than read-edit-write loops
  • Code generation where DeepSeek V4 Flash (81% SWE-bench) is cheaper than Sonnet

Backend

OPENAI_BASE_URL=https://openrouter.ai/api/v1 \
OPENAI_API_KEY=$OPENROUTER_API_KEY \
OPENAI_MODEL=${CODEX_DEFAULT_MODEL:-deepseek/deepseek-v4-flash} \
codex <command>

Output contract

Codex returns a unified diff. The skill MUST:

  1. Show the diff to the CEO (no auto-apply on >10-line changes)
  2. Note the backend and model used
  3. Note approximate token cost

Trade-off table

Backend Cost Code quality Privacy Speed
OpenRouter → DeepSeek V4 Flash $0.28/M Strong (81% SWE-bench) Cloud Fast

Pre-merge gate

Codex output must pass: npm run type-check && npm run lint && npm test before merge. This is non-negotiable per .claude/rules/verification-gate.md.

cleanexpo/synthex/tree/main/.claude/skills/codex-local commit 5da5947d0c

Frequently asked questions

npx get-skill add cleanexpo/codex-local