xerj-code

xerj-code is a skill for Claude Code, Codex from xerj-org/xerj. It costs 78 tokens per session (9,226 once invoked), scanned A, original, Apache-2.0.

A reference-coding workflow that finds existing implementations in cloned and locally indexed libraries before new code is written.

In plain words
What is it for?
Use it when starting work in an unfamiliar codebase, using an unfamiliar API, or porting an algorithm from another library.
Why use it?
It reduces guesswork when working with an unfamiliar API or algorithm by showing code that already solves a similar problem.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is (Full case study with real tokens and dollars: [`docs/case-studies/reference-coding/CASE_STUDY.md`](../../docs/case-studies/reference-coding/CASE_STUDY.md), 202.

Good fit Use it when starting work in an unfamiliar codebase, using an unfamiliar API, or porting an algorithm from another library.

Compare 6 skills from other repositories ↓
About the project

XERJ is a local search tool that automatically indexes folders so coding agents can retrieve relevant code, documents, logs, and PDFs without reading files one at a time. It is for developers and agents using code search, retrieval-augmented generation, security audits, or agent memory.

xerj-org/xerj · 10,530 stars · on GitHub · xerj.org

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/xerj-org/xerj
agentmods
npx agentmods add skills/xerj-org/xerj/xerj-code

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 xerj-code

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/xerj-org/xerj/xerj-code"><img src="https://agentmods.dev/badge/skills/xerj-org/xerj/xerj-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,226 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: 1 finding, up to medium

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 →

  • medium Rogue Agent · line 61
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
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.00078 $0.09226
Opus 5.5 $0.00031 $0.03690
Sonnet 5.5 $0.00016 $0.01845
Haiku 4.5 $0.00008 $0.00923

Measured 6d ago against content hash 0ec657746009, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

xerj-code 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 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (swebench/gen_predictions.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

curl -fsSLO https://raw.githubusercontent.com/xerj-org/xerj/corpus-hub/tools/xerj-code/hub/<slug>.json
tools/xerj-code/SKILL.md · 558 lines

How it starts

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

XERJ.code — reference coding

An agent that does not know an API guesses, runs, fails, and guesses again. Each lap costs output tokens, which are the expensive kind. This skill replaces laps with a lookup: clone the repositories that already contain a correct implementation, index them with XERJ, and retrieve the passage before writing.

The trade is deliberate. Retrieval spends input tokens, which are cheaper per token and cacheable; loops spend output tokens. See COSTS.md for the arithmetic and for the conditions under which this trade loses.

Status, stated plainly: measured, and the value is real but narrow. (Full case study with real tokens and dollars: docs/case-studies/reference-coding/CASE_STUDY.md, 2026-08-05.)

The comparison that matters is against native Claude Code — the same agent with tools that would grep the source itself — not a bare model. Measured across three regimes, same agent, one objective verdict (compiles + passes hidden tests):

  • Unfamiliar code with a contract the model can't recall (a seal, a generational handle, a lazy refill, a specific hash scheme — measured across seven purpose-built libraries, 21 runs): native and xerj both solve 21/21; xerj uses 1.5× fewer output tokens and costs 1.3× less than native, because retrieval replaces the grep. Pure memory fails 1/21 and burns 6.5× the cost flailing. This is the win, and it is decisive. The compiler can leak an API name across a retry loop, but never a contract.
  • Memorised code (any popular public crate — even a 256-value table, or a protobuf-style varint): retrieval is overhead. Pure memory is cheapest; injecting a big reference can be the worst arm, because the model re-emits what it was handed.

So: use this when the reference is code the model has not memorised — your own private/proprietary code, an internal API, a post-cutoff or niche library. On public library references the model already knows, it costs more than it saves. The native-vs-xerj gap grows with corpus size (grep pulls the whole tree into context; retrieval pulls one passage).

Since #977 the whole loop is inside the xerj binary — xerj corpus add / xerj corpus index / xerj code — plus the xerj_code_search MCP tool for agents without a shell. The old wrapper scripts (xc-corpus.sh, xc-index.sh, xc.py) are gone; your existing ~/.xerj-code corpora and indexes work unchanged (see Migration below).

Read the full file on GitHub · 558 lines

Files

What ships with it

9 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. 6d ago Changed · +31 lines 0ec657746009
  2. 14d ago Changed · +23 lines 67408fa4bb83
  3. 15d ago Changed · +18 lines 919f926833cb
  4. 16d ago Changed · +48 lines d49852fad6b6
  5. 22d ago Changed · +20 lines 7494199fb8f9
  6. 28d ago Changed · +100 lines · -1 tokens per session f76ffc52d224
  7. 29d ago Changed · +37 lines 1c669e70d5b2
  8. 1mo ago First seen · 281 lines · 79 tokens per session scan A bfb4f3ee8f91

Subscribe to this mod's changes

xerj-code is a skill published in the GitHub repository xerj-org/xerj (10,530 stars, last pushed today), licensed Apache-2.0. It adds 78 tokens to every session and 9,226 once invoked, about $0.0003 per session on Opus 5.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

vs-search-tuning-specify-policy-direction

Viking Search tuning for specified policy directions. Use this when the user provides specific queries, a type of query, or a business policy direction, and asks to boost, suppress, or fix a class of search results through request-parameter passthrough. You must only perform read-only baseline evaluation and…

volcengine/SearchCLI · 93 tokens

vs-crawler

Crawl websites (news, blogs, papers, GitHub, product docs, RSS feeds) into a fixed-schema JSONL file, then create a dataset and a searchable application in Viking AI Search. Supports one-time crawl and scheduled recurring crawl with automatic incremental sync.

volcengine/SearchCLI · 57 tokens

vs-product-qa

Answer Viking AI Search product questions, CLI usage questions, API/auth questions, configuration questions, and troubleshooting questions by grounding every claim in either the installed vs CLI's own output or official Volcengine documentation. Never fabricate.

volcengine/SearchCLI · 51 tokens

vs-search-tuning-partial-case

Use when the user provides 1-50 concrete bad-case search queries for one Viking Search app and wants local deterministic fixes. This skill only verifies request-level fine-operation interventions against a read-only baseline scene and delivers a console-ready configuration sheet, validated payloads, and a replay…

volcengine/SearchCLI · 85 tokens

vs-user-onboarding

Guide a brand-new SearchCLI/vs user from first-time usage questions to sign-up, purchase of Viking AI Search, AK/SK setup, and a working authenticated CLI. Use when the user says they downloaded or installed SearchCLI/vs and asks how to use it, how to start, sign up, buy, or onboard.

volcengine/SearchCLI · 72 tokens

volcengine-documentation

Volcengine official documentation lookup helper. Supports both document search and full-content fetch across Volcengine products, developer tools, support content, best practices, pricing, deployment, troubleshooting, API, SDK, and policy pages.

volcengine/SearchCLI · 51 tokens