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
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-planning-with-files-e97401bd807c ,按照其中的说明把「plan-attest」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Run the plan attestation helper for the active plan.
Steps:
${PLAN_ID} env var, then .planning/.active_plan, then newest .planning/<dir>/. If the current directory is itself a valid .planning/<slug>/ directory, use its task_plan.md. Otherwise use legacy ./task_plan.md.task_plan.md..planning/<active-plan>/.attestation (parallel-plan mode) or ./.plan-attestation (legacy mode).An explicit ${PLAN_ID} or ${PWF_PLAN_ROOT} that does not resolve exits with an error. It never falls back to another plan.
Implementation:
sh ${CLAUDE_PLUGIN_ROOT}/scripts/attest-plan.sh& "$env:CLAUDE_PLUGIN_ROOT\scripts\attest-plan.ps1"& "$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).After running this command, 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.