xhs

xhs is a skill for Claude Code from chenxiachan/xhs-claude-skills. It costs 28 tokens per session (2,714 once invoked), scanned A, original, MIT.

A tool for extracting posts from Xiaohongshu, a Chinese social-media platform, including text, text read from images, and video speech converted to text. It organizes the result as Markdown and saves it in an Obsidian notes folder.

In plain words
What is it for?
Use it when you have a Xiaohongshu post link and want its written content, image text, or video transcript saved as an Obsidian note.
Why use it?
It turns a post spread across a webpage, images, and video into a text note that is easier to search, edit, and keep. Access may require exported browser cookies from a logged-in account.

Skill for Claude Code

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

Part of the xhs-claude-skills plugin — 4 skills shipped together

Good fit Use it when you have a Xiaohongshu post link and want its written content, image text, or video transcript saved as an Obsidian note.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chenxiachan/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 chenxiachan/xhs-claude-skills --skill xhs
Clone the repo
git clone --depth 1 https://github.com/chenxiachan/xhs-claude-skills

Made for: Claude Code.

Or install xhs-claude-skills, the plugin that ships this one along with the rest of its 4 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/chenxiachan/xhs-claude-skills/xhs/github.svg)](https://agentmods.dev/skills/chenxiachan/xhs-claude-skills/xhs)
Your own site
<a href="https://agentmods.dev/skills/chenxiachan/xhs-claude-skills/xhs"><img src="https://agentmods.dev/badge/skills/chenxiachan/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/chenxiachan/xhs-claude-skills/xhs"><img src="https://agentmods.dev/badge/skills/chenxiachan/xhs-claude-skills/xhs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,714 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high YARA Match · line 12
    YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
    Fix: Remove the malware payload or compromised file entirely. Investigate how it entered the skill and audit all other artifacts for additional indicators of compromise.
  • high Tool Misuse · line 124
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
  • high Tool Misuse · line 180
    Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
    Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
How audits are shown
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.00028 $0.02714
Opus 5 $0.00014 $0.01357
Sonnet 5 $0.00006 $0.00543
Haiku 4.5 $0.00003 $0.00271

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

Security

Grade A, and why

xhs scanned grade A with 1 finding 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.

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 · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 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
  • Whisper 模型: mlx-community/whisper-large-v3-turbo

输入

用户提供的小红书链接: $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

如果请求失败(被重定向到 404/错误页),说明 cookies 过期,提示用户按步骤 0 重新导出。

Read the full file on GitHub · 228 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 · 228 lines · 28 tokens per session scan A 366222a7a832

Subscribe to this mod's changes

xhs is a skill published in the GitHub repository chenxiachan/xhs-claude-skills (416 stars, last pushed 28d ago), licensed MIT. It adds 28 tokens to every session and 2,714 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens