Skip to content

Instantly share code, notes, and snippets.

@kenfdev
Created August 15, 2025 21:37
Show Gist options
  • Select an option

  • Save kenfdev/dd84a3f57fe60346d531d5b9365778f9 to your computer and use it in GitHub Desktop.

Select an option

Save kenfdev/dd84a3f57fe60346d531d5b9365778f9 to your computer and use it in GitHub Desktop.
Claude Code hooks to simply add options to improve your prompt
#!/bin/bash
# Simple hook to process trailing options
input=$(cat)
# Check if there are options at the end of prompt
if echo "$input" | grep -q '"prompt".*-[a-z]\+"'; then
# Extract just the options part (e.g., "-uj" -> "uj")
options=$(echo "$input" | grep -o '\-[a-z]\+"' | tail -1 | sed 's/-//' | sed 's/"//')
# Process each character in the options
for (( i=0; i<${#options}; i++ )); do
opt="${options:$i:1}"
case "$opt" in
u)
echo "use the maximum amount of ultrathink. Think deeply and systematically by questioning your initial assumptions, considering what you might be missing, exploring alternative perspectives, double-checking your logic and calculations, and identifying potential flaws in your reasoning. Take as much time as needed since thoroughness and accuracy are paramount."
;;
j)
echo "the output MUST be in Japanese"
;;
v)
echo "Be verbose and provide detailed explanations."
;;
# Add more options here
esac
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment