wanyi-watermark: Instructions file for Claude Code

CLAUDE.md

wanyi-watermark CLAUDE.md is an instructions file for Claude Code from Wanyi424/wanyi-watermark. It costs 2,802 tokens per session, scanned A, original, Apache-2.0.

Project instructions for a server that retrieves videos, images, and text from Douyin and Xiaohongshu share links. It describes separate platform handlers, automatic video-or-image detection, and shared parsing for the command line, web interface, and MCP tools.

In plain words
What is it for?
Use it when modifying link parsing, media extraction, speech-to-text, diagnostics, or the resolver shared by the server's different interfaces.
Why use it?
It gives an agent the project's architecture and shared rules so changes use the existing parsing flow instead of duplicating platform logic.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is Wanyi424/wanyi-watermark's own configuration. It tells Claude Code how to work on wanyi-watermark 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 wanyi-watermark configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Wanyi424/wanyi-watermark. 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/Wanyi424/wanyi-watermark/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/Wanyi424/wanyi-watermark

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 wanyi-watermark CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/wanyi424/wanyi-watermark/claude-md/github.svg)](https://agentmods.dev/instructions/wanyi424/wanyi-watermark/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/wanyi424/wanyi-watermark/claude-md"><img src="https://agentmods.dev/badge/instructions/wanyi424/wanyi-watermark/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 wanyi-watermark CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/wanyi424/wanyi-watermark/claude-md"><img src="https://agentmods.dev/badge/instructions/wanyi424/wanyi-watermark/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,802 This file is loaded in full into every session.
When invoked 2,802 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.02802 $0.02802
Opus 5 $0.01401 $0.01401
Sonnet 5 $0.00560 $0.00560
Haiku 4.5 $0.00280 $0.00280

Measured 10d ago against content hash e1b84865ee28, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

wanyi-watermark 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.

CLAUDE.md · 202 lines

How it starts

The opening of the file, as written. The whole thing — 202 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.

项目概述

这是一个基于 Model Context Protocol (MCP) 的服务器,用于从抖音和小红书分享链接中获取无水印视频并提取文本内容。

核心架构

1. 处理器模式 (Processor Pattern)

项目采用处理器模式,每个平台有独立的处理器类:

  • DouyinProcessor (douyin_processor.py): 处理抖音视频/图文

    • parse_media 一次抓取页面后读取 window._ROUTER_DATA,自动判断视频或图文
    • 视频提取无水印 URL;图文提取图片列表
    • 使用阿里云百炼 API (dashscope) 进行语音识别
    • 直接从视频 URL 进行转录(无需下载)
  • XiaohongshuProcessor (xiaohongshu_processor.py): 处理小红书视频/图文

    • parse_media 一次抓取页面后解析最终 URL、window.__INITIAL_STATE__、视频流和图片列表
    • 依据页面数据结构自动判断 video / image,避免"视频失败后再图文"的重复请求
    • 视频直链优先使用页面提供的 og:video / masterUrl;不再进行旧版 114 质量码改写或阻塞式 HEAD 探测
  • 诊断日志 (diagnostics.py): 解析链路中文耗时日志

    • WebUI 传入 X-Parse-Trace-Id,后端同一请求链路复用同一追踪 ID
    • parse_log 输出单步耗时和累计耗时,用于定位页面请求、JSON 解析、候选筛选等卡点

1.5 解析门面 (resolver.py) —— 单一事实源

"按平台分发 + 自动识别 视频/图文 + 通用兜底" 的编排逻辑统一收敛在 resolver.py, 由 MCP 工具 / CLI / WebUI / Skill 四个消费方共同复用

  • resolve_douyin / resolve_xiaohongshu / resolve_generic:返回结构化 dict(与各 MCP 工具输出逐字一致)
  • resolve_media:顶层入口,按链接域名自动选平台(供 CLI/WebUI/Skill 的"单输入框"使用)
  • detect_platform:按域名判定 douyin / xiaohongshu / generic

server.py 的工具均为薄包装:json.dumps(resolve_*(...))。 转写逻辑统一在 transcription.pytranscribe_video_url,dashscope)。

处理器在 resolver 内部延迟导入,保持 import resolver 轻量(不强依赖 dashscope/ffmpeg)。

2. MCP 服务器 (server.py)

使用 FastMCP 框架提供统一的 MCP 接口:

工具 (Tools):

  • parse_douyin_link: 解析抖音链接,自动识别视频/图文并返回无水印资源(无需 API 密钥)
  • parse_xhs_link: 解析小红书链接,自动识别视频/图文并返回无水印资源(无需 API 密钥)
  • extract_douyin_text: 从抖音视频中提取文本内容(需要 API 密钥)

资源接口已在当前版本移除,统一通过上述工具完成解析。

提示词 (Prompts):

  • watermark_removal_guide: 使用指南(含面向用户的纯文本展示格式约定)

输出格式约定(重要,勿改):

  • 所有解析工具(parse_xhs_link / parse_douyin_link / parse_generic_link)一律返回【完整 JSON 字符串】(含 platform/type/title/caption/url/images 等全部字段),不在工具内部拍平成纯文本
  • “纯文本(标题/文案/视频图片链接,禁止 Markdown、不省略不截断)”是 LLM 回复最终用户时的展示格式,由各工具 docstring 与 watermark_removal_guide 提示词指示 LLM 完成,不是工具的返回值格式
  • 数据流:工具 ──返回完整 JSON──▶ LLM ──整理成纯文本──▶ 用户。
  • 注:曾把工具返回值直接改成纯文本(_format_plain_result)会丢失结构化字段、且与报错 JSON 不一致,已回退,后续请保持 JSON 返回。

Read the full file on GitHub · 202 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. 10d ago First seen · 202 lines · 2,802 tokens per session scan A e1b84865ee28

Subscribe to this mod's changes

wanyi-watermark CLAUDE.md is an instructions file published in the GitHub repository Wanyi424/wanyi-watermark (23 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 2,802 tokens to every session, about $0.0140 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.

Related

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.

vercel/next.js · 7,296 tokens

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.

openai/codex · 5,153 tokens

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).

microsoft/vscode · 6,785 tokens

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.

github/spec-kit · 7,104 tokens

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).

microsoft/vscode · 5,001 tokens

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.

langchain-ai/langchain · 4,469 tokens