music

music is a skill for Claude Code, Codex from anthonymaley/MusicTUI. It costs 408 tokens per session (5,525 once invoked), scanned A, original, MIT.

A terminal controller for Apple Music. It can search music, play tracks, manage playlists and radio, and route playback to speakers or AirPods.

In plain words
What is it for?
It helps play and search songs, adjust playback, use shuffle and volume, choose speakers, browse listening history and the library, and manage favourites.
Why use it?
It lets you control Apple Music from commands or scripts without switching to the music app for each action.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the music plugin — 1 skill shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/anthonymaley/musictui/music
Any agent
npx skills add anthonymaley/MusicTUI --skill music
Clone the repo
git clone --depth 1 https://github.com/anthonymaley/MusicTUI

Made for: Claude Code, Codex.

Or install music, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for music

README.md
[![agentmods](https://agentmods.dev/badge/skills/anthonymaley/musictui/music.svg)](https://agentmods.dev/skills/anthonymaley/musictui/music)
Your own site
<a href="https://agentmods.dev/skills/anthonymaley/musictui/music"><img src="https://agentmods.dev/badge/skills/anthonymaley/musictui/music.svg" alt="Measured on agentmods" height="20"></a>
Per session 408 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,525 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00408 $0.05525
Opus 5 $0.00204 $0.02763
Sonnet 5 $0.00082 $0.01105
Haiku 4.5 $0.00041 $0.00553

Measured today against content hash 5b4696dbd9ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

music scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/music/SKILL.md · 335 lines

How it starts

The opening of the file, as written. The whole thing — 335 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Apple Music Controller

Control Apple Music from the terminal via the music CLI. All commands run as bash; use music for structured operations, with --json for machine-readable output.

If the CLI is not installed

If command -v music fails, do NOT improvise AppleScript fallbacks. Tell the user the CLI needs a one-time build and point them at the install script, then retry after they run it:

bash "${CLAUDE_PLUGIN_ROOT}/scripts/install.sh"   # from the plugin
# or, in the repo: scripts/install.sh

Fast path: play requests

For any request shaped like "play X [on/in speakers] [at volume%] [shuffle]", forward the user's words to music play in ONE bash call: strip only the leading "play" and any % sign. The CLI's parser deterministically extracts speaker names (including several at once), volume, filler words ("in", "the", "and", "at", "on"), and a trailing "shuffle":

music play kid a in the kitchen and living room at 60
music play jazz for cooking kitchen 40 shuffle

Naming speakers routes playback to exactly those speakers (it deselects the rest). Don't pre-chain music speaker + music volume for simple play requests: music play does all three. If the query itself contains a speaker-like word, use the explicit flags (--song, --album, --playlist) instead. Named-speaker plays are verified automatically once playback starts (✓ <speaker> verified (…)); an unestablished route triggers an automatic heal before an honest failure message.

Architecture

The music CLI has two backends:

  • AppleScript: playback, speakers, volume, now playing, library browsing (no auth needed)
  • REST API: catalog search, library writes, playlists via API, discovery (needs auth)

Playback (no auth)

music play                                    # resume (shows now playing + speakers)
music play "Working Vibes"                    # play a playlist by name
music play "Working Vibes" shuffle            # play with shuffle
music play 3                                  # play result #3 from last search
music play "Working Vibes" kitchen 20         # play on Kitchen speaker (only) at vol 20
music play "Working Vibes" kitchen 20 shuffle # routed + shuffled
music play kid a in the kitchen and living room at 60  # multi-room: filler words OK, group volume
music play deck and pool                      # resume on Deck + Pool (exactly those)
music play "Gypsy Woman" "Tom Misch"          # song + artist; catalog fallback if authenticated
music play "https://music.apple.com/...?...i=1581424482" # catalog song URL; quote it in zsh
music play --playlist "Working Vibes"         # explicit playlist flag
music play "Gypsy Woman (Quarantine Sessions)" # play matching local Library album/song
music play --album "Kid A" --artist "Radiohead" # explicit local Library album + artist; also `music play "X"` when X resolves to an album
                                                # creates temp playlist, bounded only when Autoplay off; see TUI Autoplay note
                                                # if the name matches more than one distinct album, nothing plays; add --artist or a more specific name
music play --song "Get It Done" --artist "Fouk"  # search library + play
music play --verbose                          # diagnostic output on stderr
music pause
music skip                                    # next track
music back                                    # previous track
music stop
music now                                     # what's playing + speakers
music now --json                              # structured: track, artist, album, speakers, state
music seek +30|-30|90|1:30                    # seek within the current track
music shuffle                                 # toggle (or: music shuffle on|off)
music repeat off|one|all
music love                                    # favorite the current track
music unlove                                  # unfavorite

Read the full file on GitHub · 335 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +3 lines 5b4696dbd9ab
  2. yesterday Changed 8a63038e3e0f
  3. yesterday Changed · +2 lines cb7b93b91d5b
  4. 5d ago First seen · 330 lines · 408 tokens per session scan A e31d7fe0f7d0

Subscribe to this mod's changes

music is a skill published in the GitHub repository anthonymaley/MusicTUI (9 stars, last pushed today), licensed MIT. It adds 408 tokens to every session and 5,525 once invoked, about $0.0020 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

apple-notes

Use this skill when the user wants to interact with Apple Notes on macOS - creating, searching, reading, updating, deleting, organizing, or formatting notes and folders. This skill provides access to Apple Notes through MCP tools and includes safe formatting guidance.

sweetrb/apple-notes-mcp · 54 tokens

applescript-mail

Use when writing, modifying, or debugging ANY AppleScript that interacts with Apple Mail. Also use when encountering AppleScript errors, unexpected Mail.app behavior, when adding new connector methods, or when debugging JSON output from ASObjC. Covers string escaping, attachment handling, Gmail compatibility, message…

s-morgan-jeffries/apple-mail-fast-mcp · 79 tokens

apple-mail

Use this skill when the user wants to manage Apple Mail on macOS - reading, searching, sending, replying to, forwarding, and organizing emails and mailboxes. This skill provides access to Apple Mail through MCP tools.

sweetrb/apple-mail-mcp · 47 tokens

performance-patterns

Use when optimizing Apple Mail MCP operations, diagnosing slow queries, adding new filtering logic, or modifying how data is fetched from Mail.app. Covers osascript overhead, whose clause optimization, batch operation patterns, and known operation timings.

s-morgan-jeffries/apple-mail-fast-mcp · 50 tokens

integration-testing

Use when setting up, running, or debugging integration tests against real Apple Mail. Also use when unit tests pass but behavior seems wrong, when adding new AppleScript operations, or when you need to understand why mocked tests are insufficient for this project.

s-morgan-jeffries/apple-mail-fast-mcp · 52 tokens

api-design

Use BEFORE adding any new tool, parameter, or endpoint to the Apple Mail MCP server. Also use when considering API changes, evaluating feature requests, or when tempted to create a specialized operation. Contains the decision tree that prevents tool sprawl and the anti-pattern catalog.

s-morgan-jeffries/apple-mail-fast-mcp · 56 tokens