Claude Code Gists banner
pauloportella pauloportella

Claude Code Gists

Development community

Description

A collection of personal hooks for Claude Code. These are my personal Claude Code hooks - use at your own risk!

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Claude Code Gists

A collection of personal hooks for Claude Code. These are my personal Claude Code hooks - use at your own risk!

Hooks

Pre-Tool Use Hooks

  • command-safety-guard.py - Validates bash commands and blocks potentially dangerous operations
  • security-audit.py - Audits file operations for security concerns
  • task-quality-analyzer.py - Analyzes task descriptions for clarity and completeness

Post-Tool Use Hooks

  • dependency-checker.py - Checks for outdated dependencies in package.json, Cargo.toml, requirements.txt, pyproject.toml, and Python scripts
    • Supports npm packages with version range parsing
    • Supports Rust crates with cargo integration
    • Supports Python packages in requirements.txt and pyproject.toml
    • Supports PEP 723 inline script metadata in .py files
    • Uses uv if available for faster Python dependency resolution
    • Blocks writes with outdated dependencies

User Prompt Submit Hooks

  • user-prompt-hook.py - Advanced prompt engineering for Claude Code (improv: mode only)
    • ONLY processes prompts with improv: prefix - normal prompts bypass hook to avoid lag
    • Uses Claude Sonnet v4 with --append-to-system-prompt for enhancement
    • Adds enhanced prompts as context (doesn't replace original)
    • Includes conversation history for context-aware enhancements
    • Logs all interactions to ~/.claude/hooks-using-claude/prompt_history.json

Notification Hooks

  • notification-handler.sh - Handles system notifications for Claude Code events

Installation

  1. Clone this repository:
git clone git@github.com:pauloportella/claude-code-gists.git /path/to/your/location
  1. Create symlinks to your Claude Code hooks directory:
# Individual hooks
ln -sf /path/to/claude-code-gists/hooks/command-safety-guard.py ~/.claude/hooks/
ln -sf /path/to/claude-code-gists/hooks/dependency-checker.py ~/.claude/hooks/
ln -sf /path/to/claude-code-gists/hooks/notification-handler.sh