🤖 AI Tools
· 10 min read

Reasonix Complete Guide: The DeepSeek-Native Coding Agent That Cuts Costs 5x (2026)


Reasonix is a terminal-based AI coding agent built specifically for DeepSeek models. It is open source (MIT license), written in TypeScript, and has 9K GitHub stars. The key differentiator: it is engineered around DeepSeek’s prefix cache stability, achieving 99.82% cache hit rates that cut costs by 5x compared to generic tools using the same API.

The headline stat: 435 million input tokens processed with 99.82% cache hits, costing approximately $12 instead of the $61 it would have cost without cache optimization. That is not a benchmark. That is real usage data.

If you are already using DeepSeek V4 for coding (and after the permanent 75% discount, you should be), Reasonix is the tool that extracts maximum value from that API spend. This guide covers everything: what it is, how it works, how to set it up, and how it compares to alternatives.

What is Reasonix?

Reasonix is a coding agent that runs in your terminal. You point it at a codebase, describe what you want, and it reads files, writes code, runs commands, and iterates until the task is done. Think Claude Code or Aider, but purpose-built for DeepSeek’s API characteristics.

Key facts:

  • License: MIT (fully open source)
  • Language: TypeScript
  • GitHub stars: 9K+
  • Default model: DeepSeek V4 Flash
  • Upgrade model: DeepSeek V4 Pro (per-turn or full session)
  • Platforms: macOS, Linux, Windows
  • Node requirement: >= 22
  • Alias: dsnix
  • Listed on: DeepSeek’s official docs as an integration

Reasonix is listed on DeepSeek’s official documentation as a recommended integration, which gives it a level of first-party endorsement that other third-party tools lack.

Why DeepSeek-native matters

Every LLM API provider offers prefix caching, but DeepSeek’s implementation is particularly aggressive. If the beginning of your prompt matches a cached prefix exactly, you pay roughly 1/12th the normal input token rate. The key word is “exactly.” Any change to the prefix invalidates the cache.

Generic tools like Claude Code or Aider are model-agnostic. They structure prompts for correctness, not cache stability. Every time they reorder context, inject a new file, or restructure the system prompt, the cache breaks.

Reasonix does the opposite. Its entire prompt architecture is designed around three pillars of cache stability:

  1. Fixed prefix ordering. System prompt, project context, and memory are always in the same position and order. New information is appended, never inserted.

  2. Incremental context growth. When you add files to context, they go at the end of the existing context block. Nothing before them shifts.

  3. Stable tool call formatting. Tool results are formatted identically every time, preventing format variations from breaking the prefix match.

The result: 99.82% of input tokens hit the cache. On a 30-minute coding session with 500K input tokens, you pay for ~1K tokens at full price and 499K at the cache rate. That is the 5x cost reduction.

For the full technical deep-dive on how this works, see our Reasonix prefix cache explained article.

Installation

Requirements: Node.js >= 22, a DeepSeek API key.

# Global install
npm install -g reasonix

# Or run without installing
npx reasonix code

Set your API key:

export DEEPSEEK_API_KEY=your-key-here

Or add it to ~/.reasonix/config.json:

{
  "apiKey": "your-key-here"
}

Get your API key from the DeepSeek platform. With the permanent pricing, V4 Flash costs $0.07/1M input and V4 Pro costs $0.435/1M input.

Verify the install:

reasonix doctor

This checks your Node version, API key validity, network connectivity, and config file syntax.

First session

Navigate to your project directory and start:

cd your-project
reasonix code

Reasonix indexes your project, loads any existing memory files, and drops you into an interactive prompt. Type what you want:

> Add input validation to the signup form. Email must be valid, password minimum 8 chars.

Reasonix will:

  1. Read relevant files (finds the signup form automatically)
  2. Propose changes in plan mode (if enabled)
  3. Write the code
  4. Optionally run tests if configured

The session persists. Follow up with refinements:

> Also add a confirm password field that must match

Context accumulates. The prefix cache keeps costs flat even as the conversation grows.

Modes and commands

Reasonix has three primary modes:

code (default)

reasonix code

Full filesystem access. Reads and writes files, runs commands, creates checkpoints. This is what you use for actual development work.

chat

reasonix chat

No filesystem access. Pure conversation mode. Use this for architecture discussions, code review of pasted snippets, or brainstorming without risk of file modifications.

