xhs

xhs is a skill for Claude Code from DuckWu/xhs-claude-skills. It costs 25 tokens per session (2,728 once invoked), scanned B, original, MIT.

A tool for extracting text, images, and video transcripts from Xiaohongshu posts and saving them as Markdown notes in an Obsidian vault. Obsidian is a note-taking app that stores notes as plain-text Markdown files.

In plain words
What is it for?
Use it with a Xiaohongshu post link to download its content, transcribe video, and save the result. It requires exported browser cookies for a logged-in account and uses different Whisper speech-to-text models depending on the operating system.
Why use it?
It avoids copying post content by hand and keeps the extracted material in a searchable local notes collection.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths.

Part of the rednote-to-obsidian plugin — 5 skills shipped together

Good fit Use it with a Xiaohongshu post link to download its content, transcribe video, and save the result. It requires exported browser cookies for a logged-in account and uses different Whisper speech-to-text models depending on the operating system.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/duckwu/xhs-claude-skills/xhs
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.

Any agent
npx skills add DuckWu/xhs-claude-skills --skill xhs
Clone the repo
git clone --depth 1 https://github.com/DuckWu/xhs-claude-skills

Made for: Claude Code.

Or install rednote-to-obsidian, the plugin that ships this one along with the rest of its 5 skills.

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 xhs

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/duckwu/xhs-claude-skills/xhs"><img src="https://agentmods.dev/badge/skills/duckwu/xhs-claude-skills/xhs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,728 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 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.00025 $0.02728
Opus 5 $0.00013 $0.01364
Sonnet 5 $0.00005 $0.00546
Haiku 4.5 $0.00003 $0.00273

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

Security

Grade B, and why

xhs scanned grade B with 2 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 12d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- Linux: `sudo apt install ffmpeg`

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

import json, urllib.request, ssl, re
skills/xhs/SKILL.md · 240 lines

How it starts

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

用户希望提取小红书帖子内容。请按以下步骤处理:

常量定义

  • Cookies 文件: ~/cookies.json(从 Chrome 导出的小红书 cookies)
  • Obsidian 保存目录: ~/Documents/Obsidian Vault/xhs
    • 若路径不存在,自动检测 Obsidian vault 位置(搜索 ~/Documents/Obsidian~/Documents/Obsidian Vault 等常见路径)
    • Windows 用户常见路径: ~/Documents/Obsidian/ 或自定义位置,请按实际情况修改
  • Whisper 模型:
    • macOS: mlx-community/whisper-large-v3-turbo(使用 mlx-whisper)
    • Windows/Linux: large-v3(使用 openai-whisper)

输入

用户提供的小红书链接: $ARGUMENTS

提取流程

步骤 0:检查 Cookies

  1. 检查 ~/cookies.json 是否存在
  2. 如果不存在,告知用户需要从 Chrome 导出 cookies:
    • 在 Chrome 打开 xiaohongshu.com 并确认已登录
    • 打开 DevTools Console,运行以下代码将 cookies 复制到剪贴板:
    copy(JSON.stringify(document.cookie.split('; ').map(c => {
      const [name, ...rest] = c.split('=');
      return { name, value: rest.join('='), domain: '.xiaohongshu.com', path: '/',
        expires: Date.now()/1000 + 86400*30, size: name.length + rest.join('=').length,
        httpOnly: false, secure: false, session: false, priority: 'Medium',
        sameParty: false, sourceScheme: 'Secure', sourcePort: 443 };
    })))
    
    • 将剪贴板内容保存到 ~/cookies.json
    • 然后终止流程,等用户完成后重新运行

步骤 1:解析链接

从 URL 中提取帖子 ID(24 位十六进制字符串)和 xsec_token 参数。

步骤 2:获取帖子内容

使用 Python 脚本,通过 Cookies 请求帖子页面 HTML,从 window.__INITIAL_STATE__ 解析全部帖子数据:

import json, urllib.request, ssl, re

with open('<Cookies 文件>') as f:
    cookies = json.load(f)
cookie_str = '; '.join(f"{c['name']}={c['value']}" for c in cookies)

ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

req = urllib.request.Request('<帖子URL>')
req.add_header('Cookie', cookie_str)
req.add_header('User-Agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36')

resp = urllib.request.urlopen(req, timeout=15, context=ctx)
html = resp.read().decode('utf-8', errors='ignore')

m = re.search(r'window\.__INITIAL_STATE__\s*=\s*(\{.+?\})\s*</script>', html, re.DOTALL)
raw = m.group(1).replace('undefined', 'null')
data = json.loads(raw)

# 帖子数据在: data['note']['noteDetailMap'][<key>]['note']
# 包含: title, desc, type, time, user, imageList, video, interactInfo, ipLocation

Read the full file on GitHub · 240 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. 12d ago First seen · 240 lines · 25 tokens per session scan B b1479c2c88e7

Subscribe to this mod's changes

xhs is a skill published in the GitHub repository DuckWu/xhs-claude-skills (5 stars, last pushed 3mo ago), licensed MIT. It adds 25 tokens to every session and 2,728 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). 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

baoyu-youtube-transcript

A tool for downloading the written captions, subtitles, chapter information, speaker labels, and cover image from a YouTube video using its URL or ID.

JimLiu/baoyu-skills · 107 tokens

orbit-notion

Open Orbit briefing skill — selected by the Orbit pipeline when Notion is the user's only connected connector, or when the user explicitly scopes their daily digest to Notion. Pulls the past 24 hours of document edits, comments, mentions, and database row changes from the user's authenticated Notion connection and…

nexu-io/open-design · 117 tokens

instrument-data-to-allotrope

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…

anthropics/knowledge-work-plugins · 123 tokens

feishu

Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.

Hmbown/CodeWhale · 33 tokens

read

Reads URLs and PDFs by fetching source content, defaulting to concise summaries for plain read requests and clean Markdown when asked to convert, save, quote, cite, or feed downstream work. Use when users ask in any language to read, fetch, check, summarize, quote, cite, convert, or save a URL or PDF. Not for local…

tw93/Waza · 78 tokens

overleaf-sync

A two-way connection between a local paper folder and Overleaf, a web-based LaTeX editor for writing research papers. It lets you move changes between the local files and the shared Overleaf project.

wanshuiyin/Auto-claude-code-research-in-sleep · 97 tokens