CodexSaver: Reducing Codex Costs via DeepSeek Routing

CodexSaver is an MCP tool that routes low-risk tasks to cheaper models like DeepSeek, reducing costs by up to 100% on specific tasks while keeping Codex for final judgment.

cpaua2 min994
CodexSaver: Reducing Codex Costs via DeepSeek Routing

Fendouai has released CodexSaver, an MCP tool that transforms Codex into a cost-aware router to reduce expenses without sacrificing engineering judgment. It delegates low-risk, high-volume tasks to cheaper workers like DeepSeek V4 Flash, leaving expensive models to handle architecture, security, and final reviews. In v2 benchmarks across five bounded tasks, the tool achieved estimated savings between 45% and 100%.

Routing low-risk tasks to cheaper workers

CodexSaver splits responsibilities between high-level reasoning and repetitive execution. It is most effective for code explanation, repository scanning, docstring maintenance, and bounded test generation. Tasks involving authentication, security, payment permissions, or destructive migrations remain exclusively with Codex.

The tool uses an interaction block to make routing decisions visible to the user. This block indicates whether a task was delegated to a worker, stayed with Codex due to high risk, or was a routing preview. When worker-output compression is active, the block also displays the compression level used for the delegated reply.

Bounded work packets in v2

The v2 version implements a strict delegation lane using bounded work packets. Instead of open-ended requests, Codex provides the worker with a specific goal, allowed files, forbidden paths, and acceptance criteria. Patches are applied only within a temporary sandbox and are accepted only if they pass allowlisted checks.

Users can trigger this via the MCP tool codexsaver.delegate_work_packet or through the CLI:

bash
codexsaver work-packet \
 "Create docs/v2-smoke.md with one sentence." \
 --files README.md \
 --allowed-file docs/v2-smoke.md \
 --acceptance "docs/v2-smoke.md exists in sandbox" \
 --allowed-command "python -c \"from pathlib import Path; assert Path('docs/v2-smoke.md').exists()\"" \
 --workspace .

Orchestrated specialists and Agent Cards in v3

Version 3 introduces a work graph that allows readonly specialists to run in parallel, reducing total latency to the runtime of the slowest specialist plus orchestration overhead. This version includes a readonly_swarm that has been tested with Pi Agent and DeepSeek API capabilities.

Version 3.4 enables action-level delegation, where a single task is split into safe prep nodes for workers and blocked actions for Codex. Version 3.5 adds a verification plan and patch linting to reject empty patches or duplicate file writes, with a node-local repair mechanism for failures.

The latest v3.6 update replaces hardcoded assumptions with a dynamic Agent Card registry. Workers are discovered via .agent-card.json files, and routing is determined by a weighted score based on capability match (0.40), historical success (0.25), and cost weight (0.20).

Sources

fendouai/CodexSavergithub.com/fendouai/CodexSaver
Share

Author

cpaua

VibeCode blog admin. Writing about vibe coding, AI and open source.

Related news

Comments

To leave a comment, log in
Loading...

Weekly digest

The best of vibe coding, AI agents and open source — once a week, no spam.