Borrowing it
Nothing to install: this file belongs to Helweg/open-codebase-index. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Helweg/open-codebase-index/main/AGENTS.mdgit clone --depth 1 https://github.com/Helweg/open-codebase-indexWrote 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.
[](https://agentmods.dev/instructions/helweg/open-codebase-index/agents-md)<a href="https://agentmods.dev/instructions/helweg/open-codebase-index/agents-md"><img src="https://agentmods.dev/badge/instructions/helweg/open-codebase-index/agents-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.
<a href="https://agentmods.dev/instructions/helweg/open-codebase-index/agents-md"><img src="https://agentmods.dev/badge/instructions/helweg/open-codebase-index/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.04371 | $0.04371 |
| Opus 5.5 | $0.01748 | $0.01748 |
| Sonnet 5.5 | $0.00874 | $0.00874 |
| Haiku 4.5 | $0.00437 | $0.00437 |
Grade A, and why
open-codebase-index 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 15d 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 — 391 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md - AI Agent Guidelines for open-codebase-index
Updated: 2026-08-02 | Commit: 32160f8 | Branch: main | Version: 0.22.3
Semantic codebase indexing for OpenCode, MCP hosts, Pi, omp (oh-my-pi), Claude, Codex, and Jcode. repo uses hybrid TypeScript/Rust architecture:
- TypeScript (
src/): host adapters, tool orchestration, indexing, retrieval, embedding providers, config, evaluation, and watchers - Rust (
native/): tree-sitter parsing, semantic chunking, usearch vectors, SQLite persistence, BM25, call graphs, and graph analytics
Build, Test, and Lint
npm run build # Build TypeScript and the Rust native module
npm run build:ts # TypeScript bundle plus built-CLI smoke test
npm run build:native # Rust/NAPI module for the current platform
npm run test:run # Full Vitest suite once; pretest rebuilds native code
npm test # Vitest watch mode
npm run test:coverage # Coverage run; pretest rebuilds native code
npm run lint # ESLint over src/
npm run typecheck # tsc --noEmit
Run a Single Test
npx vitest run tests/files.test.ts
npx vitest run -t "parseFile"
When Rust code changes, rebuild native module before running targeted tests that bypass npm run test:run
npm run build:native
# Equivalent low-level command:
cd native && cargo build --release && napi build --release --platform
full PR validation gate is:
npm run build && npm run typecheck && npm run lint && npm run test:run
Architecture and File Structure
src/
├── index.ts # Thin OpenCode facade; re-exports adapters/opencode
├── mcp-server.ts # Thin MCP facade; re-exports createMcpServer
├── cli.ts # CLI facade for MCP, eval, and visualization commands
├── adapters/
│ ├── opencode.ts # OpenCode plugin composition and hooks
│ ├── opencode/ # OpenCode tool and PR-impact adapters
│ ├── mcp/ # MCP CLI, server, tools, prompts, and shared schemas
│ ├── shared/ # Shared pi-contract extension core and call-graph registrar
│ ├── pi/ # Thin Pi package wrappers over the shared core
│ └── omp/ # Thin omp (oh-my-pi) wrapper over the shared core
├── tools/
│ ├── operations.ts # Shared host-neutral tool operations
│ ├── operation-runtime.ts # Shared operation runtime/context
│ ├── contracts.ts # Shared request/result contracts
│ ├── execute-common.ts # Common execution helpers
│ ├── context*.ts # Context routing, retrieval, and evidence packing
│ └── tool-names.ts # Canonical and host-specific public tool names
├── indexer/
│ ├── index.ts # Indexer orchestration
│ ├── search-ranking.ts # Hybrid fusion, filtering, diversity, assembly
│ ├── definition-ranking.ts # Definition-oriented evidence ranking
│ ├── embedding-batches.ts # Embedding batching, retry state, vector pooling
│ └── call-graph-constants.ts # Shared declaration chunk-type rules
├── native/ # Focused TypeScript wrappers over the NAPI binding
├── config/ # Host-aware config schema, merging, paths, and validation
├── embeddings/ # Provider detection and implementations
├── git/ # Branch resolution and branch-index materialization
├── watcher/ # File and Git branch watchers
├── eval/ # Retrieval evaluation CLI, datasets, metrics, and reports
├── rerank/ # Optional external reranking
├── utils/ # Files, paths, logging, metrics, power state, and helpers
├── identity-catalog.json # Current/future product and package identities
└── package-metadata.ts # Runtime package metadata helpers
native/src/
├── lib.rs # NAPI facade and exports
├── bindings/
│ └── database.rs # NAPI Database wrapper methods
├── db.rs # Core SQLite database implementation
├── db/call_graph.rs # Call-graph persistence and query operations
├── parser.rs # Tree-sitter parsing
├── chunker.rs # Semantic chunking with overlap
├── call_extractor.rs # Query-based call extraction
├── community.rs # Community detection and centrality algorithms
├── store.rs # usearch vector storage
├── inverted_index.rs # BM25 keyword index
├── hasher.rs # xxhash content hashing
└── types.rs # Shared native types and language mapping
native/queries/ # Tree-sitter call queries by language
tests/ # Vitest integration and unit tests
benchmarks/ # Native and retrieval benchmarks/evaluation fixtures
commands/ # OpenCode slash command definitions
skill/ # OpenCode skill guidance
docs/ # Installation, configuration, tools, migration docs
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.
- 15d ago Changed · +6 lines · +261 tokens per session 8538d106d37a
- 29d ago Changed · +3 tokens per session e4c259a9c00d
- 1mo ago First seen · 385 lines · 4,107 tokens per session scan A aa6a2565d495
open-codebase-index AGENTS.md is an instructions file published in the GitHub repository Helweg/open-codebase-index (224 stars, last pushed yesterday), licensed MIT. It adds 4,371 tokens to every session, about $0.0175 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.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.