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
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eu

COUNT_FILE="$HOME/.claude/perm_count.txt"
count=$(cat "$COUNT_FILE" 2>/dev/null || echo 0)

if [ "$count" -ge 5 ]; then
echo 0 > "$COUNT_FILE"
echo "{\"systemMessage\": \"このセッションで $count 回パーミッションの要求がありました。/fewer-permission-prompts を実行すると、よく使う操作を settings.json に自動追加してプロンプトを減らせます。\"}"
else
echo 0 > "$COUNT_FILE"
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -eu

COUNT_FILE="$HOME/.claude/perm_count.txt"
count=$(cat "$COUNT_FILE" 2>/dev/null || echo 0)
echo $((count + 1)) > "$COUNT_FILE"
19 changes: 15 additions & 4 deletions plugins/claude-code-best-practice/hooks/hooks.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
{
"description": "Suggests running /fewer-permission-prompts each time the user invokes /clear.",
"description": "Counts permission requests per session and suggests /fewer-permission-prompts at Stop when the count reaches the threshold.",
"hooks": {
"SessionStart": [
"PermissionRequest": [
{
"matcher": "clear",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/suggest-permissions-cleanup.sh"
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/fewer-prompts-nudge-increment.sh",
"async": true
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/fewer-prompts-nudge-check.sh",
"timeout": 5
}
]
}
Expand Down

This file was deleted.

Loading