Meet Dirge: The Rust-Powered AI Coding Agent That Actually Remembers
Let's be honest: most AI coding agents feel like hiring a new developer every single session. They show up, do some work, and forget everything the moment the conversation ends. You end up re-explaining your codebase, your preferences, your patterns — over and over. It's exhausting, and frankly, it's a waste of everyone's time.
That's the problem Dirge sets out to solve. This native Rust coding agent isn't just another wrapper around an LLM — it's a thoughtfully engineered system that treats context as something worth preserving.
Born from Rust, Built for Speed
One of the first things that jumps out about Dirge is its footprint. We're talking ~8MB RAM when idle, a 36MB binary, and zero runtime dependencies. That's it. Compare that to Electron-based alternatives that'll happily eat gigabytes of your RAM before you've written a single line of code.
This matters because AI coding tools shouldn't be divas. They should be quiet, efficient, and ready when you need them — not hungry beasts that tank your machine's performance the moment you open a terminal.
The terminal-first TUI (built with ratatui and crossterm) keeps things lean and keyboard-driven. You get live token streaming, a branching session tree to track your conversation history, and configurable info panes. It's the interface developers actually want: fast, information-dense, and mouse-free.
An Agent That Doesn't Panic
Here's where Dirge gets interesting. The agent loop isn't just "send prompt, get response, execute tools." It's engineered to handle reality.
Models hallucinate tool calls. They malformed JSON. They misinterpret paths. Standard agents fall apart here — they either crash, loop infinitely, or produce garbage that you have to clean up manually. Dirge repairs malformed tool calls, validates every file write through tree-sitter before it touches disk, and has circuit breakers for repeat loops.
But the killer feature? When a model keeps failing, Dirge doesn't just give up. It injects a recovery checkpoint, suggests what the model probably meant (the tool or path), and if that doesn't work, escalates to a stronger model automatically. It's the difference between an agent that batters itself against a wall and one that actually gets the job done.
Memory That Persists
The name "dirge" is apt. In case you're not familiar, a dirge is a song sung to guide the dead — to keep them from losing their way. In the context of AI agents, that's exactly what Dirge does with your project's context.
Dirge implements a two-tier memory system. The hot tier keeps facts inline where the model can access them immediately. The rest goes into a searchable breadcrumb index. And there's a global cross-project tier for your personal preferences — the way you like your code formatted, your preferred patterns, your pet peeves. This persists across sessions, across projects.
Between sessions, a post-session orchestrator extracts learnings and curates memory and skills. So if you spent 20 minutes debugging a tricky Rust lifetime issue with a specific pattern, Dirge remembers that. Next time you hit something similar, it has context.
Long-horizon sessions use durable, incrementally-refreshed checkpoints anchored to a stable identity. Resuming a compacted session recovers its live state — not a stale snapshot. If you've ever tried to pick up a week-old coding task and spent 30 minutes re-orienting yourself, you'll understand why this matters.
Smart Routing and Multi-Provider Support
Dirge doesn't lock you into a single AI provider. It supports OpenAI, Anthropic, DeepSeek, Gemini, Ollama, OpenRouter, and GLM — plus any OpenAI-compatible endpoint. OpenRouter is the default, which means it works out of the box for most users.
But here's the sophisticated part: you can route different tasks to different models. The main loop, review, escalation, summarization, and subagent roles can each point at different models. Want to use a cheap, fast model for routine edits but escalate to something beefier for complex refactoring? Dirge makes that configuration trivial.
Security Without Compromise
Dirge takes security seriously with a unified permission engine — one Policy Decision Point with four modes, operation-based rules, and session allowlists. The /why command traces exactly which policy made a decision and why. No black boxes.
For the paranoid (and you should be paranoid), there's sandbox mode. Run bash commands in isolation using bubblewrap for a namespaced jail, or leverage hardware-isolated libkrun microVMs. Defense in depth on top of the permission engine.
Built for Serious Development
Beyond the core agent loop, Dirge packs in features that serious developers need:
The phased planning workflow runs explore → plan → implement → review as context-isolated phases. A read-only agent maps the code, a second drafts the plan, then a write-disabled reviewer runs the code and feeds gaps back for a bounded retry. It's like having a architectural review built into your workflow.
The spec-driven workflow tracks changes as SQLite rows (not fragile markdown files). Proposals, requirement deltas, and task checklists with real status — the active change is always injected into context, and archiving forms a durable memory.
Code intelligence comes from tree-sitter integration, with inline LSP diagnostics for 10+ languages surfaced directly in tool output so the agent fixes compile errors on the same turn. No more "try this fix... build fails... try again" loops.
And if you need to debug? Dirge has a built-in Debug Adapter Protocol client that drives real debuggers — set breakpoints, step through code, inspect stacks and variables — straight from the agent loop.
Extensible by Design
The Janet plugin system hooks the full lifecycle: intercept tools, rewrite prompts, register commands. There's also Claude-compatible skills loaded on demand. And MCP/ACP support means Dirge can be both a tool provider and consumer — you could have Claude Code delegate implementation tasks to Dirge and review them, for instance.
The Bottom Line
Dirge isn't trying to be the flashiest AI coding tool. It's trying to be the most reliable one. The memory persistence, the error recovery, the token-efficient I/O (files are read as skeletons when possible, oversized outputs are relayed to disk with summaries), the multi-provider flexibility — it all adds up to an agent that actually works with you over time instead of resetting every session.
For developers tired of starting from scratch, startups that need consistent AI assistance without vendor lock-in, and anyone who's been burned by an AI that forgot everything important — Dirge is worth a look.
Install it in one line from crates.io (cargo install dirge-agent), set an API key, and start coding. It's that simple to get started.
The death dirge was a song to remember the dead. Dirge, the coding agent, is a system to make sure your AI never forgets what you've built together.