cortex-reroute

cortex-reroute is a skill for Claude Code, Codex from amitvijapur/cortex. It costs 52 tokens per session (767 once invoked), scanned A, original, MIT.

A command for correcting the most recent Cortex routing decision and recording the route the user actually wanted.

In plain words
What is it for?
It helps mark a routing choice as corrected, save the preferred system or agent, and optionally record a new linked routing decision.
Why use it?
It preserves the correction as feedback so future routing can learn from a mismatch between the chosen and preferred route.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps mark a routing choice as corrected, save the preferred system or agent, and optionally record a new linked routing decision.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/amitvijapur/cortex/cortex-reroute
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.

Any agent
npx skills add amitvijapur/cortex --skill cortex-reroute
Clone the repo
git clone --depth 1 https://github.com/amitvijapur/cortex

Made for: Claude Code, Codex.

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 cortex-reroute

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/amitvijapur/cortex/cortex-reroute"><img src="https://agentmods.dev/badge/skills/amitvijapur/cortex/cortex-reroute.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 767 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.00052 $0.00767
Opus 5.5 $0.00021 $0.00307
Sonnet 5.5 $0.00010 $0.00153
Haiku 4.5 $0.00005 $0.00077

Measured 6d ago against content hash 1a9469b597b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cortex-reroute 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 6d 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.

skills/cortex-reroute/SKILL.md · 77 lines

How it starts

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

/cortex-reroute

Flag the most recent route in the current project and agent session as outcome=corrected and record the route the user wanted instead. This is the highest-quality training signal for Phase 3 (similarity bias) when it activates.

When to invoke

  • User types /cortex-reroute "<corrected route>" explicitly
  • User says "reroute" / "actually use X" / "we should've used Y" right after a routing line
  • User says "the right route was..." / "should've been..." / "redo with..."
  • Any clear post-hoc correction of the last logged route

What to do

Step 1 — Mark the last entry as corrected

Resolve the state directory from CORTEX_HOME, then CLAUDE_DIR, then $HOME/.claude, matching the CLI and installer. Keep a custom override exported in the agent's environment.

cortex_state_dir="${CORTEX_HOME:-${CLAUDE_DIR:-$HOME/.claude}}"
python3 "$cortex_state_dir/bin/cortex" reroute --to "<the route the user wanted>"

The CLI:

  • Appends a correction for the latest route in the current project and session
  • Stores the user's preferred route in user_correction
  • Prints the before → after delta

If the CLI cannot identify that session, inspect cortex history <task_hash> and pass the intended route's exact ID with --ref. Never pick another project's route or infer a target from an ambiguous legacy ID.

Step 2 — Log the new route

If the user wants the corrected route to actually run now, log it as a fresh entry with --redirect-from so the two are linked:

cortex_state_dir="${CORTEX_HOME:-${CLAUDE_DIR:-$HOME/.claude}}"
python3 "$cortex_state_dir/bin/cortex" log \
  --task "<same task as before>" \
  --class <class> \
  --system <new system> \
  --pattern <new pattern> \
  --agent "<new agent>" \
  --tier <new tier> \
  --tier-reason "<...>" \
  --system-reason "User redirected from <old route>" \
  --redirect-from "<old route>"

The redirect_from field links the corrected entry to the new one — Phase 3 uses this to learn "Cortex picked X, user wanted Y" deltas.

Read the full file on GitHub · 77 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. 6d ago Changed · +6 lines 1a9469b597b3
  2. 1mo ago Changed · +5 lines 95335dc8780f
  3. 1mo ago First seen · 66 lines · 52 tokens per session scan A e05f7c31a03c

Subscribe to this mod's changes

cortex-reroute is a skill published in the GitHub repository amitvijapur/cortex (5 stars, last pushed 3d ago), licensed MIT. It adds 52 tokens to every session and 767 once invoked, about $0.0002 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.