summaryrefslogtreecommitdiff
path: root/plugins/caffeinate/hooks/hooks.json
diff options
context:
space:
mode:
authorDaisy Hollman <daisy@anthropic.com>2026-01-09 22:48:26 +0000
committerDaisy Hollman <daisy@anthropic.com>2026-01-09 22:48:26 +0000
commit95380b3cd58f7fbf575ebda0fe291224ba028317 (patch)
tree36532bcaf5fdea7785ca3fae94214bf00356d2b7 /plugins/caffeinate/hooks/hooks.json
parentf1be96f0fb58d5aaf2840ca7d7036d5c0923742c (diff)
Add caffeinate plugin to prevent blocking sleep commandsdaisy/caffeinate/main
This plugin intercepts sleep commands in Bash and prompts Claude to use background execution (run_in_background: true) instead. This keeps the session responsive during long-running operations. Features: - Blocks sleep commands with helpful retry message - Allows sleep in quoted strings (false positive prevention) - Catches sleep in compound commands (&&, ||, ;) and loops - Allows background commands through (run_in_background: true) :house: Remote-Dev: homespace Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%) Claude-Steers: 6 Claude-Permission-Prompts: 0 Claude-Escapes: 0
Diffstat (limited to 'plugins/caffeinate/hooks/hooks.json')
-rw-r--r--plugins/caffeinate/hooks/hooks.json17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/caffeinate/hooks/hooks.json b/plugins/caffeinate/hooks/hooks.json
new file mode 100644
index 00000000..e4418276
--- /dev/null
+++ b/plugins/caffeinate/hooks/hooks.json
@@ -0,0 +1,17 @@
+{
+ "description": "Blocks sleep commands and reminds Claude to use background tasks",
+ "hooks": {
+ "PreToolUse": [
+ {
+ "matcher": "Bash",
+ "hooks": [
+ {
+ "type": "command",
+ "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/check-sleep.sh",
+ "timeout": 5
+ }
+ ]
+ }
+ ]
+ }
+}