x-foryou-algorithm

x-foryou-algorithm is a skill for Claude Code, Codex from kangarooking/X-growth-skills. It costs 105 tokens per session (3,352 once invoked), scanned A, original, MIT.

A guide for reasoning about X’s For You feed, the personalised stream that recommends posts to each user.

In plain words
What is it for?
It is for questions about X recommendations, such as why a post is promoted, why it gets little reach, or whether a new account can be recommended. It is not described as a tool for writing posts or increasing engagement directly.
Why use it?
It helps explain why a post may receive recommendations or few impressions by describing candidate selection, user interactions, and ranking.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for questions about X recommendations, such as why a post is promoted, why it gets little reach, or whether a new account can be recommended. It is not described as a tool for writing posts or increasing engagement directly.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kangarooking/x-growth-skills/x-foryou-algorithm
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 kangarooking/X-growth-skills --skill x-foryou-algorithm
Clone the repo
git clone --depth 1 https://github.com/kangarooking/X-growth-skills

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 x-foryou-algorithm

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kangarooking/x-growth-skills/x-foryou-algorithm"><img src="https://agentmods.dev/badge/skills/kangarooking/x-growth-skills/x-foryou-algorithm.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,352 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.
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.00105 $0.03352
Opus 5 $0.00053 $0.01676
Sonnet 5 $0.00021 $0.00670
Haiku 4.5 $0.00011 $0.00335

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

Security

Grade A, and why

x-foryou-algorithm 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 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.

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.

x-foryou-algorithm/SKILL.md · 143 lines

How it starts

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

For You 算法推理结构 — 推导创作者行动

R — 原文 (Reading)

"We have eliminated every single hand-engineered feature and most heuristics. The Grok-based transformer does all the heavy lifting by understanding your engagement history. During transformer inference, candidates cannot attend to each other—only to the user context, making scores consistent and cacheable. Final Score = Σ (weight_i × P(action_i)). Positive actions (like, repost, share) have positive weights. Negative actions (block, mute, report) have negative weights, pushing down content the user would likely dislike."

— xAI, X推荐算法.md · Key Design Decisions / Scoring and Ranking

自译:我们已消除所有手工特征和大部分启发式规则。Grok transformer从你的互动历史中自行学习相关性。排序时候选帖互不可见,只attend用户上下文,使分数稳定可缓存。最终分=各动作概率的加权和,正面动作(点赞/转发/分享)正权重,负面动作(拉黑/静音/举报)负权重,主动压低用户不喜欢的内容。


I — 方法论骨架 (Interpretation)

X 的 For You 推荐流由一条流水线驱动:双源召回 → 水合过滤 → 多动作打分 → 多样性 → 选取。三个核心设计决策构成了理解"内容为什么被推荐"的推理骨架:

  1. 无手工特征:Grok transformer 从互动历史自行学习相关性,不靠人工定义"什么内容好"。内容是否相关由用户行为模式学习,而非预设规则。
  2. 候选隔离:打分时每条帖子独立评估,不能"看到"同 batch 其他帖子,只 attend 用户上下文。你的帖子按自身预测质量评分,不是"比同批帖子更好"——质量是唯一杠杆,非相对时机。
  3. 多动作加权:不预测单一"相关性"分数,而是预测 15+ 种动作概率(点赞/回复/转发/收藏/点击/停留/关注……),正动作正权重、负动作(拉黑/静音/举报)负权重,加权求和得最终分。

2025 年更新:OON 占比升至 60-70%,算法更依赖内容相关性与互动质量而非账号规模,利好中小号;主帖带链接降权已取消;rage-bait/负面内容被主动压低。对创作者的推论:单帖按自身质量评分(不靠粉丝量),应优化收藏/回复(高正权重)而非只追点赞,避免引发 block/mute/report。


A1 — 书中的应用 (Past Application)

案例 1: xAI 开源 For You 源码架构

  • 问题: X 的 For You feed 如何决定哪些帖子被推荐给用户?
  • 方法论的使用: xAI 开源了完整推荐系统源码(github.com/xai-org/x-algorithm),展示了双源召回(Thunder 关注流 + Phoenix 全局发现)→ Phoenix Grok transformer 打分 → 多动作加权 → 候选隔离 → 作者多样性 → 选取的完整流水线,并明确标注三大设计决策(无手工特征/候选隔离/多动作预测)。
  • 结论: 算法完全依赖 transformer 从互动历史学习相关性,无人工特征工程;每条帖子独立评分,不与同批帖子竞争。
  • 结果: 这让创作者能从工程视角理解"为什么被推荐"——不是黑箱玄学,而是可分析的"预测互动概率 × 权重"模型。

案例 2: 2025 算法更新对中小号的影响

  • 问题: 2025 年算法更新对中小号意味着什么?
  • 方法论的使用: AIP 教程 3.1.2 解读 2025 算法规则——OON 占比从早期 In-Network 主导倾斜至约 60-70%,算法更依赖内容相关性和互动质量而非账号规模;取消主帖带链接降权(利好知识分享型账号);rage-bait/负面内容被主动降权(因引发 block/mute/report 负权重)。
  • 结论: 中小号单帖可凭自身质量进入推荐池,不必依赖粉丝基数;优化收藏/回复(高正权重)比只追点赞更有效;避免 rage-bait(负权重压低综合得分)。
  • 结果: 验证了候选隔离的推论——帖子按自身质量评分,OON 倾斜让小号内容有更多被全局发现的机会。

Read the full file on GitHub · 143 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 143 lines · 105 tokens per session scan A ad20f945d972

Subscribe to this mod's changes

x-foryou-algorithm is a skill published in the GitHub repository kangarooking/X-growth-skills (62 stars, last pushed 2mo ago), licensed MIT. It adds 105 tokens to every session and 3,352 once invoked, about $0.0005 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.