knot AGENTS.md

knot AGENTS.md is an instructions file for Codex, OpenCode from raultov/knot. It costs 5,196 tokens per session, scanned C, original, MIT.

Repository-specific instructions for Knot, a Rust code indexer that builds searchable indexes for multiple programming languages and exposes semantic search through MCP.

In plain words
What is it for?
Use them when changing Knot’s indexer, search behavior, language support, databases, or test suites.
Why use it?
They describe the architecture and the commands needed to build, test, and run language-specific end-to-end 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/raultov/knot/agents-md
Clone the repo
git clone --depth 1 https://github.com/raultov/knot

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/raultov/knot/agents-md.svg)](https://agentmods.dev/instructions/raultov/knot/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/raultov/knot/agents-md"><img src="https://agentmods.dev/badge/instructions/raultov/knot/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 5,196 This file is loaded in full into every session.
When invoked 5,196 The same file — it is already loaded in full.
Security scan C 1 finding. 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.05196 $0.05196
Opus 5 $0.02598 $0.02598
Sonnet 5 $0.01039 $0.01039
Haiku 4.5 $0.00520 $0.00520

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

Security

Grade C, and why

knot AGENTS.md scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- Delete `.knot/` and rebuild: `rm -rf .knot/ && ./target/release/knot-indexer`
AGENTS.md · 455 lines

How it starts

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

AGENTS.md — Knot Development Guidance

knot is a dual-database codebase indexer (Rust 2024 edition) that powers semantic code search via MCP. This file captures repo-specific guidance that would trip up an unfamiliar agent.


Quick Commands

Build everything:

cargo build --release

Run unit tests only:

cargo test

Run all E2E tests (requires Docker + databases):

./tests/run_all_e2e_fast.sh

Run a single E2E language suite:

./tests/run_typescript_e2e.sh       # TypeScript
./tests/run_java_e2e.sh              # Java
./tests/run_javascript_e2e.sh        # JavaScript
./tests/run_web_e2e.sh               # HTML + JSX + CSS + SCSS + hybrid
./tests/run_kotlin_e2e.sh            # Kotlin
./tests/run_rust_e2e.sh              # Rust
./tests/run_python_e2e.sh            # Python
./tests/run_build_systems_e2e.sh     # Maven/Gradle/Jenkins/Cargo.toml
./tests/run_groovy_e2e.sh            # Groovy
./tests/run_cpp_e2e.sh               # C/C++
./tests/run_csharp_e2e.sh            # C#
./tests/run_cross_lang_ref_e2e.sh    # Cross-language validation
./tests/run_config_e2e.sh            # YAML/JSON/.properties config
./tests/run_k8s_helm_e2e.sh          # Kubernetes + Helm
./tests/run_cross_repo_dep_e2e.sh    # Cross-repo dependency linking

Code quality:

cargo clippy --all-targets -- -D warnings  # Must pass
cargo fmt -- --check                        # Must pass before commit
cargo fmt                                   # Auto-fix formatting

Architecture Overview

Three Binaries

Binary Purpose Feature Flag
knot-indexer Parses code, builds indexes (Qdrant + Neo4j) indexer (default)
knot CLI tool for search/explore/callers always built
knot-mcp MCP server for LLM integration always built

Entrypoints

  • src/bin/knot-indexer.rs — Main indexing pipeline
  • src/bin/knot.rs — CLI tool (search/explore/callers/deps commands)
  • src/bin/knot-mcp.rs — MCP server (exposes tools to LLMs)
  • src/lib.rs — Shared library (modules: pipeline, db, mcp_tools, cli_tools, etc.)

Read the full file on GitHub · 455 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 · 455 lines · 5,196 tokens per session scan C 10d24833adc5

Subscribe to this mod's changes

knot AGENTS.md is an instructions file published in the GitHub repository raultov/knot (5 stars, last pushed 4d ago), licensed MIT. It adds 5,196 tokens to every session, about $0.0260 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.