codesage-prompt-override

codesage-prompt-override is a command for Claude Code from iliaal/codesage. It costs 34 tokens per session (696 once invoked), scanned B, original, MIT.

A command that prints instructions for Claude Code to prefer CodeSage's code-retrieval tools over Grep for certain searches. Grep is a command-line tool that finds matching text in files.

In plain words
What is it for?
It is for generating a system-prompt fragment and using it once per session or adding it to Claude Code settings so retrieval questions are routed to the specified CodeSage tools.
Why use it?
It addresses situations where Claude Code chooses ordinary text search even when a code-aware retrieval tool would better answer questions about structure or impact.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

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 codesage-tools plugin — 1 skill, 10 commands, 2 agents, 1 hook shipped together

Good fit It is for generating a system-prompt fragment and using it once per session or adding it to Claude Code settings so retrieval questions are routed to the specified CodeSage tools.

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 iliaal/codesage
Claude Code
/plugin install codesage-tools

Made for: Claude Code.

Or install codesage-tools, the plugin that ships this one along with the rest of its 1 skill, 10 commands, 2 agents, 1 hook.

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 codesage-prompt-override

README.md
[![agentmods](https://agentmods.dev/badge/commands/iliaal/codesage/codesage-prompt-override/github.svg)](https://agentmods.dev/commands/iliaal/codesage/codesage-prompt-override)
Your own site
<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.

agentmods 80×15 button for codesage-prompt-override

Your own site · 80×15
<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>
Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 696 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00034 $0.00696
Opus 5 $0.00017 $0.00348
Sonnet 5 $0.00007 $0.00139
Haiku 4.5 $0.00003 $0.00070

Measured today against content hash df0e5db6b4fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

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
plugins/codesage-tools/commands/codesage-prompt-override.md · 41 lines

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

  1. Run ${CLAUDE_PLUGIN_ROOT}/bin/codesage-prompt-override and capture stdout.

  2. 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 claude for 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.json under an appendSystemPrompt key. This applies to every claude invocation. Show the user the diff before writing.

  3. 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.py and accepts --append-system-prompt-file <path>.

Read the full file on GitHub · 41 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. today Changed df0e5db6b4fa
  2. 9d ago First seen · 41 lines · 34 tokens per session scan B 2230754f17c2

Subscribe to this mod's changes

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.