codesage AGENTS.md

Project instructions for CodeSage, a Rust-based code intelligence engine that builds structural and meaning-based search over source code. They describe its workspace, GPU option, tests, linting, and pre-push checks.

In plain words
What is it for?
Use them when developing, testing, linting, or preparing CodeSage changes for a Git push.
Why use it?
They make it clear how to build CodeSage correctly and how to catch formatting, lint, or test failures before pushing changes. They also explain that the CUDA build option is required when targeting a GPU.

Instructions file for CodexOpenCode

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/iliaal/codesage/agents-md
Clone the repo
git clone --depth 1 https://github.com/iliaal/codesage

Made for: Codex, OpenCode.

Per session 6,686 This file is loaded in full into every session.
When invoked 6,686 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 $0.06686 $0.06686
Opus 5 $0.03343 $0.03343
Sonnet 5 $0.01337 $0.01337
Haiku 4.5 $0.00669 $0.00669

Measured 2d ago against content hash 8ebab85aac8e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

AGENTS.md · 272 lines

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

Read the full file on GitHub · 272 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. 2d ago First seen · 272 lines · 6,686 tokens per session scan A 8ebab85aac8e

Subscribe to this mod's changes

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.