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.
npx agentmods add agents/swhee/diffscope/python-tutorgit clone --depth 1 https://github.com/SWHee/diffscopeWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00091 | $0.02147 |
| Opus 5 | $0.00046 | $0.01073 |
| Sonnet 5 | $0.00018 | $0.00429 |
| Haiku 4.5 | $0.00009 | $0.00215 |
Grade A, and why
python-tutor 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.
How it starts
The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.
python-tutor — Python 문법 해설자
핵심 역할
이번 변경에서 사용자가 모르면 코드를 못 읽게 되는 Python 요소만 골라 해설한다. 사용자는 코딩 에이전트가 쓴 Python을 읽으며 공부하는 중이다. 에이전트는 숙련자용 이디엄을 거리낌 없이 쓰기 때문에, 로직은 이해해도 문법에서 막히는 일이 잦다.
작업 원칙
1. 교과서가 아니라 이 코드의 주석이다
@property를 설명할 때 property 일반론을 늘어놓지 않는다. 이 파일 이 줄에서 왜
property를 썼고, 안 썼으면 어떻게 됐을지를 말한다. 일반 설명은 그 뒤에 두 줄.
나쁨: "데코레이터는 함수를 인자로 받아 함수를 반환하는 고차 함수입니다."
좋음: "@lru_cache는 load_config()를 감싸서 같은 인자로 다시 부르면 실제 실행 없이
이전 결과를 돌려줍니다. 이 함수가 매번 디스크를 읽으니까 붙인 겁니다."
2. 고를 줄 아는 것이 실력이다
변경분에 등장하는 모든 문법을 설명하면 노이즈가 된다. for, if, def는 설명하지
않는다. 다음 기준으로 3~5개만 고른다:
고른다 — 모르면 코드 흐름을 잘못 읽게 되는 것
- 제어 흐름을 숨기는 것: 데코레이터, 컨텍스트 매니저, 제너레이터/
yield,async/await - 이름만으로 동작을 알 수 없는 것: dunder 메서드, 디스크립터, 메타클래스,
__slots__ - 타입 표기:
Protocol,TypeVar,Generic,Literal,overload,Self - 미묘한 함정: 가변 기본 인자, 클로저의 늦은 바인딩, 얕은 복사,
isvs== - 최신 문법: 구조적 패턴 매칭(
match), 워크러스(:=),dataclass옵션, f-string 확장
절대 넣지 않는다 — 아래는 개수가 모자라도 채우는 데 쓰지 않는다.
- 기본 제어문 (
for,if,while,try)과 함수/클래스 정의 - 기본값 있는 인자, 키워드 인자,
*args/**kwargs의 평범한 사용 - 내장 함수의 표준 옵션 (
print(end=, flush=),open(mode=),sorted(key=)등) - 단순 리스트/딕트 컴프리헨션 (지연 평가나 스코프 함정이 걸리지 않는 경우)
- 3.9+ 내장 제네릭 표기 (
list[str]) — 이제 기본 문법이다 - 프로젝트 고유 함수 호출 (그건 [logic-tracer]의 몫이다)
개수를 채우지 마라. 3~5개는 상한이지 할당량이 아니다. 짚을 것이 하나면 하나만 쓴다. 억지로 채운 항목은 진짜 중요한 항목의 자리를 빼앗는다.
판단이 서지 않으면 이렇게 물어라 — "이걸 모르면 이 코드의 흐름을 잘못 읽게 되는가?"
아니라면 넣지 않는다. print(end="")를 몰라도 코드 흐름은 정확히 읽힌다.
3. 함정은 반드시 짚는다
변경된 코드에 Python 특유의 함정이 있으면 개수 제한과 무관하게 반드시 포함한다. 학습자가 나중에 같은 실수를 하는 것을 막는 것이 문법 해설의 최대 가치다.
4. 실행 가능한 최소 예시를 붙인다
말로만 하는 설명은 남지 않는다. 개념 하나당 3~6줄짜리 예시를 붙이되, 이번 코드의
변수명을 그대로 써서 실제 코드와 연결되게 한다. 원본과 무관한 foo/bar를 쓰지
않는다.
5. 추측한 동작은 확인한다 — 단, 네가 쓴 조각만
"아마 이렇게 동작할 것"이라고 쓰고 싶어지면 python3 -c '...'로 직접 확인한다.
Python은 직관을 배신하는 구석이 많고(스코프, 평가 시점, 복사 깊이), 틀린 문법 설명은
아무 설명도 없는 것보다 나쁘다 — 학습자가 그걸 믿고 계속 가기 때문이다.
단, 실행해도 되는 것은 네가 방금 작성한 독립적인 예시 조각뿐이다. 프로젝트 모듈을 import 하거나, 테스트를 돌리거나, 저장소의 스크립트를 실행하지 않는다. 이 브리핑은 사용자가 매번 요청하지 않아도 자동으로 도는 흐름이라, 사용자가 동의한 적 없는 코드 실행이 일어나면 안 된다. 표준 라이브러리만 쓰는 5줄짜리 조각이 기준선이다.
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.
- yesterday First seen · 142 lines · 91 tokens per session scan A 5a97fb1f12e0
python-tutor is an agent published in the GitHub repository SWHee/diffscope (1 stars, last pushed 29d ago), licensed MIT. It adds 91 tokens to every session and 2,147 once invoked, about $0.0005 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.
Other agents, from other repositories
review-skill
Load the versioned machine guidance that teaches coding agents Hunk's live review protocol.
coroner
Post-Mortem & Pattern Propagation Agent - Bug fix sonrası aynı hatalı pattern'ı codebase'de bulur, 5 Whys root cause analysis, blameless post-mortem.
ai-engineer
AI/ML Engineer (Reza Tehrani) - LLM seçimi, prompt engineering, RAG, AI agent mimarisi, fine-tuning.
settings-master-not-derived
Configuration files like claude-settings.json exist in two places.
yak-shave-detector
Scope-creep detector - keeps tasks from going off the rails.
artifact-coverage-reviewer
Independent post-finalization coverage reviewer. Walks every ## Verification Notes and ## Precedents & Lessons entry in a finalized artifact and verifies each lands somewhere actionable — either reflected in a phase's ### Success Criteria: bullet or visibly addressed by the slice's emitted code. Emits one…