x-architecture

x-architecture is a skill for Claude Code from ElemontCapital/x-algorithm-skills. It costs 52 tokens per session (782 once invoked), scanned A, original, Apache-2.0.

A reference guide to the software design behind X’s “For You” timeline, the personalized feed shown on X, formerly Twitter. It describes how services find, score, filter, and select posts.

In plain words
What is it for?
Use it when tracing the request path, working with HomeMixer or ProductMixer components, or locating candidate retrieval and scoring logic in the X recommendation engine.
Why use it?
It helps developers understand where recommendation logic lives and how a feed request moves through the system.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the x-algorithm plugin — 8 skills shipped together

Good fit Use it when tracing the request path, working with HomeMixer or ProductMixer components, or locating candidate retrieval and scoring logic in the X recommendation engine.

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

Made for: Claude Code.

Or install x-algorithm, the plugin that ships this one along with the rest of its 8 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 x-architecture

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/elemontcapital/x-algorithm-skills/x-architecture"><img src="https://agentmods.dev/badge/skills/elemontcapital/x-algorithm-skills/x-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 782 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.00052 $0.00782
Opus 5 $0.00026 $0.00391
Sonnet 5 $0.00010 $0.00156
Haiku 4.5 $0.00005 $0.00078

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

Security

Grade A, and why

x-architecture 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 8d 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.

plugins/x-algorithm/skills/x-architecture/SKILL.md · 52 lines

How it starts

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

X Algorithm Architecture

Master reference for the X (Twitter) recommendation engine architecture, specifically the HomeMixer orchestration layer, ProductMixer functional components, and the Scala-to-Rust candidate pipeline bridge.

Context

The X recommendation engine operates as a "Lambda Architecture" variant. The orchestration layer (HomeMixer) is written in Scala using the ProductMixer framework, which defines the business logic graph. High-compute tasks (Candidate Retrieval, Scoring) are offloaded to optimized services (Rust/C++/Java).

For detailed technical breakdowns, see:

What it does

  • Maps the Request Graph: Traces the execution path from HomeMixer down to leaf services like Earlybird (Search) and Navi (ML Scoring).
  • Defines ProductMixer Traits: Explains the specific Scala traits used to build feed features: CandidateSource, Filter, Scorer, Gate, Selector, and SideEffect.
  • Identifies Data Models: Recognizes key data structures like SimClusters (Community Embeddings), TwHIN (Knowledge Graph), and RealGraph (User Interaction probabilities).
  • Locates Logic: Helps determine if logic resides in the orchestration layer (Scala) or the compute layer (Rust/Thrift).

Guidelines

  • Directory Navigation:
    • home-mixer/: Main orchestration logic for the timeline.
    • product-mixer/: Core framework defining how pipelines are built.
    • cr-mixer/: Content Recommender Mixer (Out-of-Network retrieval logic).
    • navi/: ML Model serving infrastructure (Heavy Ranker host).
    • visibility-lib/: Rust-based filtering logic (Safety, Blocks, Mutes).
  • ProductMixer Hierarchy: The system is composed of pipelines.
    1. Mixer Pipeline: The top-level entry (e.g., "For You").
    2. Candidate Pipeline: Parallel fetching of candidates (e.g., "In-Network", "Ads", "Who to Follow").
    3. Functional Components: Atomic units of logic (Filter, Scorer, Hydrator).
  • Scoring Stages: distinguish between Light Ranking (fast, heuristic-based, often inside Earlybird) and Heavy Ranking (full neural network, hosted in Navi).
  • Candidate Isolation: In the Heavy Ranker (MaskNet/Transformer), candidates are scored in a batch but cannot attend to each other (no cross-candidate attention). They only attend to the User Context.
  • Thrift Boundaries: Scala components communicate with Rust services via Thrift. If a field isn't in the Thrift definition, HomeMixer cannot see it.
  • Feature Stores: Understand that SignalIngester and UserSignalService provide the raw interaction data that feeds SimClusters and RealGraph.

Read the full file on GitHub · 52 lines

Files

What ships with it

4 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. 8d ago First seen · 52 lines · 52 tokens per session scan A 939e8e95ce9f

Subscribe to this mod's changes

x-architecture is a skill published in the GitHub repository ElemontCapital/x-algorithm-skills (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 52 tokens to every session and 782 once invoked, about $0.0003 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-31.