cochange

cochange is a command for coding agents from vynazevedo/first-plan. It costs 34 tokens per session (974 once invoked), scanned A, original, MIT.

A command that uses Git history to show which files tend to change together with a specified file.

In plain words
What is it for?
Use it before implementation to find likely consumers, tests, configuration, or other files to review.
Why use it?
It reveals related files that are easy to overlook when planning a code change.

Command

Part of the fp plugin — 19 skills, 19 commands, 4 agents, 1 hook shipped together

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/vynazevedo/first-plan/cochange
Clone the repo
git clone --depth 1 https://github.com/vynazevedo/first-plan

Or install fp, the plugin that ships this one along with the rest of its 19 skills, 19 commands, 4 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 cochange

README.md
[![agentmods](https://agentmods.dev/badge/commands/vynazevedo/first-plan/cochange.svg)](https://agentmods.dev/commands/vynazevedo/first-plan/cochange)
Your own site
<a href="https://agentmods.dev/commands/vynazevedo/first-plan/cochange"><img src="https://agentmods.dev/badge/commands/vynazevedo/first-plan/cochange.svg" alt="Measured on agentmods" 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 974 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.00034 $0.00974
Opus 5 $0.00017 $0.00487
Sonnet 5 $0.00007 $0.00195
Haiku 4.5 $0.00003 $0.00097

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

Security

Grade A, and why

cochange 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 5d 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.

commands/cochange.md · 124 lines

How it starts

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

/fp:cochange

Query do Co-change Graph.

Argumentos

$ARGUMENTS - path de arquivo (ex: internal/payment/charge.go).

Workflow

Passo 1 - Pre-flight

Verificar .first-plan/02-conventions/co-change.md ou .first-plan/08-meta/co-change.json existe. Se não, recomendar /fp:refresh 02-conventions.

Passo 2 - Lookup

Ler 08-meta/co-change.json, filtrar pares onde file_a == $ARGUMENTS ou file_b == $ARGUMENTS.

Se cache stale (> 14 dias), rodar inline:

git log --since="180 days ago" --name-only --pretty=format:"COMMIT:%H" --no-merges | \
  awk -v target="$ARGUMENTS" '
    /^COMMIT:/ { commit=$0; next }
    /./ { files[NR]=$0; commit_files[commit] = commit_files[commit] " " $0 }
    END {
      for (c in commit_files) {
        if (commit_files[c] ~ target) {
          n = split(commit_files[c], arr, " ")
          for (i=1; i<=n; i++) if (arr[i] != target && arr[i] != "") count[arr[i]]++
          total++
        }
      }
      for (f in count) printf "%.2f %d %s\n", count[f]/total, count[f], f
    }
  ' | sort -rn | head -10

Passo 3 - Apresentar

=== Co-change graph para internal/payment/charge.go ===

Total commits afetando este arquivo (180 dias): 18

Top co-changers:

| Arquivo | Ratio | Commits compartilhados | Strength |
|---------|-------|------------------------|----------|
| internal/payment/invoice.go | 0.94 | 17/18 | strong |
| internal/handler/payment.go | 0.83 | 15/18 | moderate |
| internal/payment/refund.go | 0.72 | 13/18 | moderate |
| internal/payment/test_helpers.go | 0.61 | 11/18 | weak |

Cluster detectado: payment-subsystem
  Outros membros: internal/payment/refund.go, internal/handler/payment.go

Implicação:
- Antes de mexer em charge.go, considerar tocar nos co-changers strong
- Se PR atual modifica apenas charge.go, alta chance de regressão em invoice.go
- Cluster payment-subsystem indica boundary de módulo - mudanças tipicamente afetam todos

Passo 4 - Sem co-changers detectados

=== Co-change graph para internal/util/format.go ===

Total commits afetando este arquivo (180 dias): 3

Sem co-changers significativos (insufficient sample size: precisa >= 5 commits).

Possíveis razões:
- Arquivo novo (criado recentemente)
- Arquivo estável (raramente mudado)
- Frozen zone (sem manutenção ativa)

Considere:
- /fp:hot para verificar se está frozen
- /fp:owner internal/util/format.go para descobrir dono

Read the full file on GitHub · 124 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. 5d ago First seen · 124 lines · 34 tokens per session scan A 09d199a32fd3

Subscribe to this mod's changes

cochange is a command published in the GitHub repository vynazevedo/first-plan (23 stars, last pushed 10d ago), licensed MIT. It adds 34 tokens to every session and 974 once invoked, about $0.0002 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-30.