Borrowing it
Nothing to install: this file belongs to tiancheng91/lxmusic. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/tiancheng91/lxmusic/main/CLAUDE.mdgit clone --depth 1 https://github.com/tiancheng91/lxmusicWrote 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.
[](https://agentmods.dev/instructions/tiancheng91/lxmusic/claude-md)<a href="https://agentmods.dev/instructions/tiancheng91/lxmusic/claude-md"><img src="https://agentmods.dev/badge/instructions/tiancheng91/lxmusic/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.
<a href="https://agentmods.dev/instructions/tiancheng91/lxmusic/claude-md"><img src="https://agentmods.dev/badge/instructions/tiancheng91/lxmusic/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01516 | $0.01516 |
| Opus 5 | $0.00758 | $0.00758 |
| Sonnet 5 | $0.00303 | $0.00303 |
| Haiku 4.5 | $0.00152 | $0.00152 |
Grade A, and why
lxmusic 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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 144 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.
常用命令
# 安装依赖
uv sync
# 运行测试
uv run pytest tests/ -v
# 运行单个测试
uv run pytest tests/test_tx_music.py::TestPlaylistStore::test_create_and_get -v
# 构建
uv build
# 本地安装(开发模式)
uv tool install .
# 运行 CLI
uv run lxmusic --help
uv run lxmusic search music "周杰伦"
uv run lxmusic mcp # 标准 MCP server
架构
lxmusic/ 包采用三层组合架构:
1. Source 层(搜索与元信息)
lxmusic/sources/__init__.py 定义 Source(ABC) 抽象基类,要求实现:
search_music / search_album / get_music_info / get_album_info / get_lyric / get_audio_headers / close。
三个实现:
tx.py— QQ 音乐(通过musicu.fcg接口)wy.py— 网易云音乐local.py— 本地音乐文件 + 歌单 YAML 扫描
LocalSource 特殊性:
- 扫描
cfg.local_dirs(由music_dir拆分而来,逗号分隔多目录) - 同时扫描
*.yaml文件,解析{name, tracks}结构为歌单 search_album按 YAML 中name字段匹配歌单名get_album_info按album_mid(歌单名)查找对应 YAML 返回曲目- 文件 ID 使用 MD5 哈希(确定性,跨进程稳定),不能用
hash()(有随机种子) get_music_info支持songmid(文件路径)和song_id(哈希)两种查找
2. PlayURLProvider 层(播放直链)
lxmusic/playurl.py 定义 PlayURLProvider(ABC),实现 ShiqianjiangProvider:
- 调用
https://source.shiqianjiang.cn/api/music/url - 需要 API 密钥(从
cfg.api_key获取)
3. MusicClient 组合层
lxmusic/client.py 中 MusicClient 组合 Source + PlayURLProvider:
_get_source(name)懒加载并缓存 Source 实例(LocalSource接收cfg.local_dirs)get_play_url(song, quality)对本地源直接返回song.songmid(即文件路径),远程源走 PlayURLProvider- 通过
source参数覆盖默认音源
CLI 与 MCP
入口分发
lxmusic/main.py 根据 sys.argv[1] 分发:
mcp→ 标准 MCP server(FastMCP,stdio)- 其他 → CLI 命令组(click)
CLI 命令组(cli.py)
search / play / download / album / playlist / config
关键实现细节:
_resolve_play_url(client, song, quality)— 请求音质不可用时自动降级到 128kplaylist add支持--limit(默认 20)自动翻页拉取搜索结果album下载时若 URL 是本地路径用shutil.copy2,否则走_download_file- 下载进度条通过
_progress_bar回调显示
配置系统
lxmusic/config.py 采用两层优先级:环境变量 > config.yaml > 默认值
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.
- 10d ago First seen · 144 lines · 1,516 tokens per session scan A e0c22a901165
lxmusic CLAUDE.md is an instructions file published in the GitHub repository tiancheng91/lxmusic (2 stars, last pushed 27d ago), licensed MIT. It adds 1,516 tokens to every session, about $0.0076 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.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.