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.
npx agentmods add commands/agentis-tools/ctx/sqlgit clone --depth 1 https://github.com/agentis-tools/ctxWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01363 |
| Opus 5 | $0.00000 | $0.00681 |
| Sonnet 5 | $0.00000 | $0.00273 |
| Haiku 4.5 | $0.00000 | $0.00136 |
Grade A, and why
sql 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.
How it starts
The opening of the file, as written. The whole thing — 158 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ctx sql
Run read-only SQL against the code-intelligence index through DuckDB, over a stable v1 view layer.
Synopsis
ctx sql [QUERY] [OPTIONS]
Description
ctx sql gives you raw SQL access to the code-intelligence index. Where the
canned ctx query subcommands answer fixed questions (callers, deps, impact),
ctx sql lets you ask arbitrary ones: aggregations, joins across symbols and
edges, and custom WHERE conditions. Prefer ctx sql whenever you need a
grouping, a join, or a filter the canned commands do not expose.
The query surface is the versioned v1 schema — a set of stable views
(v1.symbols, v1.edges, v1.files, v1.meta). See the full
SQL Schema (v1) reference for every column.
- Query
v1.*only. It is the compatibility contract: columns and views may be added withinschema_version1, but nothing is renamed or removed without bumpingv1.meta.schema_version. - Anything outside
v1.*is internal and unstable. The raw index is reachable ascode.*, but its shape can change at any time. Do not depend on it.
The query is read from the first of: the [QUERY] argument, --file, or stdin
(when QUERY is - or omitted and stdin is piped).
Programmatic use
For agents and scripts, pass --json for machine-readable rows and
--max-rows to bound the result set:
ctx sql --json --max-rows 50 "SELECT name, complexity FROM v1.symbols ORDER BY complexity DESC"
An index must exist first (ctx index); querying without one exits with code 2.
Options
| Option | Description | Default |
|---|---|---|
[QUERY] |
SQL text. If - or omitted while stdin is piped, read from stdin. |
— |
--file <PATH> |
Read the query from a file (mutually exclusive with QUERY). |
— |
--output <F> |
Output format: table, csv, or json. |
table |
--json |
Alias for --output json. |
— |
--max-rows <N> |
Cap returned rows (0 = unlimited). |
1000 |
--timeout <SECS> |
Abort the query after N seconds. | 10 |
--fail-on-rows |
Exit 1 if the query returns >= 1 row (for gate usage). |
false |
--schema |
Print the v1 schema reference and exit 0. |
— |
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.
- yesterday First seen · 158 lines · 0 tokens per session scan A 8322c7658f6b
sql 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 1,363 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.
Other commands, from other repositories
coograph-review
Review the changes in scope for spec compliance, convention violations, logic bugs, and architectural issues. You review — you do not author. Never edit files.
coograph-verify
Verify that the described work is complete and correct. Provide evidence for every claim. You verify — you do not implement or fix style.
api-gen
Generate REST API endpoints with routes, validation, error handling, and tests.
component-gen
Generate React or Vue components with prop types, styling, accessibility, and tests.
code-review
Review staged git changes for bugs, security issues, and style violations.
pr-description
Generate a PR title and description from the current branch diff against main.