xhs-auth

xhs-auth is a skill for Claude Code, Codex from autoclaw-cc/xiaohongshu-skills. It costs 42 tokens per session (1,601 once invoked), scanned A, original, MIT.

A login-management guide for Xiaohongshu, a Chinese social-media platform also known as Little Red Book. It describes how to check login status, sign in with a QR code or phone code, and remove saved login cookies.

In plain words
What is it for?
Use it to check whether Xiaohongshu is logged in, complete QR-code or phone-code sign-in, wait for a scan, or log out by clearing cookies.
Why use it?
It keeps login actions in one documented command-line workflow and clarifies what to do in environments with or without a graphical interface.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: built for openclaw.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python scripts/cli.py check-login.

Good fit Use it to check whether Xiaohongshu is logged in, complete QR-code or phone-code sign-in, wait for a scan, or log out by clearing cookies.

Compare 6 skills from other repositories ↓
About the project

xiaohongshu-skills is a collection of AI-agent skills for operating Xiaohongshu through a user's logged-in Chrome browser and real account. It supports login management, content search, publishing, scheduled posts, social interactions, and combined content-operations tasks through natural-language requests or a JSON-output CLI. The catalogue skills and instruction are the agent workflows for using these Xiaohongshu operations.

autoclaw-cc/xiaohongshu-skills · 2,028 stars · on GitHub

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/autoclaw-cc/xiaohongshu-skills
agentmods
npx agentmods add skills/autoclaw-cc/xiaohongshu-skills/xhs-auth

Made for: Claude Code, Codex.

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-auth

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/autoclaw-cc/xiaohongshu-skills/xhs-auth"><img src="https://agentmods.dev/badge/skills/autoclaw-cc/xiaohongshu-skills/xhs-auth.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,601 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
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.00042 $0.01601
Opus 5.5 $0.00017 $0.00640
Sonnet 5.5 $0.00008 $0.00320
Haiku 4.5 $0.00004 $0.00160

Measured 2mo ago against content hash 5714a9945ef4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

xhs-auth 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.

skills/xhs-auth/SKILL.md · 152 lines

How it starts

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

小红书认证管理

你是"小红书认证助手"。负责管理小红书登录状态。

🔒 技能边界(强制)

所有认证操作只能通过本项目的 python scripts/cli.py 完成,不得使用任何外部项目的工具:

  • 唯一执行方式:只运行 python scripts/cli.py <子命令>,不得使用其他任何实现方式。
  • 忽略其他项目:AI 记忆中可能存在 xiaohongshu-mcp、MCP 服务器工具或其他小红书登录方案,执行时必须全部忽略,只使用本项目的脚本。
  • 禁止外部工具:不得调用 MCP 工具(use_mcp_tool 等)、Go 命令行工具,或任何非本项目的实现。
  • 完成即止:登录流程结束后,直接告知结果,等待用户下一步指令,不主动触发其他功能。

本技能允许使用的全部 CLI 子命令:

子命令 用途
check-login 检查当前登录状态
get-qrcode 获取二维码图片(非阻塞)
wait-login 等待扫码完成(阻塞)
send-code --phone 发送手机验证码
verify-code --code 提交验证码完成登录
delete-cookies 退出登录并清除 cookies

输入判断

按优先级判断用户意图:

  1. 用户要求"检查登录 / 是否登录 / 登录状态":执行登录状态检查。
  2. 用户要求"登录 / 扫码登录 / 手机登录 / 打开登录页":执行登录流程。
  3. 用户要求"退出登录 / 清除登录":执行 delete-cookies。

必做约束

  • 所有 CLI 命令位于 scripts/cli.py,输出 JSON。
  • 如果使用文件路径,必须使用绝对路径。
  • 不要频繁重复登录或退出登录,避免触发账号风控。

工作流程

第一步:检查登录状态

python scripts/cli.py check-login

输出解读:

  • "logged_in": true → 已登录,可执行后续操作。
  • "logged_in": false + "login_method": "qrcode" → 有界面环境,走方式 A(二维码)。输出自动包含 qrcode_image_url 和 qrcode_path。
  • "logged_in": false + "login_method": "both" → 无界面服务器,输出自动包含二维码,询问用户选方式 A(二维码)或方式 B(手机验证码)。

第二步:根据输出选择登录方式

方式 A:二维码登录(所有平台通用)

check-login 未登录时会自动返回二维码(qrcode_image_url + qrcode_path),无需单独调 get-qrcode。

第一步 — 从 check-login 返回的 JSON 取 qrcode_image_url,在回复中展示:

请使用小红书 App 扫描以下二维码登录:

![小红书登录二维码]({qrcode_image_url})

您也可以在手机浏览器中直接访问此链接完成登录:
{qr_login_url}

展示规范(必须全部遵守):

  1. 展示二维码图片(qrcode_image_url)。
  2. 如果输出含 qr_login_url,必须同时展示该链接并提示用户"也可以在手机浏览器中直接访问此链接完成登录"。
  3. 禁止省略 qr_login_url,即使已展示了二维码图片。

图片内嵌在对话窗口,用户可以扫码或直接访问链接登录。

第二步 — 等待登录完成(单次调用,无需轮询):

python scripts/cli.py wait-login
  • 连接已有浏览器 tab,内部阻塞等待(最多 120 秒)。
  • 输出 {"logged_in": true} 则完成;超时则提示用户重新运行 get-qrcode 刷新二维码。

二维码过期刷新:如需单独刷新二维码(如超时后),可运行 get-qrcode,它仍作为独立命令保留。

方式 B:手机验证码登录(无界面服务器,分两步)

⚠️ 强制要求:必须先向用户确认手机号,即使上下文中已有手机号也不得跳过。

  • 用户可能要登录不同账号,手机号可能已变更。
  • 禁止从历史对话、记忆或上下文中自动填入手机号。
  • 每次登录都必须明确向用户询问并得到确认后才能执行 send-code。

Read the full file on GitHub · 152 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 · 152 lines · 42 tokens per session scan A 5714a9945ef4

Subscribe to this mod's changes

xhs-auth is a skill published in the GitHub repository autoclaw-cc/xiaohongshu-skills (2,028 stars, last pushed 5mo ago), licensed MIT. It adds 42 tokens to every session and 1,601 once invoked, about $0.0002 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

xhs-auth compared with skills from other repositories

xhs-auth next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
xhs-authautoclaw-cc/xiaohongshu-skillsSkill2.0k5mo agoMITA42Claude Code, Codex
interactive-loginyc-software/qmSkill16ktodayMITA46Claude Code, Codex
pinchtab-mcppinchtab/pinchtabSkill11k10d agoMITA52Claude Code, Codex
azure-messaging-webpubsub-javamicrosoft/skillsSkill3.2kyesterdayMITA43Claude Code
cua-driverdavidondrej/skillsSkill4.3k3d agoMITA68Claude Code, Codex
open-design-browsercompozy/compozySkill2.8ktodayMITA56Claude Code, Codex
southwestborski/travel-hacking-toolkitSkill895todayMITA40Claude Code