run (one-shot)

reasonix run "refactor the auth module to use JWT"

Executes a single task and exits. Accepts piped input:

cat error.log | reasonix run "explain this error and suggest a fix"

Great for CI/CD integration, scripting, and automation pipelines.

Switching models

By default, Reasonix uses V4 Flash ($0.07/1M input, $0.28/1M output). For complex tasks, you can upgrade:

Per-turn upgrade:

> /pro
> Now refactor the database layer to support multi-tenancy

The /pro command switches to V4 Pro for that single turn, then reverts to Flash.

Full session upgrade:

> /preset max

Switches the entire session to V4 Pro. Use this for complex multi-file refactors where you want maximum reasoning quality throughout.

The cost difference is meaningful. A typical Flash session costs $0.03-0.08. A Pro session costs $0.14-0.35. Use Flash for routine tasks, Pro for architecture-level changes. See our V4 Pro vs Flash comparison for benchmark differences.

Configuration

Global config lives at ~/.reasonix/config.json. Per-project config goes in .reasonix/ at the project root.

{
  "apiKey": "sk-...",
  "model": "deepseek-v4-flash",
  "planMode": true,
  "autoCheckpoint": true,
  "memory": {
    "enabled": true,
    "path": ".reasonix/memory.md"
  },
  "hooks": {
    "afterEdit": "npm run lint --fix",
    "afterSession": "git add -A"
  }
}

Key configuration options:

  • planMode: When true, Reasonix shows a plan before making changes and waits for approval.
  • autoCheckpoint: Creates git commits at logical breakpoints so you can revert.
  • memory: Persistent memory file that loads at session start. Stores project conventions, architecture decisions, and preferences.
  • hooks: Shell commands that run at lifecycle events.

Features deep-dive

Plan mode

Enable with /plan in-session or planMode: true in config. Reasonix outlines what it intends to do before touching files. You approve, reject, or modify the plan. Essential for large refactors where you want oversight.

MCP servers

Reasonix supports Model Context Protocol servers for extending its capabilities:

{
  "mcp": {
    "servers": {
      "github": {
        "command": "npx",
        "args": ["@modelcontextprotocol/server-github"]
      },
      "postgres": {
        "command": "npx",
        "args": ["@modelcontextprotocol/server-postgres"]
      }
    }
  }
}

This gives Reasonix access to GitHub PRs, database schemas, or any other MCP-compatible data source.

Skills

Skills are reusable prompt templates for common tasks:

> /skill create-api-endpoint

Define once, invoke repeatedly. Skills maintain cache stability because they are loaded in a fixed position in the prompt.

Hooks

Hooks run shell commands at specific lifecycle points:

  • beforeEdit - Before any file modification
  • afterEdit - After file modifications (lint, format)
  • beforeSession - Session startup (pull latest, install deps)
  • afterSession - Session end (commit, push)

Memory

The memory file (.reasonix/memory.md) persists across sessions. Reasonix reads it at startup and appends learnings during work. Store project conventions, tech stack details, and architectural decisions here.

Reasonix can search the web using Mojeek, SearXNG, or Metaso backends. Useful for looking up documentation, error messages, or API references without leaving the session.

Persistent sessions and semantic index

Sessions persist by default. Close your terminal, come back later, and resume where you left off. Reasonix also builds a semantic index of your codebase for faster file discovery.

Auto-checkpoints

When enabled, Reasonix creates git commits at logical breakpoints. If something goes wrong, you can revert to any checkpoint. This is safer than tools that make changes without version control integration.

Effort knob

> /effort high

Controls how much reasoning the model applies. Low effort for simple edits, high effort for complex architectural decisions. This maps to different system prompt configurations that trade speed for thoroughness.

Transcript replay

Every session is recorded. Replay past sessions to review what happened:

reasonix replay --last

Useful for auditing changes or understanding what the agent did during a long autonomous run.

Cost savings: the real numbers

The headline stat bears repeating: 435M input tokens, 99.82% cache hit rate, ~$12 actual cost vs ~$61 without cache optimization.

Here is how that breaks down for typical sessions:

Session typeInput tokensCache hitsEffective costWithout cache
Quick fix (5 min)50K99.5%$0.01$0.04
Feature (30 min)500K99.8%$0.05$0.24
Refactor (2 hrs)3M99.9%$0.15$1.31
Full day coding20M99.8%$0.85$4.12

