astra-code-map: Instructions file for Codex

AGENTS.md

astra-code-map AGENTS.md is an instructions file for Codex, OpenCode from SourceAstra/astra-code-map. It costs 679 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for AstraMap, a Go tool that indexes source code and shows its structure and relationships.

In plain words
What is it for?
They guide changes to the Go indexer, code parser, call graph, command-line tool, web dashboard, documentation, and tests.
Why use it?
They make the required build, test, formatting, naming, indexing, and submission practices clear.

Instructions file for CodexOpenCode

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

This is SourceAstra/astra-code-map's own configuration. It tells Codex and OpenCode how to work on astra-code-map 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 astra-code-map configures →

Reuse

Borrowing it

Nothing to install: this file belongs to SourceAstra/astra-code-map. 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/SourceAstra/astra-code-map/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/SourceAstra/astra-code-map

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 astra-code-map AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/sourceastra/astra-code-map/agents-md/github.svg)](https://agentmods.dev/instructions/sourceastra/astra-code-map/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/sourceastra/astra-code-map/agents-md"><img src="https://agentmods.dev/badge/instructions/sourceastra/astra-code-map/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 astra-code-map AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/sourceastra/astra-code-map/agents-md"><img src="https://agentmods.dev/badge/instructions/sourceastra/astra-code-map/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 679 This file is loaded in full into every session.
When invoked 679 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.00679 $0.00679
Opus 5.5 $0.00272 $0.00272
Sonnet 5.5 $0.00136 $0.00136
Haiku 4.5 $0.00068 $0.00068

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

Security

Grade A, and why

astra-code-map 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 21d 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 · 39 lines

What it actually says

Repository Guidelines

项目结构

  • core/:核心 Go 实现(package core),包括索引、Tree-sitter 解析、调用图、MCP 服务和 HTTP 服务。
  • cmd/amap/:命令行入口,提供 index、dashboard、serve 等命令。
  • core/web/:Dashboard 的 HTML、CSS 和 JavaScript 前端资源。
  • docs/:设计文档和项目说明;README.md、QUICKSTART.md 提供用户级使用文档。
  • .astramap/:本地代码地图数据库和索引状态,不应提交生成数据。

构建、测试与开发

make build                 # 构建本地 amap 二进制
make test                  # 运行全部 Go 测试
make vet                   # 执行 go vet
./amap index --project .   # 构建或更新当前项目索引
./amap dashboard --project .  # 启动 Web Dashboard

发布 Linux 静态二进制使用 make build-static-linux;该命令要求构建机安装 musl-gcc。修改解析器或索引逻辑后,应重新运行 amap index --full 清理旧索引结果。

代码风格与命名

1.Go 代码使用 gofmt,保持制表符缩进;导出类型、函数和字段使用 PascalCase,内部变量使用 camelCase。错误应带上下文并向上传递。前端 JavaScript 使用现有模块和命名风格,避免引入重复的全局状态。提交前运行 gofmt -w 处理改动过的 Go 文件;

测试指南

测试框架使用 Go 标准库 testing,测试文件命名为 *_test.go,测试函数命名为 TestXxx。当前仓库测试数量较少;新增解析、索引或 API 行为时,应在对应包增加回归测试,并使用 go test ./... 验证。

提交与合并请求

提交信息采用简短的组件前缀和祈使式描述,例如 treesitter.go: narrow heuristic call resolution 或 trace.js: preserve qualified names。合并请求应说明问题、实现范围和验证命令;涉及 Dashboard 的改动附上截图,涉及索引数据的改动说明是否需要重新生成 .astramap 数据。不要提交本地数据库、构建产物或临时截图。

AstraMap 工具约定

询问代码结构时优先使用 AstraMap 工具,而不是 grep 或递归文件搜索:定义用 astramap_search,上下文用 astramap_explore,源码详情用 astramap_node,调用方/被调用方用 astramap_callers / astramap_callees,影响范围用 astramap_impact,调用路径用 astramap_trace,索引状态用 astramap_status。

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. 21d ago Changed 410ecda5b773
  2. 2mo ago First seen · 39 lines · 679 tokens per session scan A 792284356390

Subscribe to this mod's changes

astra-code-map AGENTS.md is an instructions file published in the GitHub repository SourceAstra/astra-code-map (4 stars, last pushed 21d ago), licensed Apache-2.0. It adds 679 tokens to every session, about $0.0027 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

astra-code-map AGENTS.md compared with instructions from other repositories

astra-code-map AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
astra-code-map AGENTS.mdSourceAstra/astra-code-mapInstructions file421d agoApache-2.0A679Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode ai-customization.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA1,907GitHub Copilot