Skip to content

Add timeout, async, and statusMessage fields to HookEntry #224

@bguidolim

Description

@bguidolim

Phase 1: Hook Handler Fields

Context

The Claude Code hooks documentation now defines additional fields on hook handlers that mcs doesn't model. These are small additions to the existing Settings.HookEntry struct.

Fields to Add

Field Type Description
timeout Int? Seconds before canceling. Defaults: 600 (command), 30 (prompt), 60 (agent)
async Bool? If true, runs in the background without blocking
statusMessage String? Custom spinner message displayed while the hook runs

Files to Modify

  • Sources/mcs/Core/Settings.swift — add fields to HookEntry
  • Sources/mcs/ExternalPack/ExternalPackManifest.swift — add corresponding YAML fields to ExternalHookEntry (if exists) or the hook shorthand
  • Tests for round-tripping

Acceptance Criteria

  • HookEntry supports timeout, async, and statusMessage as optional Codable fields
  • Pack authors can specify these in techpack.yaml hook definitions
  • Auto-derived hook entries pass through these fields when specified
  • Existing settings files without these fields continue to work (backward compatible)

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Important priorityenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions