companion-preference

companion-preference is a command for Claude Code from naimkatiman/continuous-improvement. It costs 24 tokens per session (829 once invoked), scanned B, original, MIT.

A command that summarizes telemetry from the companion-preference hook, which records how coding-agent skills are routed and whether related companion plugins are installed.

In plain words
What is it for?
Use it to view totals by skill, action categories such as advisory or block, and the share of events where the companion plugin was installed.
Why use it?
It provides evidence about how often each routing action occurs instead of relying on assumptions about plugin usage.

Command for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node bin/companion-preference-status.mjs --json --all.

Good fit Use it to view totals by skill, action categories such as advisory…

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/naimkatiman/continuous-improvement
agentmods
npx agentmods add commands/naimkatiman/continuous-improvement/companion-preference

Made for: Claude Code.

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 companion-preference

README.md
[![agentmods](https://agentmods.dev/badge/commands/naimkatiman/continuous-improvement/companion-preference.svg)](https://agentmods.dev/commands/naimkatiman/continuous-improvement/companion-preference)
Your own site
<a href="https://agentmods.dev/commands/naimkatiman/continuous-improvement/companion-preference"><img src="https://agentmods.dev/badge/commands/naimkatiman/continuous-improvement/companion-preference.svg" alt="Measured on agentmods" 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 829 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.00024 $0.00829
Opus 5 $0.00012 $0.00415
Sonnet 5 $0.00005 $0.00166
Haiku 4.5 $0.00002 $0.00083

Measured 6d ago against content hash 05cc42843ed6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

companion-preference 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 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

3. If the CLI prints "no telemetry recorded yet," check three things in order: (a) `~/.claude/settings.json` has `continuous_improvement.companion_preference` set (otherwise the hook is a no-op and writes nothing); (b) t
commands/companion-preference.md · 59 lines

How it starts

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

/companion-preference

Read and aggregate the JSONL telemetry written by hooks/companion-preference.mjs. Reports per-skill totals, action breakdown (observation, advisory, block, block-not-installed), and the share of events where the companion plugin was installed at the time.

The dataset is the evidence base for a future companions-first default-flip decision — once a 7-day shadow shows the companions-first path firing on a meaningful share of routed Skill calls, with companions installed in the majority of them, the flip is grounded.

Trigger phrases

  • /companion-preference
  • /companion-preference status
  • "show companion preference stats"
  • "what does the companion-preference hook see"

What happens

  1. Run node bin/companion-preference-status.mjs from the repo root with the operator's chosen window. Default --days 7. Pass --all for the entire file or --days N for a different window.
  2. Render the table the CLI emits to the user verbatim. Do not paraphrase the numbers — the JSONL is authoritative.
  3. If the CLI prints "no telemetry recorded yet," check three things in order: (a) ~/.claude/settings.json has continuous_improvement.companion_preference set (otherwise the hook is a no-op and writes nothing); (b) the user has invoked at least one mapped CI skill (tdd-workflow, verification-loop, context-budget, ralph, learn-eval) since the hook landed; (c) the hook's PreToolUse registration is intact in plugins/continuous-improvement/hooks/hooks.json.
  4. Offer one decision-ready next step based on the totals — e.g., "ratio of observation rows with companion_installed=true suggests companions-first is safe to flip for X but not Y."

Subcommands

/companion-preference status (default)

Same as /companion-preference.

/companion-preference status --json

Emit the machine-readable JSON report. Useful when you want to pipe the output into another tool or write your own aggregator.

node bin/companion-preference-status.mjs --json --all

Read the full file on GitHub · 59 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 First seen · 59 lines · 24 tokens per session scan B 05cc42843ed6

Subscribe to this mod's changes

companion-preference is a command published in the GitHub repository naimkatiman/continuous-improvement (7 stars, last pushed today), licensed MIT. It adds 24 tokens to every session and 829 once invoked, about $0.0001 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-31.