# FireClaw

> FireClaw — open-source AI coding agent forged in Mojo. Clean-room rewrite of Claw Code with 184+ tools, full MCP integration, and 3-tier permissions. Mojo delivers C-level speed with full Python library compatibility via native interop. Runtimes in Mojo, Rust & Python.

- **Type:** MCP server
- **Install:** `agentstack add mcp-eldergenix-fireclaw`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Eldergenix](https://agentstack.voostack.com/s/eldergenix)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [Eldergenix](https://github.com/Eldergenix)
- **Source:** https://github.com/Eldergenix/FireClaw

## Install

```sh
agentstack add mcp-eldergenix-fireclaw
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# FireClaw

### The AI Coding Agent Forged in Mojo

**FireClaw** is a high-performance, open-source AI coding assistant and agent framework forged in [Mojo](https://www.modular.com/mojo) — the systems programming language that fuses Python's usability with C-level speed. Born from the architecture of Claw Code and rewritten from scratch, FireClaw delivers 184+ developer tools, Model Context Protocol (MCP) integration, and multi-language runtimes from your terminal — at native performance.

[](https://github.com/instructkr/fireclaw)
[](https://www.modular.com/mojo)
[](https://www.rust-lang.org/)
[](https://python.org)
[](#license)
[](#testing)
[](https://github.com/sponsors/instructkr)

[Quick Start](#quick-start) · [Features](#features) · [Why Mojo?](#why-mojo-over-python-and-typescript) · [Python Compatibility](#full-python-compatibility--use-every-python-library-from-mojo) · [FireClaw vs Claw Code](#fireclaw-vs-claw-code) · [Comparison](#how-fireclaw-compares-to-other-ai-coding-tools) · [FAQ](#frequently-asked-questions)

---

## What Is FireClaw?

**FireClaw is an open-source AI coding assistant and agentic development framework** that runs entirely from your terminal. It is a clean-room reimplementation of Claw Code's agent architecture, rewritten from the ground up in Mojo for maximum performance. FireClaw connects to large language models (LLMs), orchestrates 184+ developer tools, and manages multi-turn conversations with full project awareness — delivering the power of an AI pair programmer at native speed.

Unlike cloud-locked AI coding tools, FireClaw is self-hosted, gives you fine-grained control over permissions and tool access, persists sessions across restarts, and runs on your machine. It is the first major open-source AI agent framework written in Mojo, proving the language's readiness for production-grade systems.

> **Built on the foundation of Claw Code** — the fastest repo in history to surpass 50K GitHub stars (reached in just 2 hours). FireClaw takes that architecture further with a ground-up Mojo rewrite for speed, safety, and extensibility.

  

  
    
      
      
      
    
  

---

## Why FireClaw?

| Problem | How FireClaw Solves It |
|---------|----------------------|
| AI coding tools are cloud-only and proprietary | FireClaw is **open-source** and runs locally in your terminal |
| Existing agents lack real tool execution | **184+ built-in tools** for file ops, shell, search, web, MCP, and more |
| No project awareness across sessions | **CLAW.md** auto-discovery + session persistence + git integration |
| AI assistants can't be extended | **Plugin system**, hooks pipeline, MCP server integration |
| Performance bottlenecks in Python-based agents | Built in **Mojo** — Python syntax with C-level speed |
| No fine-grained access control | **3-tier permission system**: read-only, workspace-write, full-access |
| Claw Code was TypeScript-only and proprietary | FireClaw is a **clean-room Mojo rewrite** — open, fast, and yours to own |

---

## Features

### Core AI Agent Capabilities

- **Interactive REPL** — Chat with AI models in a rich terminal interface with markdown rendering and syntax highlighting
- **Streaming Responses** — Real-time token-by-token output with Server-Sent Events (SSE)
- **184+ Developer Tools** — File read/write/edit, Bash execution, glob/grep search, web fetch, agent orchestration, todo tracking, and more
- **207 Slash Commands** — `/help`, `/status`, `/cost`, `/compact`, `/model`, `/diff`, `/export`, `/session`, and 200+ more
- **Extended Thinking** — Multi-step reasoning with thinking blocks for complex coding tasks
- **Session Persistence** — Save, resume, and compact conversations across restarts

### Model Context Protocol (MCP) Integration

- **Stdio, WebSocket, and HTTP transports** for connecting external tool servers
- **OAuth-managed proxy support** for authenticated MCP connections
- **Server lifecycle management** — auto-start, health checks, and graceful shutdown
- **Custom MCP tool registration** — extend FireClaw with any MCP-compatible server

### Project Intelligence

- **CLAW.md Discovery** — Automatically reads project documentation for context-aware assistance
- **Git Integration** — Reads diffs, branches, and commit history for change-aware coding
- **Config Hierarchy** — Workspace `.claw.json` > local settings > environment variables > CLI flags
- **Cost Tracking** — Real-time token accounting with per-model pricing breakdowns

### Security & Permissions

- **Read-only mode** — AI can read but not modify your codebase
- **Workspace-write mode** — Controlled write access within project boundaries
- **Full-access mode** — Unrestricted tool execution for trusted workflows
- **Per-tool denylists** — Block specific tools by name or prefix pattern
- **Pre/Post tool hooks** — Middleware-style interception for every tool execution

### Extensibility

- **Plugin System** — Add custom tools, commands, and integrations
- **Hooks Pipeline** — PreToolUse and PostToolUse hooks for automated workflows
- **Skill System** — Invoke specialized capabilities via slash commands
- **Multi-language Runtimes** — Choose Mojo (performance), Rust (safety), or Python (compatibility)

---

## Quick Start

### Mojo (Primary — Fastest Performance)

**Prerequisites:** [Max toolchain 25.3+](https://www.modular.com/max) with Pixi package manager.

```bash
# Clone the repository
git clone https://github.com/instructkr/fireclaw.git
cd fireclaw/mojo

# Install dependencies
pixi install

# Build and run
mojo build packages/claw_cli/main.mojo -o fireclaw
./fireclaw --help

# Start interactive REPL
./fireclaw

# Single-shot prompt
./fireclaw -p "Explain this codebase"
```

### Rust (Complete Port — Memory Safe)

**Prerequisites:** Rust 1.70+ with Cargo.

```bash
cd fireclaw/rust

# Build release binary
cargo build --release

# Run the CLI
./target/release/claw --help

# Start interactive REPL
./target/release/claw

# Run all 274 tests
cargo test --workspace
```

### Python (Reference Implementation)

```bash
cd fireclaw

# Render porting summary
python3 -m src.main summary

# Print workspace manifest
python3 -m src.main manifest

# List tools and commands
python3 -m src.main tools --limit 10
python3 -m src.main commands --limit 10

# Run verification tests
python3 -m unittest discover -s tests -v
```

---

## Architecture

FireClaw uses a **modular package architecture** consistent across all three language implementations:

```
fireclaw/
├── mojo/                           # Mojo implementation (primary)
│   ├── packages/
│   │   ├── api/                    # Anthropic API client + SSE streaming
│   │   ├── claw_runtime/           # Session, config, prompt assembly
│   │   ├── claw_cli/              # CLI entry point and REPL
│   │   ├── tools/                  # 184+ built-in tool implementations
│   │   ├── commands/               # 207 slash command handlers
│   │   ├── bridge/                 # Python interop for networking/TLS/OAuth
│   │   └── compat/                 # TypeScript feature surface testing
│   ├── main.mojo                   # CLI entry point
│   └── pixi.toml                   # Mojo + Python dependency management
│
├── rust/                           # Rust port (complete, 274 tests passing)
│   ├── crates/
│   │   ├── api/                    # HTTP client, SSE, authentication
│   │   ├── runtime/                # Conversation loop, config, session, MCP
│   │   ├── tools/                  # Tool specifications and execution
│   │   ├── commands/               # Slash command registry
│   │   ├── claw-cli/             # Main CLI binary
│   │   └── plugins/                # Plugin system with hooks
│   └── Cargo.toml
│
├── src/                            # Python reference implementation
│   ├── commands.py                 # 207 command registry (mirrored)
│   ├── tools.py                    # 184 tool registry (mirrored)
│   ├── runtime.py                  # Port runtime engine
│   ├── models.py                   # Data structures
│   └── reference_data/             # Command/tool snapshots (JSON)
│
├── CLAW.md                         # Project context for AI assistants
├── PARITY.md                       # Mojo port gap analysis
└── README.md
```

### Design Principles

| Principle | Implementation |
|-----------|---------------|
| **Native Mojo for compute-bound paths** | Tool execution, prompt assembly, config parsing, session management |
| **Python interop for I/O-bound paths** | HTTP, TLS, WebSocket, OAuth via `bridge/` package |
| **Structural parity across languages** | Same package decomposition: api, runtime, tools, commands, cli |
| **Permission-first security** | Every tool call passes through permission evaluation + hooks |
| **Clean-room implementation** | No proprietary code — architectural patterns only |

---

## FireClaw vs Claw Code

FireClaw is not a fork — it is a **clean-room reimplementation** of Claw Code's architecture, rewritten entirely in Mojo with additional runtimes in Rust and Python. Here's what changed:

| Dimension | Claw Code (Original) | FireClaw (This Project) |
|-----------|---------------------|------------------------|
| **Language** | TypeScript (Node.js) | Mojo (primary), Rust, Python |
| **Performance** | Interpreted JS runtime | Near-C native speed via Mojo |
| **Source availability** | Proprietary / exposed once | Fully open-source from day one |
| **Memory model** | Garbage collected | Deterministic destruction (Mojo) / ownership (Rust) |
| **Python ecosystem** | Not accessible | Seamless Python interop via Mojo bridge |
| **GPU/SIMD path** | None | Native Mojo SIMD/GPU primitives (future accelerated ops) |
| **Extensibility** | Internal plugin system | Open plugin system + hooks + MCP + community registry |
| **Legal status** | IP concerns with leaked source | Clean-room — no proprietary code, architectural patterns only |
| **Multi-runtime** | Single runtime | Three runtimes: Mojo (speed), Rust (safety), Python (compatibility) |
| **Test coverage** | Unknown | 274 tests passing across Rust workspace |

### What FireClaw Keeps From Claw Code

- The proven agent loop architecture (tool dispatch, conversation management, streaming)
- CLAW.md project context discovery pattern
- 184+ tool surface area and 207 slash command registry
- MCP protocol integration design
- Session persistence and compaction model
- Permission system with hooks pipeline

### What FireClaw Adds

- **Mojo-native performance** for compute-bound paths (tool execution, prompt assembly, config parsing)
- **Python interop bridge** for I/O-bound paths (HTTP, TLS, OAuth, WebSocket)
- **Multi-language architecture** — choose the runtime that fits your needs
- **Open-source governance** — community contributions welcome across all three runtimes
- **Modular package system** matching the Rust crate structure for maintainability

---

## How FireClaw Compares to Other AI Coding Tools

### AI Coding Assistant Comparison (2026)

| Feature | FireClaw | GitHub Copilot | Cursor | Aider | Continue | Claw Code |
|---------|:--------:|:--------------:|:------:|:-----:|:--------:|:---------:|
| **Open source** | Yes | No | No | Yes | Yes | No |
| **Terminal-native CLI** | Yes | No | No | Yes | No | Yes |
| **Language** | Mojo/Rust/Python | N/A | N/A | Python | TypeScript | TypeScript |
| **Built-in tools** | 184+ | Limited | IDE only | ~10 | ~15 | 184+ |
| **MCP integration** | Full | No | Partial | No | Yes | Full |
| **Session persistence** | Yes | No | No | Partial | No | Yes |
| **Permission system** | 3-tier + hooks | N/A | N/A | Basic | Basic | Yes |
| **Project context** | CLAW.md | No | .cursorrules | .aider | .continue | CLAW.md |
| **Self-hosted** | Yes | No | No | Yes | Yes | No |
| **Cost tracking** | Built-in | N/A | N/A | No | No | Yes |
| **Native performance** | Yes (Mojo) | N/A | N/A | No | No | No |
| **Plugin hooks** | Pre/Post | No | No | No | Basic | Yes |

### Why Mojo Over Python and TypeScript?

FireClaw could have been written in Python (like Aider) or TypeScript (like the original Claw Code). We chose Mojo because an AI coding agent has a unique performance profile — it must be **fast on CPU-bound tool execution** and **smooth on streaming I/O** — and Mojo is the only language that delivers both while keeping the entire Python ecosystem accessible.

#### Mojo vs Python vs TypeScript — Language Comparison for AI Agents

| Dimension | Mojo (FireClaw) | Python (Aider, etc.) | TypeScript (Claw Code) |
|-----------|:---------------:|:--------------------:|:----------------------:|
| **Execution model** | Compiled to native machine code | Interpreted (CPython) | JIT compiled (V8) |
| **Tool execution speed** | Near-C — no interpreter overhead | 10-100x slower on CPU-bound ops | Faster than Python, slower than native |
| **Memory management** | Ownership + deterministic destruction | Garbage collected (GC pauses) | Garbage collected (GC pauses) |
| **Streaming smoothness** | No GC pauses during SSE parsing | GC can stutter mid-stream | GC can stutter mid-stream |
| **Type safety** | Static types, compile-time checks | Dynamic types, runtime errors | Static types (but transpiled) |
| **Python ecosystem access** | Direct — `from python import Python` | Native | Requires child processes or FFI |
| **GPU/SIMD primitives** | Built-in — first-class SIMD and GPU kernels | Via NumPy/CuPy (C extensions) | Not available |
| **Syntax familiarity** | Python-like — readable by any Python dev | Python | JavaScript/C-like |
| **Binary distribution** | Single compiled binary | Requires Python runtime + venv | Requires Node.js runtime |
| **Startup time** | Instant — no interpreter boot | 100-500ms interpreter warmup | 50-200ms V8 warmup |
| **Concurrency model** | Native (async roadmapped) | GIL-limited threads / asyncio | Event loop + async/await |

#### Where Mojo Beats Python (and Why It Matters for FireClaw)

An AI coding agent isn't a web server or a data pipeline. Its performance bottleneck is **tool execution** — the hundreds of file reads, regex searches, config parses, and prompt assemblies that happen every conversation turn. These are all CPU-bound, and they happen *synchronously in the agent loop* while the developer waits.

In Python, each of these operations carries interpreter overhead: dynamic type checks, dictionary lookups for attribute access, reference counting, and GC cycles. In Mojo, they compile to tight native loops with zero runtime overhead.

**Concrete impact in FireClaw:**

| Operation | In Mojo | In Python | Why It Matters |
|-----------|---------|-----------|----------------|
| **Grep 10,000 files** | Native string matching at compiled speed | `re` module with interpreter overhead per line | Developers run search dozens of times per session |
| **Parse `.claw.json` configs** | EmberJson — native JSON at memory-copy speed | `json.loads()` — interpreter-bound | Config is read on every single agent turn |
| **Assemble system prompt** | String concatenation compiles to `memcpy` | String ops allocate new objects each concat | Prompt assembly happens before every API call |
| **Serialize session to disk** | Native struct → JSON, near-instant | `dataclasses` → `json.dumps()`, GC pressure | Sessions save after every turn for persistence |
| **Glob walk a directory tree** | `std.pathlib` — compiled directory traversal | `pathlib.glob()` — interpreted per-entry | File discovery runs before every tool execution |

The difference isn't academic. On a large codebase (10K+ files), a full grep in Mojo completes while Python is still warming up its regex engine.

#### Where Mojo Beats TypeScript (and Why We Didn't Stay in TS)

The original Claw Code was TypeScript running on Node.js. TypeScript gives you type safety and a mature async ecosystem, but it has fundamental limitations for an AI agent:

1. **No Python interop** — TypeScript can't call `httpx`, `transformers`, `numpy`, or any Python library directly. FireClaw ca

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Eldergenix](https://github.com/Eldergenix)
- **Source:** [Eldergenix/FireClaw](https://github.com/Eldergenix/FireClaw)
- **License:** Apache-2.0

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** yes
- **Shell / process execution:** yes
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-eldergenix-fireclaw
- Seller: https://agentstack.voostack.com/s/eldergenix
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
