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/iliaal/codesage/agents-mdgit clone --depth 1 https://github.com/iliaal/codesageWhat 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.06686 | $0.06686 |
| Opus 5 | $0.03343 | $0.03343 |
| Sonnet 5 | $0.01337 | $0.01337 |
| Haiku 4.5 | $0.00669 | $0.00669 |
Grade A, and why
codesage AGENTS.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 — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CodeSage
Code intelligence engine with structural graph and semantic search. Rust workspace, tree-sitter parsing, ONNX embedding inference, cross-encoder reranking, SQLite storage, MCP interface.
Build
cargo build # all crates
cargo build --release -p codesage --features cuda # release binary with GPU
cargo test --workspace # all tests
cargo clippy --workspace # lint
Always build with
--features cudawhen targeting GPU. Without it, CUDA silently falls back to CPU. The binary will error out if GPU is requested in config but the cuda feature is missing.
Sanity check before pushing
Run bash scripts/sanity-check.sh before git push when you've made code changes. Chains cargo fmt --all -- --check + cargo clippy --workspace --all-targets -- -D warnings + cargo test --workspace, in that order, stopping on the first failure. Pass --fast to skip tests (CI runs them) when you just want the fmt/clippy gate.
The "fmt then edit then forget to re-fmt" class of break is real (commit a43c51d is its monument); cargo fmt --all applies changes in place, but cargo fmt --all -- --check only reports the diff and exits nonzero — CI runs the latter. Using the script means you catch it locally.
Crate map
| Crate | Role | Depends on |
|---|---|---|
protocol |
Shared types (Symbol, Reference, SearchResult, etc.) | nothing |
parser |
File discovery, language detection, tree-sitter symbol/reference extraction | protocol |
storage |
SQLite schema, CRUD, sqlite-vec KNN | protocol |
embed |
ONNX embedding inference (Embedder), cross-encoder reranking (Reranker), chunking | protocol, ort, tokenizers, hf-hub |
features |
Feature-slice mapping, trust-boundary derivation | parser, storage, protocol |
graph |
Indexing orchestration, search pipeline, query API | parser, storage, embed, features, protocol |
cli |
codesage binary: CLI subcommands + MCP stdio shim + Unix-socket daemon |
everything |
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 · 272 lines · 6,686 tokens per session scan A 8ebab85aac8e
codesage AGENTS.md is an instructions file published in the GitHub repository iliaal/codesage (20 stars, last pushed 2d ago), licensed MIT. It adds 6,686 tokens to every session, about $0.0334 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
leantoken AGENTS.md
Instructions for morluto/leantoken, covering repository guidance, architecture, development, change-specific validation and contributions.
repobrain copilot-instructions.md
Copilot instructions for study8677/repobrain, covering github copilot bootstrap instructions and hard rule — query the repobrain hub first.
repobrain AGENTS.md
AGENTS.md instructions for study8677/repobrain: Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules.…
open-codebase-index AGENTS.md
Instructions for Helweg/open-codebase-index, covering agents.md - ai agent guidelines for open-codebase-index, build, test, and lint, run a single test, equivalent low-level command and architecture and file structure.
gno AGENTS.md
Instructions for gmickel/gno, covering knowledge cutoff warning, apis - bun first!, must use bun, acceptable node:\ (no bun equivalent) and testing.
CodeNib AGENTS.md
Instructions for sysevol-ai/CodeNib, covering agents.md, layered objectives, dev commands, git, commit, and pr rules and testing guidance.