Quickstart

Get Muse Code running in minutes.

Muse Code is in beta for macOS and Linux. It takes on complex software engineering tasks across large repositories — planning changes, writing code, and validating the results — entirely from your terminal.

1. Install

One command installs the CLI:

$curl -fsSL https://dev.meta.ai/install.sh | bash

The script drops the muse binary into your PATH — verify with muse --version. Prefer to review the script first? Download it with -o install.sh, audit, then run.

2. Authenticate

Your first run opens the browser to authenticate at dev.meta.ai with your Meta developer account. Credentials cache locally — no re-auth per session. Access and billing run through the Meta Model API.

Non-interactive runs. For CI, scripts, and headless machines, use an API key instead of the browser flow: create one in the Model API dashboard (API keys → Create API key) and set it as MODEL_API_KEY.

3. Run your first task

Once auth is done, you’re free to get started in any of your project directories:

$ cd my-repo$ muse

Describe the outcome you want in plain language. A good first task is small and verifiable — “add a missing test for parseDate and make sure it passes” — you’ll see a worker draft the change, a reviewer critique it, and the test run.

Two cost levers worth knowing from day one: Muse Spark is a reasoning model — it thinks before it answers, and those tokens bill as output — so /effort dials the thinking up or down per task. And your tone, format, and other standing rules can live in a system message so you don’t repeat them in every prompt.

Async background agents

Muse Code operates with a simple agent loop plus a set of async background agents that enhance the main agent’s capability. These specialized agents remain active throughout each session rather than being spawned per task, which avoids redundant information gathering. They carry out next steps on their own and choose when to communicate back to the main agent — their persistence reduces latency and the need for steering on difficult, multi-step tasks.

Agent fan-out & git worktrees

When a job splits into several tasks, they fan out automatically to separate agents: the parent spawns a write-capable child per task, and each child gets its own git worktree — so parallel children never collide on the same files and your working copy stays clean.

Event log

Muse Code uses a local event log to which every model call, tool run, approval, and edit is appended. This single source of truth makes the runtime replay-exact and restart-safe: after a crash, the agent resumes precisely where it stopped, letting it take on long-running tasks without being derailed by failures. Every subagent spawn, steer, and cancel is observable — muse replay walks a session step by step, and full traces export for handoff or audit.

Bundled skills & commands

Muse Code ships with several default skills — put a rough idea in, get a grilled, taste-checked feature out:

/planTurns a task into an approval-gated plan before any code changes
/grillStress-tests that plan until it holds up
/goalWorks toward successful completion of the specified objective — what you originally wanted is what gets merged
/modelSwitches the backing model — e.g. to muse-spark-1.2 at standard Model API pricing
/effortDials reasoning up or down — thinking tokens bill as output, so save deep reasoning for hard tasks
muse replayWalks a session's event log step by step; full traces export for handoff or audit

Muse Spark 1.2

Muse Spark 1.2 is a coding-focused update to Muse Spark 1.1, with improvements in code generation, complex debugging, codebase understanding, and end-to-end developer workflows — training compute on coding tasks was significantly scaled up while expanding environment diversity. Three things set it apart:

Co-trained with Muse Code
Trained with the harness itself — rejection-sampled harness trajectories, recipe optimizations for goals, compaction, and subagents, and integration of the Muse Code toolset — for better tool use, fewer retries, and higher-quality output than a generic wrapper.
Long-horizon
Extensively trained on long-horizon coding: whole-repository generation, large end-to-end projects, and auto-research. It plans to sequence work, uses goal conditioning to maintain direction, and compacts context to sustain progress.
Self-improvement
Muse Spark 1.1 generated challenging coding environments and instruction-following templates, then graded candidate solutions — a scalable training loop that makes 1.2 follow complex instructions more precisely than its predecessor.

Benchmarks (with Muse Code): Terminal-Bench 2.1 · 82.9% — DeepSWE 1.1 · 59.3%. Full methodology in Meta’s evaluation report at research.meta.ai.

Case study: kernel optimization

Meta tested the model’s ability to iteratively optimize GPU kernels over 1,000+ tool calls — up to 24 hours. Inside Muse Code’s agentic environment, the model writes, compiles, profiles, and progressively improves kernel performance against a baseline, benchmarked on KDA and MLA kernels for NVIDIA Hopper GPUs. Barred from wrapping third-party kernel libraries, it implemented the algorithms in Triton directly — and kept finding substantial improvements over the baseline.

Meta Model API

The same models behind Muse Code are available directly — Muse Spark 1.2 ships in Muse Code, the Meta Model API, and OpenRouter, with expanded global access. The API is drop-in compatible with the OpenAI SDK, the Anthropic SDK, and agent CLIs like OpenCode and Claude Code: point your client at the base URL and keep the rest of your code. The context window is 1,048,576 tokens.

# export MODEL_API_KEY="LLM|{numeric_id}|{secret}"client = OpenAI( base_url="https://api.meta.ai/v1", api_key=os.environ["MODEL_API_KEY"], ) response = client.chat.completions.create( model="muse-spark-1.2", messages=[{"role": "user", "content": "Hello, world!"}], )

Cookbook

Recipes that run the first time you copy them — each one solves a focused problem, shows working code, and points to what’s next. Three sections, plus recipes for Muse Code’s core patterns.Browse all 28 recipes →

API fundamentals · 10 recipes
Prove each primitive works: chat completions, streaming, tool calling, structured output, prompt caching, reasoning tokens, vision input, long context, error handling, and search grounding with inline citations.
Agent patterns · 5 recipes
The loops that turn a model into an agent: the perceive-decide-act loop, interleaved reasoning and tool use, multi-turn context management, and validated in-place edits.
Use cases · 13 recipes
End to end: browser-verified web design and game dev, a four-profile multi-agent product studio coordinating through a shared Kanban board, an autonomous GitHub Actions bot on OpenCode, computer use on Linux and macOS, and more.
Muse Code recipes
Agent fan-out — split one big job across subagents in isolated worktrees; bundled skills — a rough idea in, a grilled, taste-checked feature out; goal tracking — keep an agent on task until it merges what you wanted.