spotify-cli-macos CLAUDE.md

spotify-cli-macos CLAUDE.md is an instructions file for coding agents from pwittchen/spotify-cli-macos. It costs 582 tokens per session, scanned A, original, Apache-2.0.

Instructions for a macOS command-line tool that controls the Spotify desktop app through Bash and AppleScript. The file documents its commands, installation, architecture, and MCP server integration.

In plain words
What is it for?
Use it when editing, installing, uninstalling, or extending the Spotify command-line tool or its MCP server on macOS.
Why use it?
It explains the tool's limited setup and flat command structure, reducing the risk of using unsupported dependencies or forgetting to reinstall changes.

Instructions file

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 instructions/pwittchen/spotify-cli-macos/claude-md
Clone the repo
git clone --depth 1 https://github.com/pwittchen/spotify-cli-macos

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 spotify-cli-macos CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/pwittchen/spotify-cli-macos/claude-md.svg)](https://agentmods.dev/instructions/pwittchen/spotify-cli-macos/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/pwittchen/spotify-cli-macos/claude-md"><img src="https://agentmods.dev/badge/instructions/pwittchen/spotify-cli-macos/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 582 This file is loaded in full into every session.
When invoked 582 The same file — it is already loaded in full.
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.00582 $0.00582
Opus 5 $0.00291 $0.00291
Sonnet 5 $0.00116 $0.00116
Haiku 4.5 $0.00058 $0.00058

Measured 4d ago against content hash cdde9ad82a36, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spotify-cli-macos CLAUDE.md 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 4d ago.

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.

CLAUDE.md · 35 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What this is

A single-file Bash CLI (spotifycli.sh) that controls the Spotify desktop app on macOS by shelling out to osascript. There is no build system, no test suite, no linter, and no dependencies beyond a stock macOS install with the Spotify desktop app.

Commands

  • make install — copies spotifycli.sh to /usr/local/bin/spotifycli (uses sudo).
  • make uninstall — removes /usr/local/bin/spotifycli (uses sudo; tolerant of missing file).
  • make install-mcp / make uninstall-mcp — install/remove the MCP server at /usr/local/bin/spotifycli-mcp.
  • bash spotifycli.sh <command> — run without installing, e.g. bash spotifycli.sh track.

After editing spotifycli.sh, re-run make install to deploy the new version to PATH.

Architecture

spotifycli.sh is a flat if/elif chain dispatching on $1. Each branch issues a single osascript -e 'tell application "Spotify" to ...' (or "System Events" for status) and exit 0. The trailing else prints the help text.

mcp/spotifycli-mcp.sh is an MCP (Model Context Protocol) server written in Bash. It speaks JSON-RPC 2.0 over stdio, advertises one MCP tool per CLI subcommand, and shells out to spotifycli to execute them. It depends on jq for JSON encoding/decoding (preinstalled on macOS 15+).

When adding a new subcommand, four places must stay in sync:

  1. A new elif branch in spotifycli.sh.
  2. The help block in the else branch of spotifycli.sh.
  3. The "all available commands" list in README.md.
  4. The TOOLS_JSON array in mcp/spotifycli-mcp.sh.

Non-obvious behavior

  • prev calls previous track twice intentionally — Spotify's first previous track only seeks to position 0 of the current track; the second one actually moves to the previous track.
  • status uses tell application "System Events" to check the process list rather than asking Spotify directly, so it works whether or not Spotify is running.
  • Every branch ends with exit 0 rather than falling through, including the help branch — exit 0 is deliberate (commit 0ad95de changed exit to exit 0 for a conventional success code).

Read the full file on GitHub · 35 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. 4d ago First seen · 35 lines · 582 tokens per session scan A cdde9ad82a36

Subscribe to this mod's changes

spotify-cli-macos CLAUDE.md is an instructions file published in the GitHub repository pwittchen/spotify-cli-macos (24 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 582 tokens to every session, about $0.0029 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-30.