map

An interactive command-line workspace for exploring an indexed codebase. It lets you search symbols, inspect source code, and follow which functions call or depend on one another.

In plain words
What is it for?
Use it to find symbols, search for concepts, inspect callers and dependencies, and view the source of functions or other symbols.
Why use it?
It keeps repeated code exploration in one session, with command history and tab completion. You can investigate unfamiliar code without remembering separate commands each time.

Command

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 commands/agentis-tools/ctx/map
Clone the repo
git clone --depth 1 https://github.com/agentis-tools/ctx
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 400 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.00400
Opus 5 $0.00000 $0.00200
Sonnet 5 $0.00000 $0.00080
Haiku 4.5 $0.00000 $0.00040

Measured yesterday against content hash 69c5198089e0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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

docs/commands/map.md · 58 lines

What it actually says

ctx map

Generate a token-budgeted map of the codebase for LLM session bootstrap.

Synopsis

ctx map [OPTIONS]

Description

The map command condenses the index into a compact structural overview - modules, key symbols, and their relationships - that fits a fixed token budget. It is designed to be the first thing an AI assistant reads in a session: enough orientation to navigate the codebase without pasting whole files.

Prerequisites

ctx index

Options

Option Description Default
--budget <N> Maximum tokens in the map 2000
--focus <PATH> Zoom the map on a path or module (more detail there, less elsewhere) none
--format <FMT> Output format: text, markdown, or json text

Exit Codes

Code Meaning
0 Success (informational command)
2 Operational error (missing index)

Examples

# Compact overview for a session start hook
ctx map --budget 2000

# Zoom on one subsystem
ctx map --focus src/parser --budget 4000

# Markdown for pasting into a PR description or issue
ctx map --format markdown

Caveats

  • The map summarizes what the index knows: reindex after large changes, or the map lags the code.
  • Tight budgets drop detail deterministically (least-connected symbols first); raise --budget if a module you need is missing.

See Also

  • ctx smart - task-driven file selection (map is task-agnostic orientation)
  • Quality Gates - using ctx map in a SessionStart hook
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. yesterday First seen · 58 lines · 0 tokens per session scan A 69c5198089e0

Subscribe to this mod's changes

map is a command published in the GitHub repository agentis-tools/ctx (11 stars, last pushed 15d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 400 tokens. 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.