nexus CLAUDE.md

nexus CLAUDE.md is an instructions file for Claude Code from Nexus-Router/nexus. It costs 5,592 tokens per session, scanned A, original, MPL-2.0.

Repository instructions for Nexus, an AI router that connects language models to multiple MCP servers, which are services exposing tools and data to AI systems. They define commit-message rules, project terminology, and Rust coding guidance.

In plain words
What is it for?
Use them when editing Nexus, especially when writing Rust code, describing MCP or routing behavior, and preparing commits.
Why use it?
They give coding agents the domain background and contribution conventions needed to change the router consistently.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

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 instructions/nexus-router/nexus/claude-md
Clone the repo
git clone --depth 1 https://github.com/Nexus-Router/nexus

Made for: Claude Code.

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 nexus CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/nexus-router/nexus/claude-md.svg)](https://agentmods.dev/instructions/nexus-router/nexus/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/nexus-router/nexus/claude-md"><img src="https://agentmods.dev/badge/instructions/nexus-router/nexus/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 5,592 This file is loaded in full into every session.
When invoked 5,592 The same file — it is already loaded in full.
Security scan A 0 findings. 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.1 $0.05592 $0.05592
Opus 5 $0.02796 $0.02796
Sonnet 5 $0.01118 $0.01118
Haiku 4.5 $0.00559 $0.00559

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

Security

Grade A, and why

nexus CLAUDE.md 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 6d 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.

CLAUDE.md · 694 lines

How it starts

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

LLM Code Editing Guidelines for Nexus

When editing code in this repository, you are working on Nexus, an AI router that aggregates MCP (Model Context Protocol) servers and LLMs. This system helps reduce tool proliferation by intelligently routing and indexing available tools.

Commit Messages

  • Follow the Conventional Commits 1.0.0 specification for every commit message.
  • Use recent commits (git log) as a reference for tone and formatting if you need examples.
  • Structure messages as type(issue number): subject, where
  • Common type values include feat, fix, chore, docs, refactor, test, and build; pick the one that best matches the change.
  • The issue number is a linear issue number, in the format of gb-1234. The user should give you this in the prompt, but if you don't have it, you can ask the user for it.
  • Keep the subject in the imperative mood, ≤72 characters, and avoid punctuation at the end.

Domain Context

  • MCP (Model Context Protocol): A protocol for connecting AI models with external tools and data sources
  • AI Router: Nexus acts as an intelligent intermediary between LLMs and multiple MCP servers
  • Tool Indexing: Uses Tantivy (full-text search engine) to create searchable indexes of available tools
  • Dynamic vs Static Tools: Static tools are shared across users; dynamic tools require user authentication

Key Technologies

  • Rust: The primary programming language
  • Axum: Web framework for HTTP routing and middleware
  • Tantivy: Full-text search engine for tool indexing
  • Tokio: Async runtime
  • Serde: Serialization/deserialization for JSON/TOML
  • RMCP: Rust MCP client/server implementation
  • Anyhow: Error handling with context and backtrace
  • Reqwest: HTTP client for external API calls
  • JWT-Compact: JWT token handling for authentication
  • Tower/Tower-HTTP: Middleware and service layers
  • Rustls: TLS implementation for secure connections
  • Insta: Snapshot testing framework
  • Clap: Command-line argument parsing
  • Logforth: Structured logging with tracing support
  • Docker Compose: For integration testing with Hydra OAuth2 server
  • Governor: Rate limiting with token bucket algorithm
  • Mini-moka: In-memory caching for rate limit buckets
  • Redis: Redis support for distributed rate limiting
  • Deadpool: Connection pooling
  • OpenTelemetry: Observability with metrics collection and OTLP export

Read the full file on GitHub · 694 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. 6d ago First seen · 694 lines · 5,592 tokens per session scan A d6c1758d75cb

Subscribe to this mod's changes

nexus CLAUDE.md is an instructions file published in the GitHub repository Nexus-Router/nexus (435 stars, last pushed 5mo ago), licensed MPL-2.0. It adds 5,592 tokens to every session, about $0.0280 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.

Related

Other instructions, from other repositories