Skip to main content

Web Search Hooks Research

System Prompt

⚠️ EXECUTION DIRECTIVE: When the user invokes this command, you MUST:

  1. IMMEDIATELY execute - no questions, no explanations first
  2. ALWAYS show full output from script/tool execution
  3. ALWAYS provide summary after execution completes

DO NOT:

  • Say "I don't need to take action" - you ALWAYS execute when invoked
  • Ask for confirmation unless requires_confirmation: true in frontmatter
  • Skip execution even if it seems redundant - run it anyway

The user invoking the command IS the confirmation.


Usage

/web-search-hooks

Research hooks for: $ARGUMENTS

This command discovers and researches Claude Code hooks implementations, patterns, and best practices from the web and open-source community. It identifies real-world usage examples, validates CODITECT's hook strategy against community standards, and extracts proven patterns for implementation.

Arguments

$ARGUMENTS - Research Scope (optional)

Specify research focus:

  • Full research: No arguments - comprehensive hooks research
  • Specific pattern: "Research pre-commit hooks" or "Security hooks best practices"
  • Framework: "Research hooks in Claude Code" or "Anthropic hooks documentation"
  • Use case: "Research hooks for validation automation"

Default Behavior

If no arguments:

  • Discovers hooks implementations from web
  • Identifies real-world usage examples
  • Validates against community standards
  • Extracts proven patterns

Steps to follow:

Step 1: Research Claude Code Hooks Documentation & API

Gather authoritative information about hooks from Anthropic.

Action: Search Anthropic's official documentation, release notes, and examples.

Use web-search-researcher subagent to:
1. Find official Claude Code hooks documentation
2. Locate hooks API specification and changelog
3. Identify best practices guides from Anthropic
4. Discover hooks example repositories
5. Find migration guides for adding hooks to existing projects

Key Information to Gather:

  • ✅ Complete hooks event lifecycle (all supported event types)
  • ✅ Matcher pattern capabilities and limitations
  • ✅ Configuration schema and validation rules
  • ✅ Performance characteristics and timeout behaviors
  • ✅ Security considerations from Anthropic
  • ✅ Version compatibility and deprecation notices

Success Criteria:

  • Official hooks documentation reviewed
  • API schema and requirements documented
  • Security guidelines from Anthropic captured
  • Known limitations and gotchas identified
  • Official example code reviewed

Step 2: Analyze Community Implementations

Research open-source projects that implement hooks.

Action: Find and analyze real-world hook implementations.

Use web-search-researcher subagent to:
1. Search GitHub for "Claude Code hooks" implementations
2. Find hooks examples in popular AI/IDE projects
3. Locate tutorials and how-to guides from community
4. Identify common patterns and anti-patterns
5. Find performance optimization techniques

Patterns to Identify:

  • ✅ Pre-tool validation hooks (blocking patterns)
  • ✅ Post-tool cleanup hooks (async patterns)
  • ✅ User prompt enhancement hooks (preprocessing)
  • ✅ Multi-tool coordination hooks (dependencies)
  • ✅ Error handling and recovery hooks
  • ✅ Performance optimization hooks
  • ✅ Logging and observability hooks

Success Criteria:

  • 10+ real-world implementations found
  • Code examples extracted and documented
  • Common patterns identified (3-5 major patterns)
  • Anti-patterns documented (2-3 mistakes to avoid)
  • Performance benchmarks collected

Step 3: Research Production Deployment Patterns

Find how organizations deploy and manage hooks in production.

Action: Research production-ready hook implementation strategies.

Use web-search-researcher subagent to:
1. Find production deployment guides for hooks
2. Discover monitoring and observability patterns
3. Identify testing strategies for hooks
4. Research version management and rollback procedures
5. Find case studies of hook deployments

Production Considerations:

  • ✅ Hook versioning and backward compatibility
  • ✅ Gradual rollout strategies (canary, blue-green)
  • ✅ Monitoring and alerting for hooks
  • ✅ Error handling and recovery procedures
  • ✅ Performance impact measurement
  • ✅ User communication and documentation

Success Criteria:

  • Production deployment strategies documented
  • Monitoring approach defined
  • Testing framework patterns identified
  • Version management strategy outlined
  • Risk mitigation procedures captured

Step 4: Security & Compliance Research

Research security best practices for hooks in enterprise environments.

Action: Find security guidance and compliance patterns.

Use web-search-researcher subagent to:
1. Research security best practices for automation hooks
2. Find OWASP/CWE related to hook execution
3. Identify authentication/authorization patterns
4. Discover audit logging approaches
5. Research secrets management for hooks

Security Topics:

  • ✅ Input validation and sanitization requirements
  • ✅ Privilege escalation risks and mitigations
  • ✅ Command injection prevention techniques
  • ✅ File access controls and path validation
  • ✅ Environment variable security
  • ✅ Secrets management and rotation
  • ✅ Audit trails and compliance logging

Success Criteria:

  • Security threat model documented
  • Mitigation strategies for 5+ threats identified
  • Compliance requirements (SOC2, HIPAA, GDPR) researched
  • Security testing patterns identified
  • Enterprise security checklist created

Step 5: Competitive Analysis

Research how competing IDEs and tools implement similar automation features.

Action: Analyze competitive automation strategies.

Use competitive-market-analyst subagent to:
1. Research VS Code extension system (similar to hooks)
2. Analyze JetBrains IDE plugin architecture
3. Study GitHub Copilot automation capabilities
4. Research Cursor IDE integration patterns
5. Compare automation trigger mechanisms

Competitive Comparison:

  • ✅ Event-driven architecture patterns
  • ✅ Plugin/extension initialization and lifecycle
  • ✅ User configuration and preferences
  • ✅ Performance and latency characteristics
  • ✅ Error handling and user feedback
  • ✅ Adoption barriers and solutions

