session-hook

Create and manage per-session hooks for Claude Code tasks.

1|Updated Oct 26, 2025
One-click install
npx skills add https://github.com/gosu-code/claude-plugin --skill session-hook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-hook
Source: https://github.com/gosu-code/claude-plugin/tree/main/plugins/gosu-mcp-core/skills/session-hook
Command: npx skills add https://github.com/gosu-code/claude-plugin --skill session-hook

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Session hooks address the need to modify Claude Code behavior for a single active session without requiring a full restart, enabling rapid experimentation and debugging.

Core Features & Use Cases

  • Create per-session hooks that activate immediately, scoped to the current session.
  • Manage multiple hook types (json and command) with optional matchers and optional global scope.
  • Use for on-the-fly context injection, temporary enforcement of workflows, and session-specific automation during active tasks.

Quick Start

Create a session hook for the current Claude Code session using the provided CLI.

Frequently Asked Questions about session-hook

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create session-scoped hooks for Claude Code without restarting?

Session-scoped hooks are per-session automation scripts that activate immediately for Claude Code tasks. You can create them on the fly to modify behavior dynamically during an active session without requiring a full restart.

What are session hooks used for in Claude Code workflows?

Session hooks are used for on-the-fly context injection, temporary enforcement of workflows, and session-specific automation. They adapt to the current session and project context during active debugging or one-off tasks.

Can I use matchers and different hook types with Claude Code session hooks?

Yes, session hooks support multiple hook types including json and command. They also support optional matchers and enforce input validation for UUID formats and supported events.

How do I configure project-scoped versus user-scoped hook configuration files?

Session hooks write to project- or user-scoped hook configuration files. This allows you to apply automation scripts either to the current project context or globally across the user environment.

Does session-hook support dynamic one-off workflows and debugging sessions?

Yes, session-hook is designed for dynamic one-off workflows and debugging sessions. It enables rapid experimentation by applying session-scoped hooks that adapt to the current active task.

What input validation is enforced when creating Claude Code hooks?

Input validation enforces UUID format, supported events, and optional matchers. This ensures that per-session hooks are configured correctly before writing to project- or user-scoped files.