🤖 Reasonix 4.1k⭐ — DeepSeek-native 编码代理,99.82% 缓存命中率,435M token 只花 $12
Reasonix 是一个为 DeepSeek 深度优化的终端编码代理。 它的核心思路很直接:既然 DeepSeek 的 prefix-cache 机制能大幅降低 token 成本,那就让它成为整个系统设计的基石——而不是事后才想到的优化。
为什么值得关注
一般的 AI 编码代理在长时间会话中,缓存命中率会逐渐下降,因为提示词的微小变化就会破坏缓存对齐。Reasonix 用四层机制来保证这一切:
- Structured system prompt — 结构固定的系统提示词,每次会话都保持一致
- Deterministic tool call ordering — 工具调用的顺序确定性,不会因为并行执行打乱缓存
- Byte-stable tokenizer alignment — 确保 tokenizer 的字节对齐不变
- Prefix-optimized context management — 只在必要的时候追加内容,避免破坏前缀
实际效果?来看一组数据:一个真实用户单日跑了 435M 输入 token,99.82% 的缓存命中率,总花费约 $12——同样负载如果没缓存,按 v4-flash 价格算大概要 $61。
快速上手
安装很简单,需要 Node ≥ 22:
npm install -g reasonix
然后直接进入项目目录启动:
cd my-project
reasonix code
# 首次运行会提示输入 DeepSeek API key,之后会自动保存
如果你想先试用一下,也可以用 npx:
cd my-project
npx reasonix code
基本命令
| 命令 | 说明 |
|---|---|
reasonix / reasonix code [dir] |
编码代理模式,从这里开始 |
reasonix chat |
纯聊天模式,没有文件系统和 Shell 工具 |
reasonix run "task" |
一次性运行任务,输出到 stdout |
reasonix doctor |
健康检查:Node、API key、MCP 配置 |
reasonix update |
升级 Reasonix |
reasonix index |
索引项目代码(搭配本地 Ollama 或其他 embedding 端点) |
与其他工具对比
| 特性 | Reasonix | Claude Code | Cursor |
|---|---|---|---|
| 后端 | DeepSeek | Anthropic | OpenAI / Anthropic |
| 许可证 | MIT | 闭源 | 闭源 |
| 成本 | 单任务极低 | 高端定价 | 订阅 + 按量 |
| DeepSeek 缓存优化 | 深度工程优化 | 不适用 | 不适用 |
| Web 仪表盘 | ✅ | ❌ | N/A |
| /search-engine | ✅ | ❌ | ❌ |
| Plan mode + MCP + Skills | ✅ | ✅ | ✅ |
配置
配置文件在 ~/.reasonix/config.json,每个项目也可以在 <project>/.reasonix/ 下覆盖配置。支持 MCP 服务器、Skills(Markdown 编写)、Memory(持久化知识)、Hooks(生命周期事件)、权限管理等等。
适用场景
Reasonix 适合谁?如果你用 DeepSeek 写代码,而且希望长时间运行会话时 token 成本可控——它就是最优选。但如果你需要处理多供应商切换、IDE 集成、或者需要离线运行,那可能更适合 Aider + Ollama 或 Continue。
资源
🤖 Reasonix 4.1k⭐ — A DeepSeek-native coding agent with 99.82% cache hit rate, $12 for 435M tokens
Reasonix is a terminal-first coding agent purpose-built for DeepSeek. Instead of treating prefix-cache as an afterthought, the entire agent loop is engineered around cache stability — and the numbers speak for themselves.
Why it matters
Most AI coding agents see cache hit rates degrade over long sessions because small prompt variations break cache alignment. Reasonix tackles this with four mechanisms:
- Structured system prompt — consistent prompt structure across sessions
- Deterministic tool call ordering — no parallel execution disrupting the sequence
- Byte-stable tokenizer alignment — keeps token boundaries identical
- Prefix-optimized context management — appends content only when necessary
Real-world result: One user logged 435M input tokens in a single day with a 99.82% cache hit rate, costing roughly $12 — vs. an estimated $61 without caching at v4-flash pricing.
Quick start
Node ≥ 22 required.
npm install -g reasonix
reasonix code my-project
# Paste your DeepSeek API key on first run — it persists
Or try without installing:
cd my-project
npx reasonix code
Commands at a glance
| Command | Use |
|---|---|
reasonix / reasonix code [dir] |
The coding agent. Start here. |
reasonix chat |
Plain chat — no filesystem/shell tools |
reasonix run "task" |
One-shot task, streams to stdout |
reasonix doctor |
Health check |
reasonix update |
Upgrade Reasonix |
reasonix index |
Semantic index with Ollama or any OpenAI-compatible endpoint |
Comparison
| Feature | Reasonix | Claude Code | Cursor |
|---|---|---|---|
| Backend | DeepSeek | Anthropic | OpenAI / Anthropic |
| License | MIT | closed | closed |
| Cost profile | low per task | premium | subscription + usage |
| DeepSeek prefix-cache | engineered for | N/A | N/A |
| Web dashboard | ✅ | — | N/A |
| Configurable search | /search-engine |
— | — |
| Plan + MCP + Skills | ✅ | ✅ | ✅ |
Configuration
Config lives at ~/.reasonix/config.json with per-project overrides under <project>/.reasonix/. Supports MCP servers, skills (Markdown), memory (persistent knowledge), hooks (lifecycle events), permissions, and web search engine selection.
Who it's for
If you code with DeepSeek and want long-running agent sessions without burning tokens, Reasonix is your tool. If you need multi-provider flexibility, IDE integration, or fully offline operation, consider Aider + Ollama or Continue.