Success Criteria:

  • Competitive feature comparison matrix created
  • Unique CODITECT hook advantages identified
  • Positioning strategy developed
  • Gap analysis vs. competitors completed
  • Differentiation opportunities documented

Step 6: Validate CODITECT Hook Strategy

Compare CODITECT's planned hooks against research findings.

Action: Cross-check CODITECT strategy against best practices.

Use codebase-analyzer subagent to:
1. Review CODITECT planned hooks (from analyze-hooks.md)
2. Validate against Anthropic best practices
3. Check alignment with community patterns
4. Assess production readiness
5. Identify any gaps or improvements needed

Validation Checklist:

  • ✅ All hooks align with Anthropic documentation
  • ✅ Implementation patterns match community standards
  • ✅ Security approach exceeds industry best practices
  • ✅ Performance characteristics are acceptable
  • ✅ Monitoring approach is comprehensive
  • ✅ Deployment procedures are production-ready

Success Criteria:

  • CODITECT hooks validated against 3+ authoritative sources
  • Gap analysis completed (if any)
  • Recommendations for improvements documented
  • Go/no-go decision for implementation
  • Risk assessment completed

Output Deliverables

This command produces:

  1. WEB-SEARCH-HOOKS-RESEARCH.md (5000+ words)

    • Official hooks documentation summary
    • Community implementations catalog (10+ examples with code)
    • Best practices synthesis
    • Production deployment patterns
    • Security and compliance guide
  2. COMMUNITY-HOOKS-EXAMPLES.md (3000+ words)

    • Annotated code examples from real projects
    • Pattern identification and analysis
    • Anti-patterns and how to avoid them
    • Performance benchmarks and comparison
    • Implementation checklist
  3. HOOKS-COMPETITIVE-ANALYSIS.md (2000+ words)

    • Feature comparison matrix (Claude Code vs. VS Code vs. JetBrains)
    • CODITECT differentiation strategy
    • Adoption strategy based on research
    • Risk assessment
  4. HOOKS-STRATEGY-VALIDATION-REPORT.md (1500+ words)

    • Gap analysis vs. best practices
    • CODITECT hooks readiness assessment
    • Go/no-go recommendation
    • Implementation improvements suggested
    • Timeline and resource estimates
  5. HOOKS-RESOURCES.md (bibliography)

    • All sources referenced with URLs
    • Recommended reading list
    • Official documentation links
    • Community project links
    • Video tutorials and talks

Integration with Other Commands

This command complements:

  • /analyze-hooks - Analyzes CODITECT's internal readiness; this researches external standards
  • /generate-project-plan-hooks - Uses findings to create detailed implementation plan
  • /new-project - Can leverage hooks for project creation workflow

Together they provide:

  • ✅ External best practices (web-search)
  • ✅ Internal readiness assessment (analyze)
  • ✅ Detailed implementation plan (generate-project-plan)

Important Notes

  • Comprehensive Research: Don't just skim - analyze actual code from real projects
  • Authority Verification: Cross-check findings against Anthropic's official sources
  • Pattern Extraction: Identify 3-5 major patterns that appear across multiple implementations
  • Security First: Security patterns and practices are NOT optional - research thoroughly
  • Real-World Validation: Focus on production systems, not toy examples
  • Competitive Context: Understand how CODITECT's approach compares to industry standards
  • Actionable Output: Research should directly inform implementation decisions

Success Criteria for Web Search Research

  • ✅ Researched 10+ real-world hook implementations
  • ✅ Analyzed 5+ official documentation sources (Anthropic primary)
  • ✅ Identified 3-5 major community patterns
  • ✅ Documented 2-3 anti-patterns to avoid
  • ✅ Researched production deployment strategies
  • ✅ Analyzed security and compliance patterns
  • ✅ Completed competitive analysis
  • ✅ Validated CODITECT strategy against findings
  • ✅ Created 4 comprehensive research documents
  • ✅ Ready for /generate-project-plan-hooks phase

Action Policy

<default_behavior> This command analyzes and recommends without making changes. Provides:

  • Detailed analysis of current state
  • Specific recommendations with justification
  • Prioritized action items
  • Risk assessment

User decides which recommendations to implement. </default_behavior>

After analysis, provide: - Analysis completeness (all aspects covered) - Recommendation confidence levels - Specific examples from codebase - Clear next steps for user

Success Output

When hooks research completes:

✅ COMMAND COMPLETE: /web-search-hooks
Implementations Found: N+
Patterns Identified: N
Documents Created: 4
Strategy Validated: YES/NO
Ready for: /generate-project-plan-hooks

Completion Checklist

Before marking complete:

  • Official documentation researched
  • Community implementations analyzed
  • Production patterns documented
  • Security research completed
  • CODITECT strategy validated

Failure Indicators

This command has FAILED if:

  • ❌ Less than 10 implementations found
  • ❌ No official documentation reviewed
  • ❌ Security research skipped
  • ❌ Research documents not created

When NOT to Use

Do NOT use when:

  • Need internal analysis (use /analyze-hooks)
  • Need implementation plan (use /generate-project-plan-hooks)
  • Hooks already implemented

Anti-Patterns (Avoid)

Anti-PatternProblemSolution
Skim instead of analyzeShallow findingsDeep dive real code
Skip security researchVulnerable implementationSecurity is mandatory
Ignore official docsNon-compliant patternsStart with Anthropic sources

Principles

This command embodies:

  • #7 Research When in Doubt - Comprehensive research
  • #9 Based on Facts - Evidence-based validation

Full Standard: CODITECT-STANDARD-AUTOMATION.md