The Problem
Every developer using AI coding assistants faces the same friction: managing multiple sessions, tracking costs, and maintaining workflow discipline across terminal windows. The existing solutions are either web-based (adding latency) or too lightweight (missing critical features).
I wanted something that felt terminal-native — not a web app pretending to be a desktop app, but a real native application with the speed and integration that only comes from running on bare metal.
Why Tauri 2
The decision came down to three options:
// Option 1: Electron — proven but heavy
// 200MB+ binary, Chromium overhead, memory hog
// Option 2: Flutter Desktop — cross-platform but foreign
// Dart ecosystem, limited native integration
// Option 3: Tauri 2 — Rust backend, web frontend, tiny binary
// 5MB binary, native OS APIs, React frontend
Tauri 2 was the clear winner. The Rust backend gives us:
- Direct process management via
std::process::Command - SQLite for session state without a separate database process
- Native OS integration — tray icons, notifications, global shortcuts
- Tiny binaries — under 10MB vs Electron's 200MB+
Architecture
The core architecture follows a simple pattern:
pub struct SessionManager {
sessions: HashMap<Uuid, Session>,
dag: WorkflowDAG,
budget: BudgetTracker,
}
impl SessionManager {
pub async fn spawn_session(&mut self, config: SessionConfig) -> Result<Uuid> {
let session = Session::new(config)?;
let id = session.id;
// Enforce workflow constraints before starting
self.dag.validate_dependencies(&session)?;
self.budget.check_remaining(&session)?;
self.sessions.insert(id, session);
Ok(id)
}
}
The frontend is React 19 with xterm.js for terminal rendering. Each terminal session is a real PTY — not a simulated terminal.
Workflow DAGs
The most interesting feature is the workflow DAG system. You define task dependencies:
# .mjolnir/workflow.yaml
tasks:
research:
prompt: "Research the authentication patterns in this codebase"
budget: $0.50
plan:
prompt: "Create an implementation plan based on research"
depends_on: [research]
budget: $0.30
implement:
prompt: "Implement the plan"
depends_on: [plan]
budget: $2.00
test:
prompt: "Write tests for the implementation"
depends_on: [implement]
budget: $1.00
Mjolnir ensures tasks execute in dependency order, with budget gates at each step. If a task exceeds its budget, it pauses and asks before continuing.
Cost Tracking
Every API call is logged with token counts and costs:
CREATE TABLE api_calls (
id INTEGER PRIMARY KEY,
session_id TEXT NOT NULL,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
model TEXT NOT NULL,
input_tokens INTEGER,
output_tokens INTEGER,
cost_usd REAL,
FOREIGN KEY (session_id) REFERENCES sessions(id)
);
The dashboard shows real-time spend across all sessions, with daily/weekly/monthly breakdowns.
What's Next
Mjolnir is in active development. The roadmap includes:
- WebGL session visualization — see all active sessions in a spatial layout
- Plugin system — extend Mjolnir with custom workflow steps
- Team mode — share workflow DAGs across a team
- Cost alerts — Slack/Discord notifications when budgets are hit
If you're building with AI coding assistants and want more control over your workflow, stay tuned for the open source release.