Skip to main content
hook CX Codex

maestro — Claude Code hook: intercept Bash and agent calls

maestro runs handlers at session start and end, before an agent call, and before Bash. Use it to connect these events to the plugin’s scripts in Claude Code.

Apache-2.0 ★ 489 updated 2026-10-26

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add josstei/maestro-orchestrate
/plugin install maestro@maestro-orchestrator
Open on GitHub

What maestro does

This hook bundle is part of the maestro plugin. It responds to SessionStart, SessionEnd, and PreToolUse. Before an agent starts, it calls hook-runner.js with before-agent; before Bash, it runs policy-enforcer.js. Session events call the runner with session-start or session-end.

The scripts run through node from ${CLAUDE_PLUGIN_ROOT}/scripts/. The Bash handler has a timeout of 5; the other commands use 10. Since policy-enforcer.js runs before Bash, it can affect shell calls in your project.

What it helps with

  • run a handler when a session begins
  • capture actions when a session ends
  • intercept an agent call before it starts
  • check Bash calls with policy-enforcer.js

Example prompts for the agent

  • Delegate a task to an agent and check that its pre-run handler fires.
  • Run a command through Bash to test the shell-call hook.
  • End the session and check that the session-end handler runs.

How to install maestro

1Plugin marketplace

/plugin marketplace add josstei/maestro-orchestrate
/plugin install maestro@maestro-orchestrator

2Manually: put the files in place

.claude/settings.json

The hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json

Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command

Questions about maestro

How do I install maestro in Claude Code?

Run /plugin marketplace add josstei/maestro-orchestrate, then /plugin install maestro@maestro-orchestrator in Claude Code. Plugin settings are in .claude/settings.json.

What does maestro do?

It runs scripts at session start and end, before an agent call, and before a Bash call.

Which events trigger the maestro hook?

It responds to SessionStart, SessionEnd, and PreToolUse. The latter has handlers for Agent and Bash.

Source text

claude-hooks.json · Apache-2.0
Hooks bundle shipped with the maestro plugin for Claude Code.

Multi-agent development orchestration platform — 39 specialists, 4-phase orchestration, native parallel subagents, persistent sessions, and standalone review/debug/security/perf/seo/a11y/compliance commands

Triggers on: PreToolUse, SessionStart, SessionEnd.

```json
{
  "hooks": {
    "SessionEnd": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/hook-runner.js claude session-end",
            "timeout": 10
          }
        ]
      }
    ],
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/hook-runner.js claude session-start",
            "timeout": 10
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/hook-runner.js claude before-agent",
            "timeout": 10
          }
        ],
        "matcher": "Agent"
      },
      {
        "hooks": [
          {
            "type": "command",
            "command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/policy-enforcer.js",
            "timeout": 5
          }
        ],
        "matcher": "Bash"
      }
    ]
  }
}

```

© josstei · Apache-2.0 · josstei/maestro-orchestrate

Similar hooks

All hooks for Agent setup: memory, context, orchestration →

From the same set40

The whole set →
api-designer api-designer designs REST and GraphQL API contracts, schemas, pagination strategies, and versioning rules before implementation begins. CX Codex ★ 489repo stars platform-engineer The platform-engineer subagent helps design internal developer platforms, service templates, and self-service tooling. Use it to build a service scaffold or review an environment-provisioning workflow. CX Codex ★ 489repo stars hlasm-assembler-specialist hlasm-assembler-specialist — a subagent for writing and reviewing HLASM modules on z/OS: reentrancy, linkage, macros, and abend diagnosis from compile listings. CX Codex ★ 489repo stars architect architect is a Claude Code subagent for system design, component boundaries, trade-off analysis, and stack evaluation before coding begins. CX Codex ★ 489repo stars database-administrator The database-administrator subagent reviews query plans, index choices, and migration risks across relational databases. Use it when investigating slow SQL or planning changes to large tables. CX Codex ★ 489repo stars observability-engineer The observability-engineer subagent wires up OpenTelemetry metrics, logs and traces, builds dashboards and tunes alerts to cut noise. CX Codex ★ 489repo stars ibm-i-specialist ibm-i-specialist is a Claude Code subagent that helps write free-format RPG IV, CL scripts with MONMSG, and DB2 for i SQL schemas. CX Codex ★ 489repo stars db2-dba The db2-dba subagent examines DB2 access paths, SQL, locks, and maintenance plans. Use it to investigate a regression after REBIND or prepare a REORG. CX Codex ★ 489repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open