Skip to content

Pivot: CLI hook scaffold replacing MCP server #1

@ProduktEntdecker

Description

@ProduktEntdecker

Overview

PatchPilot is pivoting from an MCP server to a Claude Code pre-execution hook.

Why

  • MCP requires manual invocation (user must ask)
  • Hook is automatic (intercepts before execution)
  • Simpler installation (single settings.json entry)
  • Global protection across all chats

Acceptance Criteria

  • Remove MCP server code from src/index.ts
  • Create new CLI entry point that reads JSON from stdin
  • Parse hook input structure (tool_name, tool_input.command, etc.)
  • Output valid hook response JSON to stdout
  • Exit code 0 for allow, exit code 2 for block (fallback)
  • Update package.json bin entry

Hook Input Format

{
  "hook_event_name": "PreToolUse",
  "tool_name": "Bash",
  "tool_input": {
    "command": "npm install lodash@4.17.0"
  }
}

Hook Output Format

{
  "hookSpecificOutput": {
    "hookEventName": "PreToolUse",
    "permissionDecision": "allow" | "deny" | "ask",
    "permissionDecisionReason": "..."
  }
}

Priority: P0 (blocks all other work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions