xerj-code

xerj-code is a skill for Claude Code, Codex from xerj-org/xerj. It costs 79 tokens per session (3,673 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

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 · 1,854 stars · on GitHub

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.

agentmods
npx agentmods add skills/xerj-org/xerj/xerj-code
Any agent
npx skills add xerj-org/xerj --skill xerj-code
Clone the repo
git clone --depth 1 https://github.com/xerj-org/xerj

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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,673 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00079 $0.03673
Opus 5 $0.00039 $0.01836
Sonnet 5 $0.00016 $0.00735
Haiku 4.5 $0.00008 $0.00367

Measured 5d ago against content hash bfb4f3ee8f91, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (scripts/xc-corpus.sh, scripts/xc-index.sh, scripts/xc.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.

Always verify: `curl -s "$URL/xc-<corpus>*/_count"` must be > 0.
tools/xerj-code/SKILL.md · 281 lines

How it starts

The opening of the file, as written. The whole thing — 281 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).

Read the full file on GitHub · 281 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. 5d 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 (1,854 stars, last pushed today), licensed Apache-2.0. It adds 79 tokens to every session and 3,673 once invoked, about $0.0004 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

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

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

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