crewkit
MarketplaceFeaturesPricingDocsGitHub
Sign InGet Started
crewkitInstallationQuickstartConfigurationTroubleshooting

Usage

TUICLIDashboardAnalytics

Configure

AgentsSkillsRulesCommandsInheritancePlaybooksExperimentsHooksTeamWorkspacesFAQ

API Reference

API OverviewAuthenticationSessions APIResources APIOrganizations APIProjects APIPlaybooks APIExperiments API

Hooks

Real-time event interception from Claude Code sessions.

The hook system intercepts events from Claude Code in real time. crewkit uses hooks to collect telemetry, track subagent tasks, and enforce conventions.


How hooks work

  1. crewkit generates a hook settings JSON file when starting a session
  2. Claude Code is launched with these settings, which register crewkit as a hook handler
  3. When events occur, Claude Code invokes crewkit's hook handler with the event data
  4. Events are forwarded to the main crewkit process for processing and API delivery

Events are batched and sent to the crewkit API for storage and analysis.


Event types

crewkit handles 12 event types — 10 standard Claude Code hooks plus 2 custom crewkit hooks.

Standard hooks

EventWhen it firesWhat crewkit does
SessionStartSession beginsInitialize telemetry
SessionEndSession endsFinalize metrics, trigger analysis
UserPromptSubmitUser submits a promptTrack turn count, convention checking
PreToolUseBefore a tool runsCan modify or deny tool execution
PostToolUseAfter a tool succeedsTrack tool usage patterns
PermissionRequestPermission dialog shownTrack permission patterns
StopMain agent finishesCapture completion state
SubagentStopSubagent finishesExtract subagent stats from JSONL
PreCompactBefore context compactionTrack compaction events
NotificationSystem notificationTrack notifications

Custom crewkit hooks

EventWhen it firesWhat crewkit does
SubagentStartTask tool spawns a subagentTrack subagent creation
SubagentStopSubagent completesExtract stats: tokens, cost, duration, model

Subagent stats

When a subagent (Task) completes, crewkit extracts stats from its JSONL transcript:

  • Agent type — Which agent was used
  • Duration — How long the task ran
  • Tokens — Input, output, cache read, cache creation
  • Model — Which Claude model was used
  • Turns — Assistant and user turns
  • Tool usage — Tool uses and results count

This data powers the per-agent analytics in the dashboard.


Event sanitization

Events are sanitized before being sent to the API. The sanitization level depends on your organization's capture mode:

  • Full — All event data captured
  • Metadata only — Event types and timing, no content
  • Disabled — No event capture

Configure capture mode in your organization's telemetry settings.


Convention handlers

Hooks can detect convention violations in real time. When a tool use violates a playbook convention (e.g., using RSpec when the convention says MiniTest), the hook system logs a challenge.

Convention handler dispatch is being rolled out progressively.


Next steps

  • Playbooks
  • Analytics
  • Configuration

Experiments

A/B test agent configurations to find what works best.

Team

Manage team members, roles, and permissions.

On this page

How hooks workEvent typesStandard hooksCustom crewkit hooksSubagent statsEvent sanitizationConvention handlersNext steps
crewkit

Observability, governance, and continuous improvement for AI-assisted engineering teams.

Product

  • Marketplace
  • Features
  • Pricing
  • Documentation

Resources

  • GitHub
  • Changelog
  • Report Issue
  • System Status

Company

  • About
  • Privacy
  • Terms

© 2026 Karibew Inc. All rights reserved.

Command Palette

Search conversations, projects, playbooks, and more