agentforce314/clawcodex
Token efficient Claude Code full Python rebuild. AI Coding Agent in 270K LoC pure Python. Up to 200X Cost Saving!
What it solves
ClawCodex is a production-ready CLI agent designed for agentic coding. It solves the limitation of being locked into a single model provider by supporting a wide array of LLMs, while reducing the high token costs and noise associated with long coding sessions through advanced compression and caching techniques.
How it works
It is a Python-native rebuild of the Claude Code architecture. The agent operates in a tool-calling loop with a streaming REPL, allowing it to execute commands, fetch context, and manage session history. Key technical optimizations include:
- Token Compression (
/ecomode): Uses deterministic filters to strip "ceremony" from Bash outputs (likenpmorgitprogress) and focuses on failure summaries in test logs, reducing model-bound tokens by up to 80%. - Prefix Caching: Maintains byte-stable request prefixes to exploit DeepSeek's prompt cache, significantly lowering costs for long sessions.
- Multi-Provider Support: Integrates 25+ providers, including OpenAI, Claude, DeepSeek, and local options like Ollama and vLLM.
- Goal-Directed Autonomy: Implements a
/goaland/subgoalloop where an LLM judge verifies if the objective has been met before finishing.
Who it’s for
Developers who want a powerful, autonomous terminal-based coding agent that is flexible regarding model choice and optimized for cost and token efficiency.
Highlights
- Broad Model Compatibility: Supports OpenAI, Claude, DeepSeek, Meta, and many OpenAI-compatible backends.
- Subscription Auth: Allows using existing ChatGPT and Claude Pro/Max subscriptions instead of metered API billing.
- High Performance: Outperforms
openclaudeon the SWE-bench Verified leaderboard using Gemini 2.5 Pro. - Advanced Tooling: Includes a session-scoped scheduler (
/loop), MCP (Model Context Protocol) support, and a hardened permission system for tool execution. - One-Click Install: Simple installation via a shell script for macOS, Linux, and WSL.