Reasonix - An open-source terminal programming agent specifically designed for DeepSeek
Reasonix is an open-source terminal programming agent specifically designed for DeepSeek. It utilizes an append-only runtime loop built around a byte-stable prefix-cache mechanism, achieving a cache hit rate of 99.82% and significantly reducing input costs for long sessions...
What is Reasonix?
Reasonix is an open-source terminal programming agent specifically designed for DeepSeek. It features an append-only runtime loop built around a byte-stable prefix-cache mechanism, achieving a cache hit rate of 99.82% and reducing the input cost of long sessions to approximately 20% of its original cost. Reasonix directly interfaces with the DeepSeek API, helping developers run programming tasks for extended periods at extremely low cost through three pillars: fixed prefixes, append-only logging, tool call repair, and intelligent cost switching.
Reasonix's main functions
-
Terminal Programming AgentIt directly connects to api.deepseek.com, supporting code editing, file system operations, Shell tool calls, and SEARCH/REPLACE review.
-
Cache-first session loopIt adopts an append-only operating mode, where the old context remains unchanged and new messages are only appended to the end, maximizing the reuse rate of the prefix-cache.
-
Tool call repair: 4 rounds of internal processing to automatically correct common DeepSeek tool call problems such as malformed JSON, incorrect parameters, repeated call storms, and JSON truncation.
-
Intelligent cost control: The default is to use v4-flash, and difficult tasks can be performed automatically or manually.
/pro(Instruction) Switch to v4-pro, automatically compress the context at the end of the round. -
Skills and Memory SystemSupports Skill writing in Markdown format (
inlineorsubagentPattern), and prefix memory injection of user private knowledge. -
QQ Remote ChannelIt can extend the current session into a QQ remote interaction channel, supporting remote access to the Agent session from mobile devices.
-
Desktop supportA native GUI client based on Tauri (pre-release version), featuring multiple tabs and real-time display of file read/write, cost, and caching metrics.
Reasonix's technical principles
-
Cache-First LoopThe context is divided into three areas: Immutable Prefix (system prompts + tool specifications + examples, fixed for the session), Append-Only Log (monotonically appended historical messages, retaining the prefix of previous rounds), and Volatile Scratch (temporary draft for this round, not directly uploaded after reset). DeepSeek's automatic prefix caching is activated by ensuring that the precise byte prefix of each request matches that of previous requests.
-
Tool-Call RepairTo address issues that DeepSeek is prone to encountering during tool calls, such as JSON being generated internally but disappearing in the final message, malformed parameters, duplicate calls, and JSON truncation, four rounds of repair processing are performed before the tool is actually executed to ensure stable and reliable tool calls.
-
Cost ControlThree-tier cost reduction strategy: Prioritizes the use of low-cost v4-flash by default; users can...
/proTemporary upgrades are performed to v4-pro in one round, and then automatically revert after completion; failure signals trigger automatic upgrades, and when the number of failures reaches the warning threshold, the remaining parts are automatically switched to v4-pro.
How to use Reasonix
- Environmental preparationEnsure you have Node.js version ≥ 22 installed and obtain the DeepSeek API Key.
- Installation and startupGlobal installation:
npm install -g reasonixAfter entering the project directory, executereasonix codeOr run directly without installation:cd my-project && npx reasonix code. - Configuration keyThe DeepSeek API Key will be automatically and persistently saved when you paste it on the first run, so you don't need to enter it again later.
- Start a session: Default entry
codeThe mode (including file system and shell tools) allows you to start programming tasks by entering natural language commands; a pure dialogue mode can be switched to this mode.reasonix chat. - Advanced Operations:use
/proTemporarily switch to v4-pro to handle difficult tasks; via/skill newCreate custom skills; runreasonix doctorCheck the health status of the environment.
Reasonix's core advantages
-
Ultimate cost savingsIn actual testing, with 435 million input tokens per day and a cache hit rate of 99.82%, the bill dropped from approximately $61 (without cache) to approximately $12 (v4-flash). Combined with the permanent price reduction of DeepSeek V4, the cost is extremely low.
-
DeepSeek native optimizationEach layer of abstraction is optimized based on DeepSeek's byte-stable prefix-cache mechanism, which is incomparable to general-purpose frameworks.
-
Long session stabilityDesigned for long-term operation, it can "run continuously" without cost spikes due to context bloat.
-
Terminal priorityNo IDE integration required, dependencies
git diffandlsManaging changes is suitable for developers accustomed to command-line workflows.
Reasonix's project address
- GitHub repositoryhttps://github.com/esengine/DeepSeek-Reasonix
Comparison of Reasonix's similar products
| Comparison Dimensions | Reasonix | Claude Code |
|---|---|---|
| position | DeepSeek Native Terminal Programming Agent | Anthropic Universal Terminal Programming Agent |
| Backend Model | Exclusive to DeepSeek (V4 series) | Claude series (Sonnet/Opus, etc.) |
| Open source license | MIT Open Source | Closed source |
| Cost strategy | Cache priority, 99.82% hit rate, approximately 20% cost reduction. | Pay-as-you-go billing, no cache optimization mechanism. |
| caching mechanism | Native engineered byte-level prefix-cache | Not applicable (Anthropic does not have this mechanism) |
| Operating environment | Terminal-first approach + Tauri desktop client (pre-release) | Terminal Exclusive |
| Long session cost | Extremely low operating temperature; can run continuously for extended periods. | It grows linearly with context, and is relatively high. |
| Tool call repair | 4 rounds of automatic repair of malformed JSON/truncated/repeated calls | Basic tool calls, no specific fixes. |
| Model switching | Automatic/manual switching flash ↔ pro | Manually select model version |
| Skill System | Markdown Skill + Claude format compatibility | Built-in skills, external import is not supported. |
| MCP support | support | support |
| Memory system | User/Project/Feedback Multi-Type Memory Prefix Injection | Basic context memory |
| Remote Channel | Supports remote access via QQ channel | Not supported |
Reasonix Application Scenarios
-
Long-duration programming tasks: This requires the Agent to run continuously for hours or even days for code refactoring, batch modifications, and large-scale project maintenance.
-
High-frequency API call scenarios: Automated scripts and CI/CD pipelines require extensive programming assistance that interacts with DeepSeek.
-
Cost-sensitive developmentIndividual developers and startup teams hope to further reduce token costs on top of the already low price of DeepSeek V4.
-
Remote collaborationThis allows mobile devices to remotely issue commands to a running Agent and receive results via QQ.