cc-sessions-hooks

Develop and debug cc-sessions hooks for write-gating and validation.

2|Updated Nov 15, 2025
One-click install
npx skills add https://github.com/grandinh/claude-chaos-express --skill cc-sessions-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cc-sessions-hooks
Source: https://github.com/grandinh/claude-chaos-express/tree/main/.claude/skills/cc-sessions-hooks
Command: npx skills add https://github.com/grandinh/claude-chaos-express --skill cc-sessions-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creating and debugging hooks for the cc-sessions framework is critical for enforcing DAIC discipline, write-gating, and overall framework integrity. This Skill provides specialized guidance for this complex and sensitive task.

Core Features & Use Cases

  • Hook Development Guidance: Assists in creating, modifying, and debugging various hook types (UserPromptSubmit, PreToolUse, PostToolUse, SessionStart) with proper structure and error handling.
  • Write-Gating Enforcement: Provides patterns and best practices for implementing and extending critical write-gating logic within sessions_enforce.js, ensuring framework safety.
  • Shared State Management: Guides safe and atomic access to shared session state within hooks, preventing state corruption and ensuring consistency.
  • Use Case: If you need to implement a new framework-level validation that fires before any tool execution, this Skill will guide you through creating a PreToolUse hook, ensuring it respects DAIC modes and handles state safely.

Quick Start

Add a PreToolUse hook to validate task manifest format before any tool execution.

Frequently Asked Questions about cc-sessions-hooks

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

FAQPage Schema
How do I create hooks for the cc-sessions framework to enforce DAIC discipline?

Create hooks by implementing the core patterns for UserPromptSubmit, PreToolUse, PostToolUse, or SessionStart lifecycle points. The Skill guides you through proper structure, error handling, and atomic state mutations to enforce framework integrity and write-gating requirements safely.

What is write-gating in cc-sessions hooks and why does it matter?

Write-gating is a critical validation mechanism that controls when state mutations occur within the cc-sessions framework. It prevents unauthorized or unsafe writes by enforcing checks before tool execution and session state changes, ensuring DAIC discipline and framework safety.

How do I safely access and modify shared session state within hooks?

Use atomic state mutation patterns provided by the Skill to prevent corruption when multiple hooks interact with shared session state. These patterns ensure consistent state access, proper execution ordering, and safety guardrails across hook lifecycle points.

Can I use hooks to validate task manifests before tool execution?

Yes, PreToolUse hooks enable framework-level validation of task manifest format before any tool executes. This Skill provides patterns for implementing such validation while respecting DAIC modes and managing state safely.

What are the common patterns for debugging failed hook execution in cc-sessions?

Debug hook failures by checking execution order, state mutation atomicity, and DAIC mode compliance. The Skill covers error handling structures, state inspection techniques, and validation patterns specific to hook lifecycle points and framework requirements.

Do I need deep framework knowledge to implement cc-sessions hooks?

Intermediate understanding of state management and hooks is sufficient. The Skill provides structured guidance on basic and enforcement hook patterns, shared-state access, and safety guardrails without requiring expert-level framework internals knowledge.