Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Li+claude.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Skipped if {workspace_root}/.claude/settings.json already contains "UserPromptSu
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/on-user-prompt.sh"
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/on-user-prompt.sh\""
}
]
}
Expand All @@ -31,7 +31,7 @@ Skipped if {workspace_root}/.claude/settings.json already contains "UserPromptSu
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/post-tool-use.sh"
"command": "bash \"$CLAUDE_PROJECT_DIR/.claude/hooks/post-tool-use.sh\""
}
]
}
Expand All @@ -46,6 +46,7 @@ Skipped if {workspace_root}/.claude/settings.json already contains "UserPromptSu

```bash
#!/bin/bash
export PATH="$HOME/.local/bin:$PATH"
PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-.}"
CLAUDE_MD="$PROJECT_ROOT/.claude/CLAUDE.md"

Expand Down Expand Up @@ -130,6 +131,7 @@ echo "━━━━━━━━━━━━━━━━━━━━━━━━

```bash
#!/bin/bash
export PATH="$HOME/.local/bin:$PATH"
INPUT=$(cat)
TOOL_NAME=$(printf '%s' "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null)
COMMAND=$(printf '%s' "$INPUT" | jq -r '.tool_input.command // empty' 2>/dev/null)
Expand Down Expand Up @@ -261,16 +263,16 @@ if echo "$COMMAND" | grep -q 'git commit'; then
"on_commit: Commit_Rules re-read" \
"$OPERATIONS_MD" \
"Commit Rules" \
"PR And CI Flow"
"PR Creation"
exit 0
fi

# on_merge: gh pr merge → Li+operations.md Merge_And_Cleanup section re-read
if echo "$COMMAND" | grep -q 'gh pr merge'; then
announce_section \
"on_merge: Merge_And_Cleanup re-read" \
"on_merge: Merge re-read" \
"$OPERATIONS_MD" \
"Merge And Cleanup" \
"Merge" \
"Execution Mode"
exit 0
fi
Expand Down
4 changes: 4 additions & 0 deletions docs/4.-Adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Li+claude.md に Claude Code 用の hook 定義を格納する。Li+config.md St

hook は Claude Code ランタイムが強制発火するため、AI の記憶やコンテキスト圧縮に依存しない。

### パス安全性

settings.json の hook command はプロジェクトディレクトリにスペースを含む環境で壊れないよう `bash "$CLAUDE_PROJECT_DIR/..."` 形式でクォートする。hook スクリプトは冒頭で `export PATH="$HOME/.local/bin:$PATH"` を設定し、永続インストールされた外部コマンド(jq、gh 等)を参照できるようにする。

### on-user-prompt.sh

トリガー:`UserPromptSubmit` — ユーザーがメッセージを送信するたび(Claude の処理開始前)。
Expand Down
Loading