reform

reform is a command for Claude Code from treylom/knowledge-manager. It costs 45 tokens per session (2,684 once invoked), scanned A, original, MIT.

A command for planning and applying large changes across an Obsidian vault, a folder of linked notes. It can move files, update front matter and links, create a Git snapshot, and check links.

In plain words
What is it for?
Use it to plan or apply vault-wide file moves, metadata edits, link updates, and link checks, with separate modes for each kind of change.
Why use it?
It makes broad note reorganisations more controlled by previewing the changes and checking links before or after applying them.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Part of the km plugin — 10 skills, 10 commands, 2 agents shipped together

Good fit Use it to plan or apply vault-wide file moves, metadata edits, link updates, and link checks, with separate modes for each kind of change.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/treylom/knowledge-manager/reform
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.

Clone the repo
git clone --depth 1 https://github.com/treylom/knowledge-manager

Made for: Claude Code.

Or install km, the plugin that ships this one along with the rest of its 10 skills, 10 commands, 2 agents.

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 reform

README.md
[![agentmods](https://agentmods.dev/badge/commands/treylom/knowledge-manager/reform/github.svg)](https://agentmods.dev/commands/treylom/knowledge-manager/reform)
Your own site
<a href="https://agentmods.dev/commands/treylom/knowledge-manager/reform"><img src="https://agentmods.dev/badge/commands/treylom/knowledge-manager/reform/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for reform

Your own site · 80×15
<a href="https://agentmods.dev/commands/treylom/knowledge-manager/reform"><img src="https://agentmods.dev/badge/commands/treylom/knowledge-manager/reform.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,684 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00045 $0.02684
Opus 5.5 $0.00018 $0.01074
Sonnet 5.5 $0.00009 $0.00537
Haiku 4.5 $0.00005 $0.00268

Measured 1mo ago against content hash ef09aa98fddd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

reform 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 1mo 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/reform.md · 188 lines

How it starts

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

/km:reform — 대량 변형 (plan/apply/check)

$ARGUMENTS

엔진 인용 계약: 이 커맨드는 이동·frontmatter·링크 수정 로직을 새로 구현하지 않는다. apply ② 단계는 skills/km-archive-reorganization.md(이동 — Mode R)와 skills/km-batch-python.md(frontmatter·links)의 기존 절차를 그대로 따른다. 여기서 하는 일은 그 절차를 순서대로 호출하고, 실행 전후로 스냅샷·감사·게이트를 배선하는 것뿐이다.

0. 문법

/km:reform <plan|apply|move|frontmatter|links|check> [경로|계획서]
  • 인자 없음 = plan(vault 전체를 대상으로 계획서만 만든다).
  • move·frontmatter·links = 그 유형 하나만 다루는 plan 단축이다(예: /km:reform move → 이동 대상만 계획서에 담는다). apply 는 항상 먼저 만든 plan 산출물(계획서)을 인자로 받는다.
  • VAULT_PATH 는 commands/search.md Phase -1 과 동일 규칙으로 정한다(추측 ❌ — km-config.json → obsidian.json "open": true 판정 → 그래도 없으면 사용자에게 1회 질문). PLUGIN_ROOT 는 이 플러그인 루트(scripts/km_link_gate.py 가 있는 경로)로, 밖에서 주어진다.
  • 아래 절의 bash 블록은 $VAULT_PATH·$PLUGIN_ROOT·(있다면) $ARGUMENTS 세 값이 이미 정해져 있다고 가정한다.

1. plan (dry-run · 쓰기 = 계획서 1개뿐)

입력은 _meta/KM-DESIGN.md §G(있으면) 또는 사용자 서술이다. 이 단계는 노트·폴더를 건드리지 않는다 — vault 안에서 쓰는 파일은 계획서 1개뿐이다.

TS=$(date +%Y%m%d-%H%M%S)
SOURCE="${VAULT_PATH}/_meta/KM-DESIGN.md"
if [ -f "$SOURCE" ]; then SOURCE_DESC="$SOURCE (§G)"; else SOURCE_DESC="사용자 서술(대화 맥락) — $SOURCE 없음"; fi
PLAN="${VAULT_PATH}/_meta/REFORM-PLAN-${TS}.md"
mkdir -p "${VAULT_PATH}/_meta"

# 대상 계수(근사) — move|frontmatter|links 로 좁혀 부르면 그 유형 범위만 센다.
TARGET_COUNT=$(find "$VAULT_PATH" -name '*.md' -not -path '*/_meta/*' | wc -l | tr -d ' ')
LINK_COUNT=$(grep -rho '\[\[[^]]*\]\]' "$VAULT_PATH" --include='*.md' 2>/dev/null | wc -l | tr -d ' ')

# 헤더는 변수로 우회한다(heredoc 안 리터럴 '## ' 가 바깥 절 목차 grep 을 오염시키지 않게).
SEC_TARGET="## 대상"; SEC_LINK="## 예상 링크 영향"; SEC_ROLLBACK="## 롤백 방법"; SEC_ETA="## 소요 예측"

cat > "$PLAN" <<EOF
---
schema_version: km-reform-plan-v1
source: ${SOURCE_DESC}
created: $(date +%F)
---

# Reform Plan — ${TS}

${SEC_TARGET}
- 파일 수(근사, .md 전체 — 유형 지정 시 해당 범위만): ${TARGET_COUNT}
- 변경 유형: ${ARGUMENTS:-plan(전체)}

${SEC_LINK}
- 현재 wikilink 총량(근사): ${LINK_COUNT}
- 예상 깨짐 수: 이동 대상 파일명을 위 근사값에서 별도로 grep 해 채운다(노트·폴더는 이 단계에서 건드리지 않는다)

${SEC_ROLLBACK}
- apply 실행 전 자동 스냅샷(태그 또는 stash)을 남긴다 → \`git -C "$VAULT_PATH" reset --hard km-reform-pre-<ts>\`

${SEC_ETA}
- 범위: 파일 수 기준 대략(정확한 단일 수치 금지 — 범위로만 제시)
EOF
echo "저장: $PLAN"

Read the full file on GitHub · 188 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. 1mo ago First seen · 188 lines · 45 tokens per session scan A ef09aa98fddd

Subscribe to this mod's changes

reform is a command published in the GitHub repository treylom/knowledge-manager (248 stars, last pushed 6d ago), licensed MIT. It adds 45 tokens to every session and 2,684 once invoked, about $0.0002 per session on Opus 5.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-09-04.