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.
npx agentmods add instructions/fortunto2/rust-code/claude-mdgit clone --depth 1 https://github.com/fortunto2/rust-codeWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.03350 | $0.03350 |
| Opus 5 | $0.01675 | $0.01675 |
| Sonnet 5 | $0.00670 | $0.00670 |
| Haiku 4.5 | $0.00335 | $0.00335 |
Grade A, and why
rust-code 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md — rust-code
AI-powered terminal coding agent written in Rust.
Stack
- Rust (Edition 2024), Tokio async runtime
- Ratatui + Crossterm (TUI), tui-textarea (input)
- sgr-agent (LLM client + agent framework + session + tools + providers)
- Nucleo (fuzzy search, from Helix editor)
- rmcp (MCP client — Model Context Protocol)
- tmux (background task execution)
Architecture
crates/sgr-agent-core/— minimal core: Tool trait, FileBackend trait, AgentContext (typed store), ToolError (5 variants), schema (6 deps)crates/sgr-agent-tools/— 14 tools + LocalFs + MockFs, generic overFileBackendtrait (shell, apply_patch, indentation read, eval)crates/sgr-agent/— LLM client + agent framework + session/memory/providers/OpenAPI (re-exports core + tools)crates/rc-cli/— main binary: TUI (app.rs), headless mode (main.rs), agent loop (agent.rs), 27 tools (backend.rs + tools/)crates/sgr-agent-tui/— shared TUI shell: chat panel, streaming, agent loop integration, fuzzy pickercrates/solograph/— MCP server for code intelligencecrates/genai/— local fork of rust-genai (multi-provider LLM client: Gemini, OpenAI, Anthropic, Ollama, etc.)
Crate dependency graph
sgr-agent-core 0.2 <- Tool, FileBackend, AgentContext (typed store), ToolError (6 deps)
^ ^
sgr-agent-tools sgr-agent 0.7
0.4 LLM framework + parallel tool execution
14 tools + re-exports core + optional tools
LocalFs + MockFs ^
rc-cli, agent-bit, souffleur, video-analyzer
Agent loop: user message → Agent::decide() → model returns Decision { situation, task, tool_calls } → execute tools → feed result back → repeat until finish_task or completion.
sgr-agent Framework
- Core (
sgr-agent-core):Tooltrait,ToolOutput,ToolError,AgentContext,ToolDef,json_schema_for - Tools (
sgr-agent-tools, orsgr-agentfeature"tools"): 14 file-system tools generic overFileBackend:- Core:
ReadTool(+ indentation mode),WriteTool(JSON repair),DeleteTool(batch),SearchTool(smart),ListTool,TreeTool,ReadAllTool - Deferred:
MkDirTool,MoveTool,FindTool - Optional:
EvalTool("eval"),ShellTool("shell"),ApplyPatchTool("patch"— Codex-compatible diff DSL) - All-in-one:
"tools-all"enables eval + shell + patch
- Core:
- LLM Client:
GeminiClient,OpenAIClient— structured output + function calling + flexible parse - Agent framework (
feature = "agent"):Tooltrait →ToolRegistry(builder, case-insensitive lookup, fuzzy resolve)Agenttrait →Decision { situation, task, tool_calls, completed }- 6 variants:
SgrAgent(structured output),ToolCallingAgent(native FC),FlexibleAgent(text parse),HybridAgent(2-phase),Clarification,Planning run_loop()— generic agent loop with 4-tier loop detectionToolFilter— progressive discovery (keyword + fuzzy scoring)
- Session (
feature = "session"):Session,LoopDetector(4-tier),MemoryContext, hints, tasks, intent guard - App tools (
feature = "app-tools"): bash, fs, git, apply_patch - OpenAPI (always available): parse any OpenAPI 3.x spec → fuzzy search endpoints → HTTP call
ApiRegistry— load multiple APIs, search across all, call by endpoint name- 10 popular APIs pre-configured: github, stripe, openai, supabase, posthog, slack, linear, cloudflare, vercel, sentry
- APIs.guru fallback — 2800+ APIs searchable by name
- Auto-cache specs to
~/.sgr-agent/openapi-cache/, auto-detect auth from env vars $refresolution for parameters and schemas, path-level param inheritance
- Providers (
feature = "providers"): TOML config, auth, CLI proxy, Codex proxy - Telemetry (
feature = "telemetry"): OTEL file telemetry - Llm (
feature = "genai"): provider-agnostic LLM facade —LlmConfig::auto("gpt-4o")/LlmConfig::endpoint(key, url, model) - Demo:
cargo run -p sgr-agent --features agent --example agent_demo - Tests:
cargo test -p sgr-agent --all-features— 510+ tests (sgr-agent), 82 tests (sgr-agent-tools), 15 tests (sgr-agent-core)
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.
- 2d ago First seen · 190 lines · 3,350 tokens per session scan A 722e5d0257a3
rust-code CLAUDE.md is an instructions file published in the GitHub repository fortunto2/rust-code (41 stars, last pushed 10d ago), licensed MIT. It adds 3,350 tokens to every session, about $0.0168 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.
Other instructions, from other repositories
AionUi AGENTS.md
Instructions for iOfficeAI/AionUi, covering aionui - project guide, code conventions, file & directory structure, naming and ui library & icons.
ClawRouter CLAUDE.md
Instructions for BlockRunAI/ClawRouter, covering clawrouter, commands, project structure, key dependencies and conventions.
botmux CLAUDE.md
Instructions for deepcoldy/botmux, covering botmux, 构建 & 运行, bun 开发链路, worktree 的 nodemodules:共享还是独立(改前必读) and 编译态(单文件二进制)注意.
codedb AGENTS.md
Instructions for justrach/codedb, covering codedb agent guidelines, what codedb is (and isn't), review guidelines, pre-merge verification and security-sensitive areas.
SearChat CLAUDE.md
Claude Code instructions for yokingma/SearChat, covering claude.md, project overview, architecture, monorepo structure and key technologies.
ai AGENTS.md
AGENTS.md instructions for vercel/ai, covering agents.md, project overview, repository structure, key directories and core package dependencies.