Skip to content

Instantly share code, notes, and snippets.

@steveruizok
Created October 6, 2025 21:17
Show Gist options
  • Select an option

  • Save steveruizok/79964f7c73389af573942961ebcc0ae7 to your computer and use it in GitHub Desktop.

Select an option

Save steveruizok/79964f7c73389af573942961ebcc0ae7 to your computer and use it in GitHub Desktop.
speak your mind claude
{
"hooks": {
"PreToolUse": [
{
"matcher": "ExitPlanMode|Read|Write|Edit|NotebookEdit",
"hooks": [
{
"type": "command",
"command": "bash -c 'INPUT=$(cat); EVENT=$(echo \"$INPUT\" | grep -o '\"'\"'\"'hook_event_name'\"'\"'\"':[^\"]*\" | sed \"s/.*:\\(.*\\)/\\1/\" | tr -d '\"'\"'\"'\"); TRANSCRIPT_PATH=$(echo \"$INPUT\" | grep -o '\"'\"'\"'transcript_path'\"'\"'\"':[^\"]*\" | sed \"s/.*:\\(.*\\)/\\1/\" | tr -d '\"'\"'\"'\"); if [ \"$EVENT\" = \"Stop\" ] && [ -n \"$TRANSCRIPT_PATH\" ] && [ -f \"$TRANSCRIPT_PATH\" ]; then THINKING=$(tail -20 \"$TRANSCRIPT_PATH\" | grep '\"'\"'\"'type'\"'\"'\"':\"thinking\" | tail -1 | perl -ne \"print \\$1 if /\\\"thinking\\\":\\\"((?:[^\\\"\\\\\\\\]|\\\\\\\\.)*)\\\"/;\" | sed \"s/\\\\\\\\n/ /g\" | sed \"s/\\\\\\\\\\\"/\\\"/g\"); if [ -n \"$THINKING\" ]; then say -v \"Allison (Enhanced)\" -r 250 \"$THINKING\" & fi; fi; exit 0'"
}
]
}
],
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "bash -c 'INPUT=$(cat); EVENT=$(echo \"$INPUT\" | grep -o '\"'\"'\"'hook_event_name'\"'\"'\"':[^\"]*\" | sed \"s/.*:\\(.*\\)/\\1/\" | tr -d '\"'\"'\"'\"); TRANSCRIPT_PATH=$(echo \"$INPUT\" | grep -o '\"'\"'\"'transcript_path'\"'\"'\"':[^\"]*\" | sed \"s/.*:\\(.*\\)/\\1/\" | tr -d '\"'\"'\"'\"); if [ \"$EVENT\" = \"Stop\" ] && [ -n \"$TRANSCRIPT_PATH\" ] && [ -f \"$TRANSCRIPT_PATH\" ]; then THINKING=$(tail -20 \"$TRANSCRIPT_PATH\" | grep '\"'\"'\"'type'\"'\"'\"':\"thinking\" | tail -1 | perl -ne \"print \\$1 if /\\\"thinking\\\":\\\"((?:[^\\\"\\\\\\\\]|\\\\\\\\.)*)\\\"/;\" | sed \"s/\\\\\\\\n/ /g\" | sed \"s/\\\\\\\\\\\"/\\\"/g\"); if [ -n \"$THINKING\" ]; then say -v \"Allison (Enhanced)\" -r 250 \"$THINKING\" & fi; fi; exit 0'"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "bash -c 'INPUT=$(cat); EVENT=$(echo \"$INPUT\" | grep -o '\"'\"'\"'hook_event_name'\"'\"'\"':[^\"]*\" | sed \"s/.*:\\(.*\\)/\\1/\" | tr -d '\"'\"'\"'\"); TRANSCRIPT_PATH=$(echo \"$INPUT\" | grep -o '\"'\"'\"'transcript_path'\"'\"'\"':[^\"]*\" | sed \"s/.*:\\(.*\\)/\\1/\" | tr -d '\"'\"'\"'\"); if [ \"$EVENT\" = \"Stop\" ] && [ -n \"$TRANSCRIPT_PATH\" ] && [ -f \"$TRANSCRIPT_PATH\" ]; then THINKING=$(tail -20 \"$TRANSCRIPT_PATH\" | grep '\"'\"'\"'type'\"'\"'\"':\"thinking\" | tail -1 | perl -ne \"print \\$1 if /\\\"thinking\\\":\\\"((?:[^\\\"\\\\\\\\]|\\\\\\\\.)*)\\\"/;\" | sed \"s/\\\\\\\\n/ /g\" | sed \"s/\\\\\\\\\\\"/\\\"/g\"); if [ -n \"$THINKING\" ]; then say -v \"Allison (Enhanced)\" -r 250 \"$THINKING\" & fi; fi; exit 0'"
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment