A production-oriented Python rebuild of Claude Code — real architecture, reliable CLI agent
$git clone https://github.com/agentforce314/clawcodexInstalls into the current project.
Install clawcodex by running `git clone https://github.com/agentforce314/clawcodex`, then use it for the current task and follow its documentation at https://github.com/agentforce314/clawcodex.
| 1 | <div align="center"> |
| 2 | |
| 3 | **English** | [中文](docs/i18n/README_ZH.md) | [Français](docs/i18n/README_FR.md) | [Русский](docs/i18n/README_RU.md) | [हिन्दी](docs/i18n/README_HI.md) | [العربية](docs/i18n/README_AR.md) | [Português](docs/i18n/README_PT.md) |
| 4 | |
| 5 | # ClawCodex |
| 6 | |
| 7 | **A production-oriented Python rebuild of Claude Code — real architecture, reliable CLI agent** |
| 8 | |
| 9 | *Ported from the TypeScript reference implementation and extended with a Python-native runtime* |
| 10 | |
| 11 | *** |
| 12 | |
| 13 | [](https://github.com/agentforce314/clawcodex/stargazers) |
| 14 | [](https://github.com/agentforce314/clawcodex/network/members) |
| 15 | [](https://opensource.org/licenses/MIT) |
| 16 | [](https://www.python.org/downloads/) |
| 17 | |
| 18 | |
| 19 | **🔥 Active Development • New Features Weekly 🔥** |
| 20 | |
| 21 |  |
| 22 | |
| 23 | </div> |
| 24 | |
| 25 | *** |
| 26 | |
| 27 | <div align="center"> |
| 28 | |
| 29 | # 🌿✂️ /eco Token Compression |
| 30 | |
| 31 | # Same session, **80% fewer** Bash-output tokens |
| 32 | |
| 33 | ### Measured, not estimated: 27 real command outputs replayed through the production pipeline — **92,989 → 17,767 tokens (-80%)**. Failure summaries keep the error lines that matter; anything lossy is teed to disk, one `tail` away. |
| 34 | |
| 35 | One toggle, deterministic filters — failure-focused test summaries, `git`/`pip`/`npm` ceremony |
| 36 | stripping, log dedup, recoverable head-caps — guarded to be **never worse** than the raw rendering. |
| 37 | Stacks with the [DeepSeek prefix cache](#-deepseek-prefix-cache): the cache makes your stable |
| 38 | prefix nearly free, `/eco` shrinks the fresh suffix every turn actually pays for. |
| 39 | **[See the measured benchmark ↓](#eco-benchmark)** |
| 40 | |
| 41 | </div> |
| 42 | |
| 43 | *** |
| 44 | |
| 45 | <div align="center"> |
| 46 | |
| 47 | # 🐋🔥 DeepSeek Prefix Cache |
| 48 | |
| 49 | # Run long agentic coding sessions for *pennies* |
| 50 | |
| 51 | ### Cache-hit input bills at **`~$0.0435` / 1M tokens** — about **230× cheaper** than Claude Fable 5 (`$10` / 1M). |
| 52 | |
| 53 | ClawCodex keeps your request prefix **byte-stable**, so DeepSeek's prompt cache covers your whole |
| 54 | `system + tools + history` span across turns. **The longer you code, the more you save.** |
| 55 | |
| 56 | </div> |
| 57 | |
| 58 | *** |
| 59 | |
| 60 | ## ⚡ Quick Install |
| 61 | |
| 62 | **One line** — installs `uv`, Python 3.10+, and puts `clawcodex` on your PATH: |
| 63 | |
| 64 | ```bash |
| 65 | curl -fsSL https://clawcodex.app/install.sh | bash |
| 66 | ``` |
| 67 | |
| 68 | Then configure a provider and start coding: |
| 69 | |
| 70 | ```bash |
| 71 | clawcodex login # interactive provider + API key setup → ~/.clawcodex/config.json |
| 72 | clawcodex --dangerously-skip-permissions # start the REPL in any project |
| 73 | ``` |
| 74 | |
| 75 | The installer also ships `clawcodex` lifecycle helpers — `doctor` (diagnose your |
| 76 | environment), `verify` (health-check the install), `update`, and `uninstall`. It is |
| 77 | re-run-safe and works on macOS, Linux, and WSL. To pass flags through the pipe, use |
| 78 | `curl -fsSL https://clawcodex.app/install.sh | bash -s -- --dry-run`. |
| 79 | |
| 80 | <details> |
| 81 | <summary><b>Or install manually from source</b></summary> |
| 82 | |
| 83 | ```bash |
| 84 | git clone https://github.com/agentforce314/clawcodex.git |
| 85 | cd clawcodex |
| 86 | python3 -m venv .venv && source .venv/bin/activate # Python 3.10+ |
| 87 | pip install -r requirements.txt |
| 88 | |
| 89 | python -m src.cli login # writes config to ~/.clawcodex/config.json |
| 90 | |
| 91 | python -m src.cli --dangerously-skip-permissions # start the REPL |
| 92 | ``` |
| 93 | |
| 94 | </details> |
| 95 | |
| 96 | The configuration file is saved at `~/.clawcodex/config.json`. Minimal example: |
| 97 | |
| 98 | ```json |
| 99 | { |
| 100 | "default_provider": "deepseek", |
| 101 | "providers": { |
| 102 | "deepseek": { |
| 103 | "api_key": "xxx-xxx", |
| 104 | "base_url": "https://api.deepseek.com", |
| 105 | "default_model": "deepseek-v4-pro" |
| 106 | } |
| 107 | }, |
| 108 | "env": { |
| 109 | "TAVILY_API_KEY": "tvly-YOUR-TAVILY-API-KEY" |
| 110 | } |
| 111 | } |
| 112 | ``` |
| 113 | |
| 114 | > **Note:** `TAVILY_API_KEY` is required for the WebSearch tool — get a key at [tavily.com](https://tavily.com) |