feat(claude): herdr の SessionStart フックを chezmoi 管理下に置く - #79
Merged
Conversation
settings.json が SessionStart で参照している ~/.claude/hooks/herdr-agent-state.sh が管理外だったため、新しいマシンで chezmoi apply してもこのファイルだけ配置されず、フックが参照先を失う。 herdr が生成するファイルなので二重管理になる点は承知の上で追加する。 現状は HERDR_INTEGRATION_VERSION=7 を固定することになるため、herdr 側の 統合を更新したあとは chezmoi re-add で取り込み直す必要がある。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tunepolo
force-pushed
the
feat/claude-herdr-hook
branch
from
August 20, 2026 06:05
15a0adb to
3d89131
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
dot_claude/settings.jsonが SessionStart フックとして参照している~/.claude/hooks/herdr-agent-state.shが chezmoi 管理外だった。新しいマシンでchezmoi applyしてもこのファイルだけ配置されないため、フックが参照先を失う。#78 で
dot_claude/hooks/が管理下に入ったので、同じディレクトリに揃える。変更点
dot_claude/hooks/executable_herdr-agent-state.shを追加(chezmoi addで取り込み)。スクリプト自体には手を入れていない。承知の上のトレードオフ
このファイルは herdr が生成し、ヘッダにも「reinstalling or updating the integration overwrites this file」と書かれている。chezmoi に入れると二重管理になる。
HERDR_INTEGRATION_VERSION=7を固定することになるchezmoi re-addで取り込み直す必要がある(忘れるとchezmoi applyが v7 に巻き戻す)それでも入れる判断にした理由は、新しいマシンでフックが黙って壊れるほうが気づきにくいため。ファイルを置かずに
settings.json側を「存在すれば実行する」形にする案もあるが、settings.jsonは #78 で触っているので分けている。別の形が良ければ差し替える。検証
shellcheck ~/.claude/hooks/herdr-agent-state.sh→ 終了コード 0。refactor(claude): 権限設定の棚卸しとBash実行ガードのフック切り出し #78 でshellcheck.shの対象にdot_claude/hooks/*.shを加えているので、両方マージ後も lint は通る#78 との関係
#78 はマージ済み。このブランチは origin/main に追従させたので、
shellcheck.shのdot_claude/hooks/*.sh対象にこのファイルも含まれた状態で CI が通っている。🤖 Generated with Claude Code