codemap: Instructions file for Codex

AGENTS.md

codemap AGENTS.md is an instructions file for Codex, OpenCode from abdul-hamid-achik/codemap. It costs 3,665 tokens per session, scanned A, original, MIT.

A project guide for coding agents and developers working on codemap, a local tool that maps how code components connect and helps search code by meaning.

In plain words
What is it for?
Use it to orient agents in the repository, find the right documentation, follow project commands, and understand how codemap is organized.
Why use it?
It keeps project structure, documentation rules, design notes, and development commands in one agreed place, so contributors know how to work consistently.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is abdul-hamid-achik/codemap's own configuration. It tells Codex and OpenCode how to work on codemap itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything codemap configures →

Reuse

Borrowing it

Nothing to install: this file belongs to abdul-hamid-achik/codemap. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/abdul-hamid-achik/codemap/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/abdul-hamid-achik/codemap

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/abdul-hamid-achik/codemap/agents-md/github.svg)](https://agentmods.dev/instructions/abdul-hamid-achik/codemap/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/abdul-hamid-achik/codemap/agents-md"><img src="https://agentmods.dev/badge/instructions/abdul-hamid-achik/codemap/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.

agentmods 80×15 button for codemap AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/abdul-hamid-achik/codemap/agents-md"><img src="https://agentmods.dev/badge/instructions/abdul-hamid-achik/codemap/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,665 This file is loaded in full into every session.
When invoked 3,665 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03665 $0.03665
Opus 5.5 $0.01466 $0.01466
Sonnet 5.5 $0.00733 $0.00733
Haiku 4.5 $0.00366 $0.00366

Measured 6d ago against content hash 2893315d3a30, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codemap 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 6d 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 · 228 lines

How it starts

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

AGENTS.md

Contributor/agent guide for codemap. Product usage lives in docs/ (start at docs/quick-start.md; agents: docs/agents.md, docs/mcp.md; learning layer: docs/learn.md; config: docs/configuration.md). Design rationale lives in the Obsidian vault at ~/notes/projects/codemap/design-rationale.md; live work in the vault's BACKLOG.md — never in the repo. The in-band agent guide is generated from internal/app/docs.go (codemap docs [topic]); this file is contributor rules and invariants, not a second copy of the product contracts — when a contract detail matters, follow the pointer and read the code/schema.

Project Overview

codemap is local-first code intelligence: a structural code graph (stdlib parsers + pure-Go tree-sitter for TS/JS/Python; LSP for --precise) plus semantic retrieval (local veclite, or delegated one-hop to vecgrep) behind one query layer. It answers questions grep/LSP-alone can't: "who calls this and what tests cover it", "blast radius of changing this type", "find auth-like code, then show what calls it".

Three surfaces over one store:

  • CLI — human commands + --json machine output (Cobra, cmd/codemap/).
  • MCP server — codemap serve (stdio), codemap_* tools (internal/mcp/).
  • Codemap Studio — Electron app in desktop/; never reimplements anything, every panel spawns codemap … --json (see docs/desktop.md). The terminal Studio TUI was retired.

Highlights: learning layer (atlas/features/flow/processes — summaries are read from READMEs/package docs/leading comments, never generated), hybrid queries (context, impact, review, affected), cross-project graph, hash-incremental reindex with an embedding-profile guard, offline structural queries (one-off precise relations may launch a language server on demand).

Directory Structure

cmd/codemap/        # Cobra CLI split by domain; every RunE is THIN → session → internal/app.
                    #   Files carry /* Copyright © 2026 abdul hamid <[email protected]> */.
internal/
  app/              # shared service layer (CLI + MCP call this; desktop via CLI)
  graph/            # SQLite graph store: store/schema/queries/topology/ranking/traversal
  extract/          # backends: gosrc, typesrc (go/types), sittersrc (tree-sitter),
                    #   lspsrc, tsscan, rubysrc, luasrc, vuesrc, featuresrc, declarative
  lsp/              # hand-rolled LSP client (Content-Length JSON-RPC)
  embed/            # embed.Provider + Ollama provider + EmbeddingProfile guard
  vector/           # veclite wrapper (one `codemap` collection)
  index/            # walk → extract → embed → store; incremental, watcher, import edges
  mcp/              # stdio MCP server — thin pass-through to app
  daemon/           # fsnotify watcher + control socket
  git/ snapshot/ branchstate/ cachestate/ config/ version/
docs/               # VitePress product site ONLY (deployed via Vercel from main)
desktop/            # Codemap Studio (Electron); see "Desktop" under Common Tasks
integrations/       # claude-code plugin, portable agent skill, github-action (generated
                    #   playbook artifacts, pinned by sync tests — not notes)
specs/              # glyphrun E2E specs (*.yml, local only)
schemas/            # versioned JSON schemas for machine contracts (e.g. review v1)

Read the full file on GitHub · 228 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. 6d ago Changed · +2 lines · +47 tokens per session 2893315d3a30
  2. 7d ago Changed · -451 lines · -11,873 tokens per session 5ebb0f5e7da7
  3. 18d ago Changed · +19 lines · +458 tokens per session c0648dde7a94
  4. 19d ago Changed · +69 lines · +2,076 tokens per session 8eda85f4189b
  5. 23d ago Changed · +32 lines · +975 tokens per session f1d31da0ebdc
  6. 27d ago Changed · +10 lines · +206 tokens per session e2e5b06542e1
  7. 1mo ago Changed · +6 lines · +125 tokens per session e13d0952a726
  8. 1mo ago Changed · +95 tokens per session cc18aa983c86
  9. 1mo ago Changed · +26 lines · +585 tokens per session cf2b71dbe742
  10. 1mo ago First seen · 515 lines · 10,971 tokens per session scan A aee391d73bdd

Subscribe to this mod's changes

codemap AGENTS.md is an instructions file published in the GitHub repository abdul-hamid-achik/codemap (2 stars, last pushed 7d ago), licensed MIT. It adds 3,665 tokens to every session, about $0.0147 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-31.

Related

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).

microsoft/vscode · 9,715 tokens

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.

vercel/next.js · 7,581 tokens

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).

microsoft/vscode · 5,262 tokens

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.

langchain-ai/langchain · 4,680 tokens

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).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens