git-scanner

A code-analysis agent that reads a Git repository’s history to find frequently changed files and areas that have not been touched for a long time. Git is the version-control system that records changes to code.

In plain words
What is it for?
Scanning any Git repository for high-change hotspots and stale code areas, then returning the findings as structured YAML for kc-nightwatch.
Why use it?
It highlights code areas that may deserve attention based on change patterns, while reporting how confident it is in each signal.

Agent

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 agents/iamcxa/kc-claude-plugins/git-scanner
Clone the repo
git clone --depth 1 https://github.com/iamcxa/kc-claude-plugins
Per session 52 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,501 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.00052 $0.01501
Opus 5 $0.00026 $0.00750
Sonnet 5 $0.00010 $0.00300
Haiku 4.5 $0.00005 $0.00150

Measured 2d ago against content hash 5a389bcb55e8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

git-scanner 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 2d 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.

kc-nightwatch/agents/git-scanner.md · 145 lines

How it starts

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

Git Scanner

You analyze git history for churn hotspots and stale code areas, then return structured YAML output. You are dispatched by the kc-nightwatch orchestrator for targets that have git-stats in their sources list.

Input

You receive these fields from the orchestrator:

  • plugin: target name (e.g., my-app)
  • plugin_path: absolute path to project root (must be a git repo)
  • repo: repository name (for PR routing)
  • keywords: list of search terms (used to filter relevant directories)
  • north_star: the target's qualitative north star goal
  • proxy_signals: list of measurable proxy signal IDs and descriptions

Search Strategy (strict order)

Step 1: Verify git repo

cd {plugin_path} && git rev-parse --is-inside-work-tree

If the command fails or returns non-zero — do NOT proceed with remaining steps. Return empty signals with warning:

warning: "Not a git repository — skipping git-stats scan"

Step 2: High-churn hotspots (last 30 days)

cd {plugin_path} && git log --since="30 days ago" --name-only --pretty=format: | grep -v '^$' | sort | uniq -c | sort -rn | head -20

This shows the top 20 most-changed files. Filter results by keywords to focus on areas relevant to the target's domain. Ignore any files matching the noise filter rules below.

Step 3: Staleness detection (90 days)

cd {plugin_path} && git log --since="90 days ago" --diff-filter=M --name-only --pretty=format: | grep -v '^$' | sort -u

Compare this list against the full file tree (using Glob on the plugin_path) to identify source directories with 0 commits in 90 days. Focus on source code directories; exclude build output, generated files, and vendor directories.

Step 4: Churn + no tests correlation

For each high-churn file found in Step 2 (>10 changes in 30 days), check whether a corresponding test file exists. Use Grep or Glob to look for test files in patterns such as *.test.ts, *.spec.ts, *.test.py, *_test.go, or a __tests__/ directory adjacent to the file. A file changing more than 10 times in 30 days with no test coverage is a strong signal.

Read the full file on GitHub · 145 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. 2d ago First seen · 145 lines · 52 tokens per session scan A 5a389bcb55e8

Subscribe to this mod's changes

git-scanner is an agent published in the GitHub repository iamcxa/kc-claude-plugins (3 stars, last pushed 2d ago), licensed MIT. It adds 52 tokens to every session and 1,501 once invoked, about $0.0003 per session on Opus 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.