spotify-cli-macos: Instructions file for Claude Code

CLAUDE.md

spotify-cli-macos CLAUDE.md is an instructions file for Claude Code 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; positional $N argument; mentions Claude Code.

This is pwittchen/spotify-cli-macos's own configuration. It tells Claude Code how to work on spotify-cli-macos itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything spotify-cli-macos configures →

Reuse

Borrowing it

Nothing to install: this file belongs to pwittchen/spotify-cli-macos. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/pwittchen/spotify-cli-macos/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/pwittchen/spotify-cli-macos

Made for: Claude Code.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for spotify-cli-macos CLAUDE.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00582 $0.00582
Opus 5.5 $0.00233 $0.00233
Sonnet 5.5 $0.00116 $0.00116
Haiku 4.5 $0.00058 $0.00058

Measured 2mo ago against content hash cdde9ad82a36, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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. 2mo 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 (26 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 582 tokens to every session, about $0.0023 per session on Opus 5.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.

Related

spotify-cli-macos CLAUDE.md compared with instructions from other repositories

spotify-cli-macos CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
spotify-cli-macos CLAUDE.mdpwittchen/spotify-cli-macosInstructions file266mo agoApache-2.0A582Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot