ctx

ctx is a command for Claude Code from knitli/toolshed. It costs 24 tokens per session (1,234 once invoked), scanned A, original, MIT.

A command that audits the repository’s AI instruction files, checking what exists, whether the files are outdated, and whether different tools contain conflicting guidance.

In plain words
What is it for?
Discovering context files, checking them against the codebase, and comparing instructions across tools such as Claude and Serena.
Why use it?
It helps find missing, stale, or contradictory instructions before they cause an AI agent to work incorrectly.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the ctx plugin — 2 skills, 5 commands, 2 agents shipped together

Good fit Discovering context files, checking them against the codebase, and comparing instructions across tools such as Claude and Serena.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add knitli/toolshed
Claude Code
/plugin install ctx

Made for: Claude Code.

Or install ctx, the plugin that ships this one along with the rest of its 2 skills, 5 commands, 2 agents.

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 ctx

README.md
[![agentmods](https://agentmods.dev/badge/commands/knitli/toolshed/ctx/github.svg)](https://agentmods.dev/commands/knitli/toolshed/ctx)
Your own site
<a href="https://agentmods.dev/commands/knitli/toolshed/ctx"><img src="https://agentmods.dev/badge/commands/knitli/toolshed/ctx/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 ctx

Your own site · 80×15
<a href="https://agentmods.dev/commands/knitli/toolshed/ctx"><img src="https://agentmods.dev/badge/commands/knitli/toolshed/ctx.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,234 The whole file, excluding the scripts and references it only reads on demand.
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.00024 $0.01234
Opus 5.5 $0.00010 $0.00494
Sonnet 5.5 $0.00005 $0.00247
Haiku 4.5 $0.00002 $0.00123

Measured 1mo ago against content hash 46a0928e6527, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

plugins/ctx/commands/ctx.md · 86 lines

How it starts

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

/ctx — Full Context Audit

Run a complete context hygiene audit: discover all AI context files, check them for staleness against the actual codebase, and detect drift/contradictions across tool boundaries.

Arguments

$ARGUMENTS

  • No arguments: audit everything — full discovery, check all files, detect all drift.
  • File paths (e.g., /ctx CLAUDE.md): scope all three phases to just those files. Discovery still runs (to build the full inventory for drift comparison), but staleness checking and drift detection focus on the named files.
  • Ecosystem names (e.g., /ctx cursor serena): scope to all context files belonging to those ecosystems (as defined in the INI).

Instructions

You are running a context hygiene audit on this repository. Complete all three phases in order, then produce a summary report. If the user provided arguments above, scope your work accordingly — but always run discovery first to establish the full context file inventory.

Phase 1: Discovery

Scan the repository for ALL AI context files using the plugin's authoritative ecosystem inventory at ${CLAUDE_PLUGIN_ROOT}/data/context-files.ini. Read that file first — it lists every ecosystem, root file, nested memory file, tool directory, config file, and ignore directory the plugin knows about. Any entry there is in scope; entries not there are not (unless caught by heuristics, below).

The INI currently covers ~15 ecosystems: Claude Code, universal AGENTS.md, Gemini, OpenAI Codex, Cursor, Windsurf, Continue, Roo/Cline, Crush, Aider, Serena, spec-kit, GitHub agents/skills, VS Code, and planning/output directories. See /ctx:discover for the full treatment.

Heuristic checks (beyond the INI's exact-match list):

  • Any markdown file in repo root with an ALL_CAPS filename not in the allcaps_exclude list under [heuristics] in the INI.
  • Symlinks between context files (e.g., GEMINI.md → CLAUDE.md).
  • Files containing phrases like "when working with this repo", "you are an AI", "assistant instructions" — these are often context files regardless of extension or location.

Read the full file on GitHub · 86 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. 1mo ago First seen · 86 lines · 24 tokens per session scan A 46a0928e6527

Subscribe to this mod's changes

ctx is a command published in the GitHub repository knitli/toolshed (1 stars, last pushed yesterday), licensed MIT. It adds 24 tokens to every session and 1,234 once invoked, about $0.0001 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.