shipwithmuse

№ 0191Skill

shunt-muse: offload big file reads to Muse Spark

A fork of Spotify's shunt plugin for Claude Code and Codex whose hooks block full reads of large files and route them to Muse Spark via muse exec; the author measured about 4,800 tokens out and 300 back on a 617-line file.

shunt-muse: offload big file reads to Muse Spark on github.com
alexanderradahl/shunt-museREADME ↗
# shunt-muse

Keep big files out of your coding agent's context. When Claude Code or Codex tries to read a large file in full, a hook stops it and points it at a skill that hands the files to a cheaper model (Muse Spark via `muse exec`). Only the short answer comes back into the session.

This is a fork of Spotify's [shunt](https://github.com/spotify/portal-ai-plugins/tree/main/plugins/shunt). The original delegates to AiKA modes on a Spotify Portal instance. If you don't have Portal, this version does the same thing with the Muse CLI you already have installed.

## What it does

- **Hooks** (`PreToolUse`) block a full `Read`, or a bare `cat`/`head`/`tail`/`less`/`more`, of any file over 350 lines. Reads with an offset or limit, piped commands and small files go through untouched.
- **`bulk-read`** sends one or more files plus a question to Muse and prints the answer.
- **`code-write`** sends a spec plus a reference file to Muse and writes the generated file (tests, config, stubs).
- **Skills** (`bulk-reader`, `code-writer`) tell the agent when to call the scripts.

Every call is one shot. A follow-up question sends the files again, which costs nothing in your agent's context because they never enter it.

## Numbers

One run on a 617-line test file: about 4,800 tokens went to Muse and roughly 300 came back, in 24 seconds at `low` effort. At the default `high`, a 1,055-line file took about 20 seconds and every cited line number was exact (`xhigh` gave the same answer in about 32 seconds). Spotify reports 82-94% savings with the original plugin on a 162K-line Java monorepo; I haven't reproduced that here.

## Requirements

- Muse Code (`muse`) with `muse exec` working headless
- `jq` and `perl` (both ship with macOS)
- Claude Code with plugin support, and/or Codex CLI with hooks enabled

## Install in Claude Code

```sh
claude plugin marketplace add alexanderradahl/shunt-muse
claude plugin install shunt-muse@muse-shunt
```

Start a new session. The skills show up as `shunt-muse:bulk-reader` and `shunt-muse:code-writer`.

## Install in Codex

Clone the repo somewhere stable, then add the Bash hook to `~/.codex/hooks.json`:

```json
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash|shell|exec_command|local_shell",
        "hooks": [
          { "type": "command", "command": "/path/to/shunt-muse/plugins/shunt-muse/hooks/check-bash-read", "timeou

Also filed under Coding & dev tools

See all →
  1. 0561

    Muse-Desktop★

    A desktop app for Muse Code on macOS and Windows with projects, git worktrees, subagents, MCP, a diff review panel and opt-in computer use that lets the agent see the screen and use apps.

    @EtienneLescot

    GitHub

    Coding & dev tools

  2. 0547

    MuseGlass★

    A hands-free interface that turns Meta AI glasses into a voice control surface for Muse Code on a Mac: assign a task, walk away, hear progress, interrupt and approve sensitive steps.

    @MoheetBrain

    GitHub

    Coding & dev tools

  3. 0150

    Helicon: desktop app for Muse Code★

    I pay for @Muse Code but didn't want to live in a terminal. On Windows it's WSL-only. So I built Helicon: an open-source desktop app for the actual Muse CLI. • uses your existing muse login, no API key • talks to muse serve over MSP, so Muse stays the agent • resumes

    @harjjotsinghh

    X post

    Coding & dev tools

  4. 0128

    Helicon desktop app for Muse Code★

    Helicon is an open-source desktop and web app that wraps Meta's Muse Code CLI in a Codex/Claude-style interface, grouping sessions by project with history, resume and diffs on Windows, macOS and WSL2.

    @HarjjotSinghh

    GitHub

    Coding & dev tools

More Skills

See all →
  1. 1073

    Xahau skill for Muse

    Lets a Muse send XAH, manage trustlines, mint URITokens, claim the monthly reward and check out on xMerch stores, where the skill only proposes and the owner approves every transaction in the Xaman app on their phone.

    @terramike

    Skill

    Business & commerce

  2. 1072

    Review Times MCP server and skill

    An MCP server and skill that reports live review times for AI app, connector and plugin stores, including Meta Muse, so builders can see how long a connector submission is taking.

    @stevysmith

    Skill

    Connectors & MCP

  3. 1068

    musebook: shared family boards for Muses

    An open protocol plus Muse skill and Cloudflare Workers reference server that lets each family member's Muse join shared boards (groceries, trips, household lists) with per-board identities and an approval card before anything is ordered.

    @amanbthakkar

    Skill

    Errands & personal agent

  4. 1062

    xrpl-muse-skill: let your Muse trade XRP

    A terminal skill for trading any XRP Ledger token pair and minting NFTs, with a hard boundary between proposing and signing; testnet by default, and mainnet needs the Muse vault signer or a protected signer with per-transaction approval.

    @terramike

    Skill

    Business & commerce

Curator picks

  1. 1046

    Medical bills audited line by line, $4,000 saved★

    Got Muse logged in to my medical provider’s portal, he pulled the itemized bills, and questioned every line. So far he’s found several times I’d been double billed, asked for some discounts and has saved me over $4,000. If your moat is bureaucracy, you’re cooked.

    @Ryan_Holdaway

    X post

    Errands & personal agent

  2. 1013

    Shop Pay agentic checkout on every Shopify store★

    We are excited to announce we are partnering deeply with Muse to enable agentic checkout with Shop Pay on all Shopify stores, offering people an easy and delightful way to shop and check out with Muse.

    @tobi

    X post

    Business & commerce

  3. 1009

    Private e-book library app from Google Drive★

    Muse built me a private library for the e-books and articles in my Google Drive. Everything is organized by topic, and each section opens onto its own subcategorized shelves. Each book opens like a real book and is readable in-app

    @chiasmus_cap

    X post

    Apps & websites

  4. 1007

    Plumbing company run by a Muse agent★

    I still can’t believe I can run my plumbing company with an agent so easily. I send this message to my Muse agent while in bed at 6am. And it: updates my job board, texts customer, updates office manager who arrives at 8am in slack Notifies technician

    @HouseHackerJon

    X post

    Agents & automation