Labsco
beardfaceguy logo

Daimonos

from beardfaceguy

MCP server for coding agents that returns structured, low-noise tool output to reduce tokens/cost.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

Daimonos

An agent-optimized OS layer that makes AI coding agents faster and cheaper.

Daimonos replaces the built-in file, search, exec, and git tools in your AI coding agent with structured equivalents that return compact JSON instead of raw terminal output. The result: fewer tokens consumed, fewer round-trips, and lower API costs โ€” with zero changes to your workflow.

Platforms: Linux (x86_64, aarch64) and macOS (Apple Silicon, Intel). Windows support is planned.

For repository agent/operator conventions, see AGENTS.md (especially Daimonos tool usage policy).

The name comes from Greek daimon (agent/spirit), the etymological root of "daemon."

The problem

When an AI agent runs cargo test, it gets back hundreds of lines of terminal output โ€” progress bars, compile messages, passing test names โ€” when all it needs is "47 passed, 0 failed." The agent pays for every token of that noise: reading it, reasoning about it, and carrying it in context for the rest of the session.

The same waste happens with git status, docker ps, ls -la, and every other shell command. Agents spend 30-50% of their token budget on verbose, unstructured tool output.

How it works

Daimonos runs as an MCP server that your IDE or CLI spawns automatically. It provides the same operations agents already use โ€” read files, write files, search, execute commands, git operations โ€” but returns compact, structured JSON instead of raw text.

Agent: exec("cargo test")

Without Daimonos (raw terminal output):
   Compiling inventory v0.1.0 (/workspace)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 2.31s
     Running unittests src/main.rs (target/debug/deps/inventory-abc123)
running 47 tests
test config::tests::test_default ... ok
test config::tests::test_load ... ok
... (200+ more lines)
test result: ok. 47 passed; 0 failed; 0 ignored

With Daimonos (structured JSON):
{"ok":true,"tests":47,"passed":47,"failed":0,"failures":[]}

Three layers of optimization

  1. Native tool plugins โ€” git, cargo, gh, and docker are exposed as first-class MCP tools with structured JSON output. When agents call exec("cargo test"), Daimonos intercepts it and routes through the native plugin instead.

  2. Semantic output filters โ€” For commands without native plugins (pytest, make, pip install, eslint, etc.), Daimonos applies semantic compression: test runners return summary + failures only, build commands return "ok" or just the errors, install commands return success/failure.

  3. Protocol-level efficiency โ€” Read deduplication (re-reading an unchanged file returns {"unchanged":true} instead of the full content), compact field names, lazy tool exposure, batch operations, and a terse output directive that cuts LLM prose by ~30%.

Benchmark results

Tested with Claude Opus 4.6 on identical coding tasks (read files, search code, edit, run tests, git operations):

MetricBaselineDaimonosSavings
Output tokens5,8423,198-45.3%
Total tokens41,23933,847-17.9%
Tool calls17 avg14 avg-17.6%
Wall time42.1s avg35.2s avg-16.4%

Remote benchmarks on AWS (same hardware, same model, same tasks) showed 20.3% cost reduction and 14.0% faster task completion.

60-second demo

Use this script for README readers, release notes, and social posts:

# 1) Install daimonos
cargo build --release
sudo cp target/release/daimonos /usr/local/bin/

# 2) Configure your MCP client (example: Cursor)
# .cursor/mcp.json -> command: daimonos, args: ["--mcp", "-w", "/path/to/project"]

# 3) Ask your agent to run:
# "Run cargo test and summarize failures only."
# "Show git status as structured output."

What to highlight in the demo:

  • same workflows, less tool-output noise
  • structured responses instead of raw terminal spam
  • fewer tokens and fewer round-trips for common coding tasks

What's included

Core tools (always available)

ToolWhat it does
read_fileRead with optional offset/limit, content-hash deduplication
write_fileWrite with auto-mkdir
edit_fileString replacement with diff confirmation
searchRegex search (content mode) or file discovery (file mode)
execRun commands with semantic output filtering
batchMultiple operations in a single round-trip
workspace_infoProject type, git status, directory listing, analytics

Native tool plugins (auto-detected)

