cocoindex AGENTS.md

cocoindex AGENTS.md is an instructions file for Codex, OpenCode from cocoindex-io/cocoindex. It costs 4,372 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for coding agents working on the CocoIndex project. They cover how to build, test, format, lint, and run checks for its Python and Rust code.

In plain words
What is it for?
Use them when changing CocoIndex code, especially after Rust or Python edits, to run the correct builds, tests, type checks, formatting, linting, and pre-submission checks.
Why use it?
They reduce guesswork about the commands and checks needed after making changes. They also help agents follow the same process as the project’s continuous integration checks.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/cocoindex-io/cocoindex/agents-md.svg)](https://agentmods.dev/instructions/cocoindex-io/cocoindex/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/cocoindex-io/cocoindex/agents-md"><img src="https://agentmods.dev/badge/instructions/cocoindex-io/cocoindex/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 4,372 This file is loaded in full into every session.
When invoked 4,372 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.04372 $0.04372
Opus 5 $0.02186 $0.02186
Sonnet 5 $0.00874 $0.00874
Haiku 4.5 $0.00437 $0.00437

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

Security

Grade A, and why

cocoindex 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 3d 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 · 357 lines

How it starts

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

AGENTS.md

This file provides guidance to coding agents working with code in this repository. Claude Code compatibility is kept through CLAUDE.md, which imports this file.

Build and Test Commands

This project uses uv for Python project management.

Building

uv run maturin develop   # Build Rust code and install Python package (required after Rust changes)

Testing

cargo test               # Run Rust tests
uv run mypy              # Type check Python code
uv run pytest python/    # Run Python tests (use after both Rust and Python changes)

Code Formatting and Linting

uv run ruff format .           # Format Python code
uv run ruff format --check .   # Check formatting without making changes (same as CI)
uv run ruff check .            # Lint Python code
cargo fmt                      # Format Rust code

Pre-submission Checks

CI enforces the full pre-commit hook suite from .pre-commit-config.yaml, which covers more than the commands above — notably regenerating the CLI docs (docs/src/content/docs/cli.mdx) whenever cli.py changes. Run it locally before pushing:

uv tool install prek     # one-time; some hooks also need `protoc` (brew install protobuf)
prek run --all-files

Workflow Summary

Change Type Commands to Run
Rust code only uv run maturin develop && cargo test
Python code only uv run mypy && uv run pytest python/
Both Rust and Python Run all commands from both categories above
Python formatting uv run ruff format .
Before pushing prek run --all-files

Code Structure

cocoindex/
├── rust/                       # Rust crates (workspace)
│   ├── core/                   # Core engine crate
│   │   └── src/
│   │       ├── engine/         # Core engine
│   │       ├── state/          # States of the core engine
│   │       └── inspect/        # Database inspection utilities
│   ├── py/                     # Python bindings (PyO3)
│   ├── py_utils/               # Python-Rust utility helpers (error, convert, future)
│   ├── utils/                  # General utilities: error, batching, fingerprint, etc.
│   └── ops_text/               # Text processing operations (splitter, language detection)
│
├── python/
│   ├── cocoindex/              # Python package
│   │   ├── __init__.py         # Package entry point
│   │   ├── cli.py              # CLI commands
│   │   ├── _internal/          # Internal implementation for the core engine
│   │   │   ├── api.py          # Public API: mount, use_mount, mount_each, map, mount_target, App, fn, start/stop
│   │   │   ├── app.py          # App base implementation
│   │   │   ├── context_keys.py # ContextKey and ContextProvider
│   │   │   ├── environment.py  # Environment and lifespan handling
│   │   │   ├── function.py     # @coco.fn decorator implementation
│   │   │   ├── component_ctx.py # ComponentContext and component_subpath
│   │   │   ├── target_state.py # Target state implementation
│   │   │   └── core.pyi        # Type stubs for the Rust extension module (update when PyO3 APIs change)
│   │   ├── connectors/         # External system connectors (localfs, postgres, qdrant, lancedb, google_drive)
│   │   ├── connectorkits/      # Connector building utilities
│   │   ├── resources/          # Abstractions: file.py (FileLike), chunk.py (Chunk), schema.py
│   │   └── ops/                # Operations: text.py (RecursiveSplitter), sentence_transformers.py
│   └── tests/                  # Python tests
│
├── examples/                   # Example applications
├── docs/                       # Documentation
└── dev/                        # Development utilities

Read the full file on GitHub · 357 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. 3d ago First seen · 357 lines · 4,372 tokens per session scan A a0d01a200bb8

Subscribe to this mod's changes

cocoindex AGENTS.md is an instructions file published in the GitHub repository cocoindex-io/cocoindex (11,448 stars, last pushed 2d ago), licensed Apache-2.0. It adds 4,372 tokens to every session, about $0.0219 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.