--- title: Muse Code description: How ClawMetry observes Muse Code — where its data lives, the environment variables that move it, what cost data is real, and the traps in its store. eyebrow: Runtime reference --- # Muse Code Muse Code is Meta's terminal coding agent on Muse Spark. It is the first runtime ClawMetry reads over a protocol rather than a file format: the adapter starts `muse serve` and asks Muse's own session protocol (MSP) for sessions, so nothing about the log layout is guessed. This is Muse Code, not the consumer Muse app, which runs only in Meta's cloud and cannot be observed. | | | |---|---| | **Runtime id** | `muse_code` | | **Category** | Terminal coding agent | | **Vendor** | Meta | | **Tier** | Paid tier (Starter and up) | | **Upstream** | [developer.meta.com/ai/products/muse-code](https://developer.meta.com/ai/products/muse-code) | ## Where the data comes from ClawMetry reads these locations, in order, and never writes to any of them. - `$XDG_DATA_HOME/muse (default ~/.local/share/muse)` — session-index.db plus sessions/YYYY/MM/DD//session.jsonl, read through MSP - `~/.config/muse` — settings.json and auth.json only, never session data **Format.** Read over MSP (newline-delimited JSON-RPC 2.0) using only its read-only calls: session/list, session/read and view/page. They take no lease, so your own Muse keeps running. The adapter requests no capabilities. ## Environment variables | Variable | Effect | |---|---| | `XDG_DATA_HOME` | Moves Muse's data home; the only lever the muse binary honours | | `CLAWMETRY_MUSE_HOME` | ClawMetry-side override for the data home | | `CLAWMETRY_MUSE_CONFIG_DIR` | ClawMetry-side override for the config dir | | `CLAWMETRY_MUSE_BIN` | Path to the muse binary when it is not on the daemon's PATH | See [Environment variables](/docs/config/environment/) for the variables that apply to every runtime. ## Tokens and cost **Tokens.** Muse's own counted-once session totals from session/tokenUsage events: input, output, cache reads and reasoning tokens, tagged with the model. **Cost.** Derived from Meta's published Muse Spark rates. Cached input is inside the input count and is priced at the cached rate, and the standard and contributor tiers are priced separately. :::note Why this section exists Runtimes differ enormously in what they persist. Rather than showing a plausible number everywhere, ClawMetry reports what the store actually contains and marks the rest unknown. A cost of `$0.00` and a cost of *unknown* mean different things, and the dashboard keeps them different. ::: ## Sub-agents and delegation Sub-agents and compaction events appear in the transcript, along with fork lineage when a session is branched. ## Things worth knowing - The data home is XDG even on macOS (`~/.local/share/muse`, not `~/Library/Application Support`). `MUSE_HOME` changes nothing. - A session reported `notLoaded` has not ended; it is only not loaded by ClawMetry's own `muse serve`. - An ephemeral-profile session has no durable log, so it has no transcript. - Pause, Stop and Kill are not offered yet: MSP reports no process id, so ClawMetry cannot tie a session to a process it could signal. ## Verify it is being read ```bash # Is this runtime detected, and would this install unlock it? clawmetry runtimes --json | jq '.runtimes[] | select(.id=="muse_code")' # Why is it locked, if it is? clawmetry runtimes --why muse_code # Any sessions ingested yet? curl -s 'http://localhost:8900/api/local/sessions?limit=5' \ | jq '.rows[] | {session_id, agent_id, events, cost_usd}' ``` If detection succeeds but no sessions appear, work through [Troubleshooting](/docs/ops/troubleshooting/) — the usual causes are a relocated data directory (set the override above), a session limit that is hiding older runs, or a runtime that simply has not written anything yet.