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.
/plugin marketplace add iliaal/codesage/plugin install codesage-toolsWrote 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.
[](https://agentmods.dev/commands/iliaal/codesage/codesage-prompt-override)<a href="https://agentmods.dev/commands/iliaal/codesage/codesage-prompt-override"><img src="https://agentmods.dev/badge/commands/iliaal/codesage/codesage-prompt-override/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.
<a href="https://agentmods.dev/commands/iliaal/codesage/codesage-prompt-override"><img src="https://agentmods.dev/badge/commands/iliaal/codesage/codesage-prompt-override.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00034 | $0.00696 |
| Opus 5 | $0.00017 | $0.00348 |
| Sonnet 5 | $0.00007 | $0.00139 |
| Haiku 4.5 | $0.00003 | $0.00070 |
Grade B, and why
codesage-prompt-override scanned grade B with 1 finding 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 today.
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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
Print a short system-prompt fragment users can pipe into `claude --append-system-prompt-file -` or paste into `~/.claude/settings.json` (`appendSystemPrompt`). The fragment routes definitions and structural references to How it starts
The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CodeSage system-prompt override
Print a short system-prompt fragment users can pipe into claude --append-system-prompt-file - or paste into ~/.claude/settings.json (appendSystemPrompt). The fragment routes definitions and structural references to CodeSage and literal occurrences to Grep / rg, regardless of identifier spelling.
Pattern adopted from Serena's cc-system-prompt-override. Background: two consecutive measurements (2026-04-24 and 2026-04-30, harness at bench/agent-tool-selection-harness.py) showed agents pick CodeSage retrieval tools 0/10 even when whitelisted in --allowedTools. CLAUDE.md and tool-description hardening did not move the rate. The system-prompt slot is the next lever — the override fragment lands ahead of every user message and is tagged as system-level instruction, which is more salient than CLAUDE.md content.
What to do
-
Run
${CLAUDE_PLUGIN_ROOT}/bin/codesage-prompt-overrideand capture stdout. -
Show the user the fragment with three integration options:
-
One-shot: pipe into a single Claude session.
${CLAUDE_PLUGIN_ROOT}/bin/codesage-prompt-override | claude -p --append-system-prompt-file - 'your task' -
Per-session alias: shell function that wraps
claudefor the current shell. Suggest adding to~/.bashrc/~/.zshrc.codesage-claude() { "${HOME}/.claude/plugins/cache/iliaal/codesage/codesage-tools/bin/codesage-prompt-override" \ | claude --append-system-prompt-file - "$@" }The cache path uses the plugin's actual install location; if
${CLAUDE_PLUGIN_ROOT}resolves elsewhere on this machine, prefer that path. -
Persistent: append the fragment to
~/.claude/settings.jsonunder anappendSystemPromptkey. This applies to everyclaudeinvocation. Show the user the diff before writing.
-
-
Tell the user this is a measurement-driven change, not a default-on behavior. The 2026-04-30 rerun should be re-run after they've used the override for a session or two so we can quantify the delta. The harness lives at
bench/agent-tool-selection-harness.pyand accepts--append-system-prompt-file <path>.
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.
- today Changed df0e5db6b4fa
- 9d ago First seen · 41 lines · 34 tokens per session scan B 2230754f17c2
codesage-prompt-override is a command published in the GitHub repository iliaal/codesage (20 stars, last pushed yesterday), licensed MIT. It adds 34 tokens to every session and 696 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
call-graph
Trace callers, callees, or paths using the call graph.
index
Index the codebase for semantic search.
peek
Quickly find likely code locations without returning full code.
search
Search codebase by meaning using semantic search.
visualize
Generate temporal HTML call graph visualization.
definition
Find where a symbol is defined in the codebase.