ReloadedCode
Production-grade coding agent tools in Rust.
~10 MiB. No TUI. Embed it anywhere.
Why this project?
reloaded-code started as "an OpenCode for servers." Headless, sandboxed, and cheap to host for non-commercial use.
OpenCode is a great interactive coding agent, but it's a TypeScript application that uses ~305 MiB of RAM and runs as a separate process. What if you need those same tools for a server? A Discord bot? A CI pipeline? A custom product?
reloaded-code ships the same agent tools as a Rust library. Shell sandboxing. Default-deny permissions. ~10 MiB footprint.
Features
📄 File Operations
Read, write, and edit files with line-numbered output, offset/limit, and exact text replacement.
🔍 Search
Glob pattern matching and regex content search with match metadata and configurable limits.
💻 Shell Execution
Cross-platform command execution with timeout, captured output, and optional Linux sandboxing.
🌐 Web Fetch
Fetch URLs and convert HTML to markdown. Configurable timeouts and size limits.
🔒 Sandboxing
Linux bubblewrap profiles for shell isolation. Network isolation, filtered filesystem, scrubbed env.
🤖 Agent Runtime
Load agent markdown files based on OpenCode's schema. Multi-agent delegation with recursion depth limits.
🗄️ Model Catalog
Sync the models.dev catalog with ETag caching, zstd compression, and offline fallback.
🔑 Permissions
Default-deny tool access with ordered rules where the last matching rule takes priority. Wildcard patterns for delegation control.
⚡ Async + Sync
Every tool compiles as async (tokio) or blocking. Zero overhead at the call site.
🧩 Embeddable
Framework-agnostic core. Use the SerdesAI integration or build your own with the core primitives.
Quick Start
1. Add the dependencies:
[dependencies]
reloaded-code-serdesai = "0.2"
reloaded-code-agents = "0.1"
reloaded-code-core = "0.2"
reloaded-code-models-dev = "0.1"
tokio = { version = "1", features = ["full"] }
2. Create an agent file (agents/coder.md):
---
name: coder
mode: all
description: A coding agent that can read, search, and edit files.
permission:
read: allow
write: allow
edit: allow
glob: allow
grep: allow
bash: allow
webfetch: allow
task: deny
---
You are a coding assistant. Use the available tools to complete the user's task.
3. Load the catalog, build the agent, and run:
use reloaded_code_agents::{AgentCatalog, AgentLoader, AgentRuntimeBuilder};
use reloaded_code_core::CredentialResolver;
use reloaded_code_models_dev::ModelsDevCatalog;
use reloaded_code_serdesai::{AgentBuildContext, AgentDefaults};
use std::{path::PathBuf, sync::Arc};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Load agents from the "agents" directory.
let mut catalog = AgentCatalog::new();
AgentLoader::new().add_directory(&mut catalog, "./agents")?;
// Supports any model from https://models.dev
let load_result = ModelsDevCatalog::load().await?;
let runtime = AgentRuntimeBuilder::new()
.catalog(catalog) // Load agent definitions from the catalog.
.defaults(AgentDefaults::with_model("synthetic/hf:MiniMaxAI/MiniMax-M2.5"))
.build()?;
let build_context = AgentBuildContext::new(
Arc::new(runtime),
Arc::new(load_result.catalog),
Arc::new(CredentialResolver::new()),
);
let agent = build_context.build("coder")?;
let response = agent.run("Find all TODO comments in src/", ()).await?;
println!("{}", response.output());
Ok(())
}
See Getting Started for the full walkthrough with dependency setup and an alternate path without agent files.
Crate Map
core
Framework-agnostic tools for building coding agents. File operations, search, shell, permissions, system prompts - use with any LLM framework.
agents
Load agent markdown files based on OpenCode's schema into a typed catalog. Default-deny permissions with granular path matching.
serdesai
Ready-to-use SerdesAI (LLM serialization framework) integration. 15 LLM provider adapters, multi-agent task delegation with recursion depth limits.
bubblewrap
Sandbox shell execution on Linux. Network-isolated, filesystem-filtered profiles for untrusted input. Two presets included.
models-dev
Sync the models.dev catalog. ETag caching, offline fallback. ~3000 models in ~24 KiB.
Comparison with OpenCode
| Aspect | OpenCode | reloaded-code |
|---|---|---|
| Language | TypeScript | Rust |
| Runtime | Bun | tokio / blocking |
| Memory | ~305 MiB | ~13 MiB |
| Interface | TUI / Desktop / IDE | Library (headless, no UI) |
| Agent format | Markdown + YAML | Similar format |
| Permissions | Default-allow + interactive ask | Default-deny |
| Tool set | 14 tools | 10 tools (core set) |
| LLM framework | AI SDK (TypeScript) | SerdesAI / bring your own |
| Sandboxing | - | Linux bubblewrap profiles |
| Embeddable | Client/server HTTP API | Rust crate (library) |
See Comparison with OpenCode for a deeper breakdown.