score

A code-quality comparison command that measures how your changes differ from a chosen Git version. It reports changes in complexity, duplication, architecture-rule violations, and public symbols.

In plain words
What is it for?
Use it to review uncommitted work or commits, compare a branch with a Git reference, and fail automated checks when a chosen quality condition is not met.
Why use it?
It shows whether a change made the codebase better or worse instead of relying on guesswork. It can also flag quality problems in changed files.

Command

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.

agentmods
npx agentmods add commands/agentis-tools/ctx/score
Clone the repo
git clone --depth 1 https://github.com/agentis-tools/ctx
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,945 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.01945
Opus 5 $0.00000 $0.00972
Sonnet 5 $0.00000 $0.00389
Haiku 4.5 $0.00000 $0.00194

Measured yesterday against content hash fa2e775b62e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

score 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.

docs/commands/score.md · 178 lines

How it starts

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

ctx score

Score the quality delta of your changes against a git reference.

Synopsis

ctx score [--against <REF>] [--fail-on <EXPR>] [--json]

Description

The score command compares the working tree (plus commits since the merge base with REF) against REF and prints a compact scorecard. It answers "did this change make the code better or worse?" with numbers:

  • Complexity and fan-out deltas - per changed file, baseline vs. current
  • New duplication - near-duplicate function pairs that did not exist at REF
  • Architecture violations - the ctx check rules, scoped to the same REF
  • Symbols added / removed - API surface churn

The index is refreshed incrementally before scoring (a note: index refreshed (N files reindexed) notice goes to stderr). Baseline metrics are computed by parsing each changed file's content at REF in memory with the same parser used for indexing - nothing is written to the database, and both sides use the same method so the deltas are honest.

Options

Option Description Default
--against <REF> Git reference to compare against. The default scores uncommitted changes; use your default branch (main/master) to score a whole branch or PR HEAD
--fail-on <EXPR> Comma-separated conditions metric OP value with OP one of >=, <=, >, <; exit 1 when any condition holds none
--json Machine-readable output (global flag) false

Metrics

These names are used verbatim in --fail-on and under data.metrics in JSON:

Metric Meaning
complexity_delta Sum over changed files of per-function 2*fan_out + same-file fan_in, current minus baseline
fan_out_delta Call edges sourced in changed files, current minus baseline
new_duplication Verified near-duplicate pairs (Jaccard >= 0.85, >= 50 tokens, at least one endpoint in a changed file) that did not exist at REF
check_violations ctx check --against REF violations (0 with a note when .ctx/rules.toml is missing)
symbols_added Symbols present now but not at REF (matched by file, parent, and name)
symbols_removed Symbols present at REF but not now
files_changed Changed source files that were scored

Read the full file on GitHub · 178 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. yesterday First seen · 178 lines · 0 tokens per session scan A fa2e775b62e8

Subscribe to this mod's changes

score 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,945 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.