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
/plugin marketplace add josstei/maestro-orchestrate
/plugin install maestro@maestro-orchestratorWhat 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
Bashto test the shell-call hook. - End the session and check that the
session-endhandler runs.
How to install maestro
1Plugin marketplace
/plugin marketplace add josstei/maestro-orchestrate/plugin install maestro@maestro-orchestrator2Manually: put the files in place
.claude/settings.jsonThe 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