ctx

A codebase exploration and governance guide built around the indexed ctx command-line tool. It uses symbols and relationships in the code to examine structure, dependencies, duplication, hotspots, and quality rules.

In plain words
What is it for?
Use it to map a repository, locate code and callers, estimate impact, find similar code, inspect hotspots, and run quality checks.
Why use it?
It reduces guesswork when changing an unfamiliar repository and helps check whether a change increases maintenance or breaks stated rules.

Skill for Claude CodeCodex

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 skills/agentis-tools/ctx/templates
Any agent
npx skills add agentis-tools/ctx --skill templates
Clone the repo
git clone --depth 1 https://github.com/agentis-tools/ctx

Made for: Claude Code, Codex.

Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,561 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00060 $0.01561
Opus 5 $0.00030 $0.00781
Sonnet 5 $0.00012 $0.00312
Haiku 4.5 $0.00006 $0.00156

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

Security

Grade A, and why

ctx 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 2d ago.

The scan reads SKILL.md. This mod also ships 6 executable files (codex-post-tool-use.sh, codex-session-start.sh, codex-stop.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Origin

This is a copy

100% identical to ctx — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

src/harness/templates/SKILL.md · 140 lines

How it starts

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

ctx — code intelligence and governance

Use ctx's indexed symbol and relationship model before text-only search. Treat its quality metrics as evidence to investigate, not automatic proof that code is wrong.

Exit codes are 0 clean, 1 findings, 2 operational error, and 3 only for an unmet ctx harness compat version requirement. Never report a gate as passed after an operational error.

Keep the index fresh

ctx index            # incremental; run after pulling or material edits
ctx index --force    # full rebuild after schema changes or corruption

Route the question

Question Start with
How is this repository organized? ctx map --budget 2000
Where is a symbol or concept? ctx query find, ctx search, ctx source
What depends on this code? ctx query callers, ctx query impact
Does an implementation already exist? ctx similar, then ctx duplicates
Did this branch make quality worse? ctx score --against <base>
Does this change violate policy? ctx check --against <base>
Where is current maintenance pressure? ctx hotspots
Is health changing across commits? ctx sql --snapshots=<dir>

Load the verified recipe for the problem

The cookbook pages are executable workflows with observed limitations, not command advertisements. Open the matching page when the task needs more than the routing command:

Symptom Recipe
Unfamiliar repository Orientation
Context is too large or incomplete Smallest useful context
Behavior may already exist Existing implementations
A small edit may have hidden consumers Blast radius
Implementing with an uncertain working set Evidence-backed implementation
Failing test in a large subsystem Focused debugging
Large branch review Risk-routed review
PR gate inherits old debt PR governance
Gate blocks a legitimate change Gate recovery
Fork PR needs a published report Untrusted CI
Boundaries are eroding Architecture drift
The same code keeps changing Chronic hotspots
High complexity may be intentional Intentional complexity
Duplication is growing Duplication trajectories
Health direction or release decision Continuous health and release health

Read the full file on GitHub · 140 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. 2d ago First seen · 140 lines · 60 tokens per session scan A b2f16f049637

Subscribe to this mod's changes

ctx is a skill published in the GitHub repository agentis-tools/ctx (11 stars, last pushed 16d ago), licensed Apache-2.0. It adds 60 tokens to every session and 1,561 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to ctx, differing in 2 lines, and is treated as a copy.

Related

Other skills, from other repositories

new-plugin

Factory line for adding a new HAR verification plugin (like playwright or rocketsim) for any framework — research the framework docs, build the template under src/templates/plugins/, register it everywhere, validate on a real repository, and open a PR. Use when asked to add/create a plugin, plugin template, or…

os-factory/har · 89 tokens

factory-line

Factory line for executing one station of a declared multi-station program — read the installed line bundle (har line status), plan parallel work into isolated HAR slots, run the cumulative gate with har line gate, and hand off for human review. Use when asked to "run a factory line", "run the next station", "execute…

os-factory/har · 101 tokens

v1-milestone

Factory line for executing one milestone of the HAR v1.0.0 refactor (epic os-factory/har#225) — plan the wave of parallel subagents, implement each issue in its own HAR slot, ship stacked PRs, run the fixture-e2e milestone gate, and hand off for review. Use when asked to "run the next v1 milestone", "work on v1.0.0"…

os-factory/har · 110 tokens

alego-pre-push-checks

Use before pushing, force-pushing, marking ready for review, or claiming checks pass on an alego branch, and immediately after gh stack sync publishes rewritten branches, to select the smallest tests and checks that cover the outgoing or just-published diff without reflexively running the full repository suite.

singula-ai/alego · 66 tokens

alego-doc-site-sync

Use when publishing, updating, moving, or removing Alego documentation website pages; editing website/docs.ts mappings or navigation; diagnosing a page missing from the VitePress site; fixing projected documentation links; or running the docs:dev, docs:check, and doc-sync workflow after website-content changes.

singula-ai/alego · 66 tokens

editing-cordis-compositions

Use when creating, changing, or validating a Cordis composition for this harness — writing or editing an agent preset, adding or removing a plugin row, deciding whether something belongs to the host composition or to one session, checking whether a preset you authored actually mounts, or diagnosing a row that mounted…

singula-ai/alego · 69 tokens