plan-attest — команда для Claude Code: что делает и как установить
Команда plan-attest фиксирует содержимое task_plan.md с помощью хэша SHA-256. Хуки блокируют инъекцию плана в модель, если файл изменился без повторного подтверждения.
MIT ★ 28 179 обновлён 2026-11-04
/plugin marketplace add OthmanAdi/planning-with-files
/plugin install planning-with-files@planning-with-filesЧто делает plan-attest
Команда передаёт выполнение скрипту attest-plan.sh или attest-plan.ps1 из репозитория planning-with-files и сохраняет контрольную сумму текущего плана. Вызов самой языковой модели для этой операции отключён. Функция появилась в релизе v2.37.0.
После фиксации хуки UserPromptSubmit и PreToolUse сверяют task_plan.md с сохранённым значением. При расхождении хук выводит [PLAN TAMPERED — injection blocked] вместо передачи плана в контекст сессии.
В PowerShell работают флаги -Show и -Clear, но параметра -Target нет. Если скрипт обнаружит несколько активных планов, он откажется выбирать автоматически и потребует точный PLAN_ID.
Какие задачи решает
- Защитить task_plan.md от несанкционированных правок во время сессии
- Заблокировать подачу изменённого плана в промпты и вызовы инструментов
- Проверить сохранённый хэш плана и путь к файлу фиксации
- Снять блокировку плана для внесения изменений
Примеры запросов агенту
- /plan-attest
- /plan-attest --show
- /plan-attest --clear
Как установить plan-attest
1Через маркетплейс плагинов
/plugin marketplace add OthmanAdi/planning-with-files/plugin install planning-with-files@planning-with-files2Вручную: положить файлы
.claude/commands/plan-attest.mdВызов — /plan-attest. Для всех проектов — ~/.claude/commands/
Вручную: положить файлы
~/.codex/prompts/plan-attest.mdВызов — /prompts:plan-attest. В Codex этот формат помечен устаревшим, замена — скиллы
Вручную: положить файлы
.github/prompts/plan-attest.prompt.mdВручную: положить файлы
.gemini/commands/plan-attest.tomlGemini хранит команды в TOML: текст запроса — в поле prompt
Вопросы о plan-attest
Как установить plan-attest в Claude Code?
Выполните в терминале /plugin marketplace add OthmanAdi/planning-with-files, а затем запустите /plugin install planning-with-files@planning-with-files. Также файл команды можно сохранить в .claude/commands/plan-attest.md.
Что делает команда plan-attest?
Она вычисляет SHA-256 хэш для текущего task_plan.md и сохраняет его. До повторного подтверждения хуки сверяют файл с этим слепком при каждом сообщении.
Что произойдёт, если изменить task_plan.md после фиксации?
Хуки зафиксируют несовпадение контрольной суммы и выдадут [PLAN TAMPERED — injection blocked]. Чтобы продолжить работу с новым содержимым, запустите /plan-attest заново или снимите защиту через /plan-attest --clear.
Исходный текст
plan-attest.md · MIT
---
description: "Lock the current task_plan.md content with a SHA-256 attestation. Hooks then refuse to inject plan content if the file diverges from the attested hash, blocking silent tampering. Use --show to print the stored hash, --clear to remove the attestation. Available since v2.37.0."
disable-model-invocation: true
allowed-tools: "Bash"
---
Run the plan attestation helper for the active plan.
Steps:
1. Forward the requested operation to the installed helper: `--show` or `--clear` for `attest-plan.sh`, `-Show` or `-Clear` for `attest-plan.ps1`, or no flag to attest.
2. Let that helper resolve the selected plan and storage path. Do not reproduce its selection logic or write an attestation manually.
3. If it reports an invalid explicit selector or multiple named plans, stop and ask for the exact `PLAN_ID`; do not substitute another task.
4. Report the helper's result and storage path to the user, including `Multiple plans are available` when it refuses ambiguity. The shared pointer does not bind a parallel session.
An explicit `${PLAN_ID}` or `${PWF_PLAN_ROOT}` that does not resolve exits with an error. It never falls back to another plan.
Implementation:
- On Linux/macOS/Git Bash: `sh ${CLAUDE_PLUGIN_ROOT}/scripts/attest-plan.sh`
- On Windows PowerShell plugin installs: `& "$env:CLAUDE_PLUGIN_ROOT\scripts\attest-plan.ps1"`
- On Windows PowerShell standalone installs: `& "$env:USERPROFILE\.claude\skills\planning-with-files\scripts\attest-plan.ps1"`
Flags:
- `--show` — print the currently stored hash and where it lives.
- `--clear` — remove the attestation (re-open the plan to free editing).
- Shell `--target root` or `--target <plan-id>` selects an explicit attestation target for this call; forward it when requested. PowerShell has `-Show` and `-Clear`, but no `-Target` parameter.
After running an attestation, every UserPromptSubmit and PreToolUse hook fire compares `task_plan.md` against the stored hash. If they diverge, the hook emits `[PLAN TAMPERED — injection blocked]` instead of feeding plan content into the model. Re-run `/plan-attest` whenever you intentionally edit and re-approve the plan.
© OthmanAdi · MIT · OthmanAdi/planning-with-files