javier-cabezas

Achainsaw — AI skill for Claude Code

AI community

A compiler for the code AI agents write: a flat SSA language with JSON diagnostics, compiled in under a millisecond to sandboxed native code, as MCP tools.

How to install Achainsaw

This entry records only its repository, not the path inside it, so there is no exact command to give. Open javier-cabezas/achainsaw and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Achainsaw does

A compiler for the code AI agents write: a flat SSA language with JSON diagnostics, compiled in under a millisecond to sandboxed native code, as MCP tools. Its Llama 3.2 1B prefills 1.7-2.4x faster than llama.cpp.

Alternatives in AI

  • AIHawk — Open-source AI browser agent: describe any task in plain language and it autonomously browses, clicks, types a 30.3k ★
  • Repomix — 📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file 22.7k ★
  • Llmwiki — Open Source Implementation of Karpathy's LLM Wiki 1.5k ★

README

achainsaw

[![CI](https://github.com/javier-cabezas/achainsaw/actions/workflows/ci.yml/badge.svg)](https://github.com/javier-cabezas/achainsaw/actions/workflows/ci.yml) [![MCP server](https://img.shields.io/badge/MCP-server-blueviolet)](docs/mcp.md) [![Llama 3.2 1B prefill](https://img.shields.io/badge/Llama%203.2%201B%20prefill-1.7--2.4x%20llama.cpp-brightgreen)](docs/llama.md) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)

**A compiler for the code AI agents write.** Agents write AIR, a small, flat SSA language. achainsaw checks it, answers mistakes with JSON that names the fix, and compiles it in under a millisecond to native code for x86-64 and AArch64. Claude Code and other MCP clients get it as tools, and run the code in a sandbox.

$ achainsaw run examples/agent/sum_squares.air --func sum_squares --args 1000000
{
  "backend": "cranelift",
  "compile_time_us": 627,
  "exec_time_us": 500,
  "function": "sum_squares",
  "parse_time_us": 61,
  "result": 333332833333500000,
  "status": "ok",
  "threads": 16,
  "total_time_ms": 1.273
}
  • Made for models to write: one operation per line, no nesting, and values that change around loops passed as block parameters. Errors are JSON with an ERR_* code, the source span, and what it takes to fix them, such as the registers in scope.
  • Safe to run what a model wrote: through MCP, every load and store is checked against the sandbox's memory, runaway loops run out of fuel, and deep recursion hits a stack limit. Each is an error code, never a crash.
  • Compiles in under a millisecond on Cranelift, the default backend. The optional LLVM backend takes a few milliseconds and uses the CPU's full vector width.
  • Fast code: vectors that take the CPU's width (SSE to AVX-512, NEON, SVE), int8 dot products (VNNI, sdot), matrix engines (AMX, SME), and par loops on every core. A whole Llama 3.2 1B forward pass is one AIR file, which prefills 1.7–2