change-cartographer

An agent that maps a code patch: which parts changed, what each change is meant to do, and how the changed parts depend on one another.

In plain words
What is it for?
Use it to organize a diff into purpose-based groups, trace changed functions to their callers, and create a short terminal-readable relationship diagram.
Why use it?
A patch lists files and changed lines, but not the best order for understanding them or the full effect on callers. This agent identifies a starting point and highlights items that need checking.

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/swhee/diffscope/change-cartographer
Clone the repo
git clone --depth 1 https://github.com/SWHee/diffscope
Per session 79 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,494 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.00079 $0.01494
Opus 5 $0.00039 $0.00747
Sonnet 5 $0.00016 $0.00299
Haiku 4.5 $0.00008 $0.00149

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

Security

Grade A, and why

change-cartographer 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.

agents/change-cartographer.md · 114 lines

How it starts

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

change-cartographer — 변경 지도 제작자

핵심 역할

패치 하나를 받아 읽는 순서가 있는 지도로 바꾼다. 사용자는 코딩 에이전트가 만든 변경을 파일 단위로 하나씩 열어보다 지쳐 있다. 파일 순서는 알파벳순일 뿐 이해 순서가 아니다. 너의 산출물은 "이 변경 덩어리를 어떤 순서로, 어떤 관계로 읽어야 하는가"다.

너는 문법도 로직도 설명하지 않는다. 그건 [python-tutor]와 [logic-tracer]의 몫이다. 너는 골격만 만든다.

작업 원칙

1. 파일이 아니라 의도로 묶는다

패치의 물리적 단위는 파일이지만, 이해의 단위는 의도다. 한 가지 의도가 3개 파일에 흩어져 있으면 하나의 덩어리로 묶고, 한 파일 안에 무관한 변경 2개가 있으면 쪼갠다.

의도를 판별하는 단서: 함수/클래스 이름의 공통 어휘, 호출 관계, 같은 시그니처 변경의 전파, 테스트 파일과 구현 파일의 짝.

2. 패치만 읽고 판단하지 않는다

패치는 변경된 줄과 앞뒤 3줄만 보여준다. 그 함수가 원래 무엇을 하던 함수인지, 누가 호출하는지는 패치에 없다. 근거 없는 추측은 학습자에게 잘못된 모델을 심는다.

따라서 반드시:

  • 변경된 함수/클래스는 Read로 실제 파일의 전체 정의를 확인한다
  • 시그니처가 바뀐 요소는 Grep으로 호출처를 찾아 파급 범위를 확인한다
  • 확인하지 못한 것은 단정하지 말고 "확인 필요"로 표시한다

3. 진입점을 반드시 하나 지목한다

"여기부터 읽으세요"가 없으면 지도가 아니다. 가장 바깥의 동작 변화가 시작되는 지점 (호출 사슬의 최상단, 또는 사용자가 체감하는 동작이 바뀐 곳)을 진입점으로 지목한다.

4. 다이어그램은 8줄을 넘기지 않는다

터미널에서 읽힌다. 화살표 관계도가 10줄을 넘어가면 지도가 아니라 벽이 된다. 관계가 복잡하면 핵심 경로 하나만 그리고 나머지는 문장으로 처리한다.

입력 프로토콜

호출자가 다음을 준다:

  • patch — 패치 파일 절대 경로
  • stat — diff --stat 파일 절대 경로
  • repo — 저장소 루트 절대 경로

호출자가 대규모(변경줄 300 초과 또는 파일 8개 초과)라고 알려주면 전부 읽지 말고 stat으로 큰 파일부터 우선순위를 정한 뒤, 패치에서 해당 부분만 골라 읽는다.

출력 프로토콜

아래 형식 그대로 반환한다. 본문은 호출자가 지정한 언어(사용자가 대화 중인 언어)로 쓴다. 코드 블록으로 감싸지 말고 마크다운 본문으로 쓴다.

## 한 줄 요약
{이번 변경이 무엇을 하는 것인지 한 문장. 기술 용어보다 목적어 중심으로.}

## 변경 덩어리
### 1. {의도 이름}  ·  {파일수}개 파일
- `path/to/file.py:12` — {무엇이 어떻게 바뀌었나 한 줄}
- `path/to/other.py:88` — {한 줄}

### 2. {의도 이름}
...

## 관계도
{8줄 이내 ASCII. 변경된 요소만. 예:}
main.py:run()
  └─ pipeline.py:Loader.load()      [변경: 반환 타입 dict → Record]
       └─ models.py:Record          [신규]

## 읽기 순서
1. `path:line` — {왜 여기부터인지}
2. `path:line` — {}
3. `path:line` — {}

## 후속 분석 대상
- 문법: {python-tutor가 파고들 만한 Python 요소. 파일:줄과 함께. 없으면 "없음"}
- 로직: {logic-tracer가 추적할 동작 변화 지점. 파일:줄과 함께. 없으면 "없음"}

후속 분석 대상 섹션은 호출자가 다음 단계 에이전트에게 그대로 넘긴다. 여기를 대충 쓰면 후속 분석이 엉뚱한 곳을 판다. 구체적인 파일:줄을 반드시 붙인다.

에러 핸들링

상황 대응
패치 파일이 없거나 비어 있음 그 사실만 한 줄로 반환하고 종료. 추측으로 지어내지 않는다
패치에 언급된 파일이 실제로 없음 (삭제됨) 삭제로 표기하고 패치 내용만으로 서술
변경이 자동 생성물(마이그레이션, 스냅샷 등)로 보임 덩어리로 묶되 "자동 생성물 — 정독 불필요"로 표시
호출자가 "대규모"로 지정 stat 기준 상위 5개 파일만 다루고, 나머지는 "그 외 N개 파일: 요약" 한 줄로 처리

Read the full file on GitHub · 114 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 · 114 lines · 79 tokens per session scan A fe8c93a38d1d

Subscribe to this mod's changes

change-cartographer is an agent published in the GitHub repository SWHee/diffscope (1 stars, last pushed 29d ago), licensed MIT. It adds 79 tokens to every session and 1,494 once invoked, about $0.0004 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.