These numbers use V4 Flash default pricing. With V4 Pro, multiply by roughly 6x but the cache savings ratio stays the same.

Compare this to Claude Code at $15/1M input (Opus) or Cursor at $20/month plus usage. Reasonix on DeepSeek Flash costs less per month of heavy use than a single hour of Claude Opus coding.

Desktop app

Reasonix has a prerelease desktop application built with Tauri. It provides a GUI wrapper around the same engine with:

  • Visual file tree
  • Diff viewer for proposed changes
  • Session history browser
  • One-click model switching

The desktop app is in early access. The CLI remains the primary interface and gets features first.

Comparison: Reasonix vs Claude Code vs Cursor vs Aider

FeatureReasonixClaude CodeCursorAider
Cost modelPay-per-token (DeepSeek)Pay-per-token (Anthropic)$20/mo + usagePay-per-token (any)
Typical session cost$0.03-0.15$2-15$0.50-3$0.10-2
Default modelV4 FlashClaude Sonnet/OpusGPT-5.5/ClaudeAny via OpenRouter
Cache optimization99.8% hit rateBasicNoneNone
Open sourceYes (MIT)NoNoYes (Apache 2.0)
InterfaceTerminal + DesktopTerminalIDETerminal
MCP supportYesYesYesNo
Plan modeYesYes (diff review)NoYes (architect)
MemoryYesYes (CLAUDE.md)RulesConvention files
Multi-modelFlash + ProSonnet + OpusMultipleAny
PlatformsmacOS/Linux/WindowsmacOS/LinuxmacOS/Linux/WindowsmacOS/Linux/Windows

Choose Reasonix if: You want the lowest possible cost per session, you are comfortable with DeepSeek models, and you value open source.

Choose Claude Code if: You need Anthropic’s specific capabilities, your company already pays for Anthropic, or you need the most mature agentic coding experience.

Choose Cursor if: You prefer an IDE-integrated experience over terminal workflows.

Choose Aider if: You want model flexibility via OpenRouter and do not care about cache optimization. See our Aider vs OpenCode comparison for more on that choice.

Getting started checklist

  1. Install Node >= 22
  2. npm install -g reasonix
  3. Get a DeepSeek API key (guide)
  4. Set DEEPSEEK_API_KEY environment variable
  5. Run reasonix doctor to verify
  6. cd into your project and run reasonix code
  7. Create .reasonix/memory.md with your project conventions
  8. Enable plan mode for your first few sessions until you trust it

FAQ

Is Reasonix free?

Reasonix itself is free and MIT licensed. You pay for DeepSeek API usage. With V4 Flash at $0.07/1M input and 99.8% cache hits, a full day of coding costs under $1.

Can Reasonix use models other than DeepSeek?

Reasonix is designed specifically for DeepSeek’s API. The cache optimization only works with DeepSeek’s prefix caching implementation. Using other models would lose the primary cost advantage.

How does Reasonix compare to Claude Code on quality?

The quality depends on the underlying model. V4 Pro scores 80.6% on SWE-bench vs Claude Opus 4.7’s 83.2%. For most coding tasks, the difference is negligible. Where Reasonix wins is cost: the same quality work at 1/20th the price. See our V4 Pro guide for detailed benchmarks.

What is the dsnix alias?

dsnix is a shorter alias for the reasonix command. All commands work identically: dsnix code, dsnix chat, dsnix run "task".

Does Reasonix work with monorepos?

Yes. Reasonix’s semantic index handles large codebases. Point it at the monorepo root or a specific package. The memory file can store monorepo-specific navigation hints.

Can I use Reasonix in CI/CD?

Yes. The reasonix run "task" command is designed for automation. It accepts piped input, runs non-interactively, and exits with appropriate status codes. Use it for automated code review, test generation, or documentation updates.

How do I maximize cache hits?

Keep sessions long rather than starting fresh frequently. Avoid clearing context unnecessarily. Use memory files for stable context. The prefix cache deep-dive covers optimization strategies in detail.

Is my code sent to DeepSeek’s servers?

Yes, code is sent to DeepSeek’s API for processing. DeepSeek’s data policy states they do not use API inputs for training. If you need fully local processing, consider running DeepSeek locally instead, though you lose the cache cost benefits.