octocode AGENTS.md

octocode AGENTS.md is an instructions file for Codex, OpenCode from Muvon/octocode. It costs 2,451 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for Octocode, a Rust command-line tool that indexes code, builds a connected knowledge map, and provides the information to AI assistants through an MCP server. MCP is a standard way for an AI assistant to use external tools and data.

In plain words
What is it for?
Use them when working on Octocode’s Rust codebase, its LanceDB storage, search and graph features, configuration, or MCP integration.
Why use it?
They help an AI assistant understand the project structure, configuration rules, storage, and core components before changing the code.

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

Made for: Codex, OpenCode.

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 octocode AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/muvon/octocode/agents-md.svg)](https://agentmods.dev/instructions/muvon/octocode/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/muvon/octocode/agents-md"><img src="https://agentmods.dev/badge/instructions/muvon/octocode/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,451 This file is loaded in full into every session.
When invoked 2,451 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.02451 $0.02451
Opus 5 $0.01226 $0.01226
Sonnet 5 $0.00490 $0.00490
Haiku 4.5 $0.00245 $0.00245

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

Security

Grade A, and why

octocode 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 4d 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 · 189 lines

How it starts

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

Octocode — AI-Powered Code Intelligence

Rust CLI tool (v0.14.x) that indexes codebases into LanceDB vector stores, builds knowledge graphs via GraphRAG, and exposes everything through an MCP server for AI assistant integration. Core stack: Rust + tokio + LanceDB + tree-sitter + octolib (embedding/LLM providers). Embedding providers and LLM are delegated entirely to octolib.

Project Structure

src/
  main.rs                    — CLI entry point, command dispatch
  config.rs                  — All config structs; NO runtime defaults (panic on missing)
  storage.rs                 — Project DB path resolution (~/.local/share/octocode/<hash>/)
  store/                     — LanceDB operations
    mod.rs                   — Store struct, block types (CodeBlock, TextBlock, DocumentBlock, CommitBlock)
    vector_optimizer.rs      — Auto-tuned IVF_RQ / IVF_HNSW_SQ index selection
    batch_converter.rs       — Arrow RecordBatch construction
    table_ops.rs             — content_exists(), low-level table ops
    graphrag.rs              — GraphRAG node storage
    metadata.rs              — Table metadata helpers
  embedding/mod.rs           — Thin wrapper over octolib; generate_embeddings*, hash utilities
  llm/mod.rs                 — Thin wrapper over octolib LLM; LlmClient::from_config()
  indexer/
    mod.rs                   — NoindexWalker, file pipeline orchestration
    languages/               — One file per language, all implement Language trait
    graphrag/                — GraphRAG builder, AI relationship discovery
    batch_processor.rs       — Batch embedding + flush logic
    differential_processor.rs — Incremental file change processing
    contextual.rs            — LLM-based contextual chunk enrichment
    commits/                 — Git commit history indexing
  mcp/
    server.rs                — McpServer (rmcp-based, stdin + HTTP modes)
    semantic_code.rs         — SemanticCodeProvider tool impl
    graphrag.rs              — GraphRagProvider tool impl
    lsp/                     — LSP integration tools
    proxy.rs                 — Multi-repo MCP proxy
  commands/                  — One file per CLI subcommand
config-templates/default.toml — Single source of truth for ALL config defaults

Read the full file on GitHub · 189 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. 4d ago First seen · 189 lines · 2,451 tokens per session scan A ed126aa6a6da

Subscribe to this mod's changes

octocode AGENTS.md is an instructions file published in the GitHub repository Muvon/octocode (465 stars, last pushed yesterday), licensed Apache-2.0. It adds 2,451 tokens to every session, about $0.0123 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.