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.
npx agentmods add instructions/flupkede/codesearch/agents-mdgit clone --depth 1 https://github.com/flupkede/codesearchWhat 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 | $0.06513 | $0.06513 |
| Opus 5 | $0.03256 | $0.03256 |
| Sonnet 5 | $0.01303 | $0.01303 |
| Haiku 4.5 | $0.00651 | $0.00651 |
Grade A, and why
codesearch 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 yesterday.
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 — 108 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — codesearch
Last updated: 2026-08-14
Current state
- Version:
Major.Minor.Patch(semver). Patch auto-bumps +1 on every PR merged todevelop(CI via.github/workflows/bump-develop.yml); minor bumps manually at release (scripts/bump-version.sh --type minor, resets patch→0). Per-commit uniqueness comes frombuild.rs's+<commit_count>suffix. SeeRELEASING.md. - Validation:
cargo checkfor iteration,cargo clippy -D warningsfor lint,cargo test --lib --binsbefore a branch is considered done. No--releasebuilds during the fix loop — build only at the very end. - Deploy: cloud peer runs the per-vendor federation split (one index per vendor sub-folder + custom-kb), image built locally via BuildKit
docker buildx --push, all vendors reindexed and federation validated end-to-end (project=cloud/<vendor>).
Implemented Features
Release narratives live in CHANGELOG.md; this list keeps only the load-bearing facts.
- Federation peers —
codesearch remote add/rm/list(localrepos.jsonpeer config:alias → url, api_key, group, into_group) +@peergroup references;FederationClientsearch/get_chunk fan-out with RRF. - Opt-in remote mount selection — the
remote_mountsallowlist inrepos.jsonis the single source of truth for routing (resolve_remote_project), discoverability (list_projects/scope_required), TUI display, and@peergroup fan-out (restricted to mounted projects, never the whole peer). Nothing a peer exposes is auto-mounted. CLI:codesearch remote available|mount|unmount|mounts. - Remote project mounting (1-to-1 passthrough) — each mounted project is addressable locally as
project=<peer>/<alias>;FederationClient::search_projectforwards a single-project query straight to the peer. The TUI renders mounts in italic/cyan with a peer URL + live-status panel, and disables doctor/reindex/remove (those act on a local index a mount doesn't have). - Remote index management (
--remote) —--remote <peer>onindex list/add/rmplus anindex reindexverb, driven throughFederationClient(ManagementOutcome:Ok/HttpError{status,reason}/Unreachable). Endpoints:GET /status,POST /repos {path},DELETE /repos/:alias,POST /repos/:alias/reindex[?force=].--jsonon List/Reindex requires--remote. Without--remoteeveryindexverb is local and unchanged. - Cloud indexer-job split — a heavy 4 vCPU/8 GiB build job uploads a snapshot; a light 1 vCPU/2 GiB serve restores it. The DOCS-read-only state is enforced by a per-repo
repo_read_onlyflag inrepos.json(set by the job'smark_docs_readonlystep): serve's warmup opens those repos read-only and returns early, so no embedding happens on the replica. Onlycustom-kbstays writable and gets a memory-bounded incremental reindex (fire-and-forgetPOST /repos/custom-kb/reindex) after each KBgit pullmovesHEAD. The job also prunes ghost vendors before publishing. Seeintegrations/cloud/README.md. - Language coverage — 17 tree-sitter grammars (table in README).
find_impacthas SCIP symbol precision for C# (bundledscip-csharp) and TypeScript (npx scip-typescript, host-resolved). Protobuf is Niveau 1 (text-aware chunking onmessage/enum/service/rpc) only — noscip-protobufemitter exists today. - Scale-to-zero-safe federation: a federated peer is NEVER polled on a timer — ⚠️ design constraint, do not "improve" this. Background polling of local repos is fine; a federated peer must never be contacted on any cadence. The embedded TUI's discovery tick is config-only (
REMOTE_ROW_REFRESH_SECS= 5s, zero HTTP): it rebuilds mounted-remote rows from theremote_mountsallowlist so mount/unmount edits andlreloads surface, and contacts nobody. A peer is contacted only by (a) an activity poke — a real federated tool call just hit it, detected viaremote_peer_activityinServeState, refreshing that one peer, never a fan-out — or (b) the explicitiinfo-overlay keypress. Idle mounts therefore render activity as-, which is the correct steady state, not a fault. Rejected reasoning (was shipped twice, PR #181/#184, and reverted): "polling no faster than the host's idle-suspend term is harmless." It is not — each poll woke the peer's scale-to-zero replica, which then self-warmed for its own full idle window (~1h), giving ~50% duty cycle on a peer nobody queried (measured: wakes 120/121/120 min apart, zero searches). Not keeping a peer awake past its suspend term is strictly weaker than not waking it, and the two windows are unrelated values anyway (local host vs. remote peer). - Standalone remote TUI auth —
codesearch serve tui --url ...resolves the API key fromrepos.json(remotes.*.urlmatch) or a--api-keyoverride and threads the authenticated client through every TUI action, with distinct errors for "no key configured" vs. "key rejected (401)". - Keep-warm ping observability + spurious-wake fix (branch
fix/federated-silent-poll-diagnosis) — thekeep_warm_urlself-ping loop logs every ping (debug!on success,warn!on failure) instead of discarding both outcomes, and warns at startup when the target host isn't this server's own bind host — except on a wildcard bind (0.0.0.0/::), where our externally-visible host is unknown so the comparison proves nothing; without that carve-out the warning fired on every cold start of the only deployment where keep-warm is correct (Azure binds0.0.0.0, target is the ingress FQDN), which just trains operators to ignore it. Rule lives in the testablekeep_warm_foreign_targethelper. Keep-warm also requires a real recorded tool call: the oldmost_recent_tool_call().unwrap_or(start)fallback meant any wake that wasn't a tool call (/statusand/healthzdon't callrecord_tool_call) made the replica self-warm for its whole idle window — reachable only when the wake wasn't real work, so its sole practical effect was rewarding spurious wakes (~11× amplification). Full diagnosis, with Azure Log Analytics ground truth:.docs/DIAGNOSE_FEDERATED_KEEP_WARM.md. - CLI aliases —
lsforlist(index/groups/remote),rmforremove.index rm <alias>resolves a registered alias before falling back to path interpretation.
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.
- yesterday First seen · 108 lines · 6,513 tokens per session scan A 0e1aa9a045f6
codesearch AGENTS.md is an instructions file published in the GitHub repository flupkede/codesearch (72 stars, last pushed 2d ago), licensed Apache-2.0. It adds 6,513 tokens to every session, about $0.0326 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.
Other instructions, from other repositories
open-codebase-index AGENTS.md
Instructions for Helweg/open-codebase-index, covering agents.md - ai agent guidelines for open-codebase-index, build, test, and lint, run a single test, equivalent low-level command and architecture and file structure.
gno AGENTS.md
Instructions for gmickel/gno, covering knowledge cutoff warning, apis - bun first!, must use bun, acceptable node:\ (no bun equivalent) and testing.
coco-search CLAUDE.md
Instructions for VioletCranberry/coco-search, covering project instructions, project overview, tool routing (mandatory), development setup and prerequisites: docker, uv (python package manager).
codesage AGENTS.md
Instructions for iliaal/codesage, covering codesage, build, sanity check before pushing, crate map and search pipeline.
ken CLAUDE.md
Instructions for townsendmerino/ken, covering claude.md, what this is, repository ownership (read this first), commands and embedding parity & golden fixtures (now in aikit).
archilles AGENTS.md
Instructions for kasssandr/archilles, covering agents.md, project overview, commands, installation and indexing.