claudex: Instructions file for Claude Code

CLAUDE.md

claudex CLAUDE.md is an instructions file for Claude Code from StringKe/claudex. It costs 1,287 tokens per session, scanned A, original, MIT.

Repository instructions for Claudex, a Rust program that manages several Claude Code instances and translates their API requests through a local proxy.

In plain words
What is it for?
Use them when working on profiles, OAuth sign-in, process management, metrics, the terminal interface, API translation, streaming responses, or fallback handling.
Why use it?
They describe the project’s architecture and components, helping developers make changes in the right place and preserve its authentication, proxy, streaming, and configuration behavior.

Instructions file for Claude Code

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

This is StringKe/claudex's own configuration. It tells Claude Code how to work on claudex itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claudex configures →

Reuse

Borrowing it

Nothing to install: this file belongs to StringKe/claudex. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/StringKe/claudex/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/StringKe/claudex

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/stringke/claudex/claude-md/github.svg)](https://agentmods.dev/instructions/stringke/claudex/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/stringke/claudex/claude-md"><img src="https://agentmods.dev/badge/instructions/stringke/claudex/claude-md/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 claudex CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/stringke/claudex/claude-md"><img src="https://agentmods.dev/badge/instructions/stringke/claudex/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,287 This file is loaded in full into every session.
When invoked 1,287 The same file — it is already loaded in full.
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.01287 $0.01287
Opus 5.5 $0.00515 $0.00515
Sonnet 5.5 $0.00257 $0.00257
Haiku 4.5 $0.00129 $0.00129

Measured 1mo ago against content hash 48d704ba1795, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

claudex 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 1mo 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 · 122 lines

How it starts

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

Claudex - Claude Code 项目指南

项目概述

Claudex 是一个 Rust 实现的多实例 Claude Code 管理器,内置智能翻译代理。它通过本地 proxy 将 Claude Code 的 Anthropic API 请求翻译并转发到多种 AI 提供商。

技术栈

  • 语言: Rust (Edition 2021)
  • 异步运行时: Tokio
  • Web 框架: Axum 0.8
  • HTTP 客户端: reqwest (rustls-tls)
  • TUI: ratatui + crossterm
  • 配置: TOML (toml crate)
  • 日志: tracing + tracing-subscriber
  • 错误处理: anyhow + thiserror

项目结构

src/
├── main.rs              # 入口 + CLI dispatch
├── cli.rs               # clap 子命令定义
├── config.rs            # 配置解析(API key 直接存 config,不自动读 keyring)
├── profile.rs           # Profile 管理
├── launch.rs            # 启动 claude 进程(含 Claude OAuth 特殊处理)
├── oauth/               # OAuth 订阅认证
│   ├── mod.rs           # AuthType, OAuthProvider, OAuthToken 类型
│   ├── token.rs         # 外部 CLI token 读取(Codex/Claude/Gemini)
│   ├── server.rs        # 本地回调服务器 + Device Code 轮询
│   └── providers.rs     # 各平台登录/刷新/状态逻辑
├── daemon.rs            # PID 文件 + 进程管理
├── metrics.rs           # 请求指标
├── proxy/               # 翻译代理
│   ├── mod.rs           # Axum server
│   ├── handler.rs       # 请求处理
│   ├── translation.rs   # Anthropic ↔ OpenAI 翻译
│   ├── streaming.rs     # SSE 流式翻译
│   ├── fallback.rs      # 断路器
│   ├── health.rs        # 健康检查
│   └── models.rs        # /v1/models 端点
├── router/              # 智能路由
│   ├── mod.rs
│   └── classifier.rs    # 意图分类
├── context/             # 上下文引擎
│   ├── mod.rs
│   ├── compression.rs   # 对话压缩
│   ├── sharing.rs       # 跨 profile 共享
│   └── rag.rs           # 本地 RAG
└── tui/                 # TUI 仪表盘
    ├── mod.rs
    ├── dashboard.rs
    ├── widgets.rs
    └── input.rs

构建与运行

# 开发构建
cargo build

# Release 构建
cargo build --release

# 检查
cargo check

# Clippy 检查
cargo clippy

# 运行
cargo run -- profile list
cargo run -- run grok
cargo run -- proxy start

核心概念

Provider Types

  • DirectAnthropic: 原生 Anthropic API,直接转发(Anthropic、MiniMax)
  • OpenAICompatible: OpenAI 兼容 API,需要协议翻译(OpenRouter、Grok、OpenAI、DeepSeek、Kimi、GLM、Ollama)

Read the full file on GitHub · 122 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. 1mo ago First seen · 122 lines · 1,287 tokens per session scan A 48d704ba1795

Subscribe to this mod's changes

claudex CLAUDE.md is an instructions file published in the GitHub repository StringKe/claudex (73 stars, last pushed 8mo ago), licensed MIT. It adds 1,287 tokens to every session, about $0.0051 per session on Opus 5.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