These appear automatically when the corresponding CLI tool is found on PATH:

PluginCommandsDetected by
gitstatus, log, diff, branch, add, commit, push, pull, checkout.git directory
cargotest, build, check, clippy, fmt, addCargo.toml
ghpr_view, pr_list, pr_create, pr_diff, pr_checks, apigh on PATH
dockerps, logs, exec, images, inspect, stop, compose_up/down/psdocker on PATH

Additional capabilities

  • Workspace snapshots โ€” Checkpoint before risky edits, rollback on failure
  • Starlark scripting โ€” Bundle multiple tool calls into a single script
  • Token analytics โ€” Per-tool-call tracking with cross-session history (daimonos --stats)
  • Background processes โ€” Start, poll, and kill long-running commands
  • Configurable โ€” All tunables in a single TOML config file

Architecture

Daimonos is a single Rust binary (~15 MB) that speaks MCP (Model Context Protocol) over stdio. Your IDE spawns it as a subprocess โ€” no network, no containers, no setup beyond a JSON config entry.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     MCP (JSON-RPC over stdio)     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  AI Agent    โ”‚ โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ โ”‚   Daimonos      โ”‚
โ”‚  (Cursor,    โ”‚                                    โ”‚                 โ”‚
โ”‚   Copilot,   โ”‚     Structured JSON responses      โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚   Claude,    โ”‚ โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚  โ”‚ File ops  โ”‚ โ”‚
โ”‚   etc.)      โ”‚                                    โ”‚  โ”‚ Search    โ”‚ โ”‚
โ”‚              โ”‚                                    โ”‚  โ”‚ Exec      โ”‚ โ”‚
โ”‚              โ”‚                                    โ”‚  โ”‚ Git       โ”‚ โ”‚
โ”‚              โ”‚                                    โ”‚  โ”‚ Cargo     โ”‚ โ”‚
โ”‚              โ”‚                                    โ”‚  โ”‚ Docker    โ”‚ โ”‚
โ”‚              โ”‚                                    โ”‚  โ”‚ GitHub    โ”‚ โ”‚
โ”‚              โ”‚                                    โ”‚  โ”‚ Snapshots โ”‚ โ”‚
โ”‚              โ”‚                                    โ”‚  โ”‚ Analytics โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                    โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
                                                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Under the hood, Daimonos uses an opcode-based protocol where each operation has a numeric identifier and compact field names (c, p, s, n) to minimize token overhead. The MCP layer translates between standard JSON-RPC and the internal opcode format.

Project vision

Daimonos is being built in three phases:

Phase 1: User-space MCP server (current)

A Rust daemon that runs on any Linux or macOS machine and provides agent-optimized tools via MCP. This is what you install today. It proves out the protocol design and structured I/O patterns.

Status: Production-ready. Used daily for real development work. Pre-built binaries available for Linux (x86_64, aarch64, musl) and macOS (Apple Silicon, Intel).

Phase 2: Minimal Linux distro

A purpose-built Buildroot Linux image with Daimonos as the primary user-space application. Designed for cloud deployment where AI agents need a clean, minimal environment. The distro boots in seconds, has no shell or human-facing UI, and runs the Daimonos daemon as PID 1's direct child.

Status: Working prototype. Boots in QEMU, deployable to AWS EC2. Used for remote benchmarking.

Phase 3: Custom microkernel

The long-term vision: a microkernel where Daimonos opcodes become native syscalls. StructFS (a filesystem that stores and returns structured data natively), capability-based security, and a process model designed for agent workloads from the ground up.

Status: Design phase.

Development

Prerequisites

DependencyRequiredInstall
Rust (stable 1.75+)Buildrustup.rs
Python 3 + pytestTestspip install -r tests/requirements.txt

Running tests

# Rust unit tests (350+ tests, parallel-safe)
cargo test

# End-to-end MCP protocol tests (150+ pytest cases)
python3 -m pytest tests/ -v

Running benchmarks

cd benchmarks
./setup-mcp.sh
./run-benchmark.sh baseline   # IDE built-in tools
./run-benchmark.sh daimonos   # routed through daimonos MCP
python3 analyze-results.py results/

See benchmarks/README.md for details.