Roo-Code/.roo-hooks.json.example
davincidreams be83bb6698 feat: port Claude Code CLI features and add parallel agent/worktree support
- Port session memory compaction, microcompact, hooks system, and
  prompt-too-long retry from the Claude Code CLI source
- Add spawn_parallel_tasks tool with serial queue drain fan-out pattern
- Add worktree isolation: new_task/spawn_parallel_tasks accept a worktree
  param; ClineProvider creates/cleans up git worktrees per child task
- Add completionPayload: attempt_completion result parsed as JSON and
  aggregated across parallel tasks for structured fan-in
- Fix workspacePath priority so explicit override always wins over parent
- Emit TaskSpawned event from delegateParentAndOpenChild
- Scope MCP hub to per-task workspacePath for worktree-aware mcp.json
- Fix microCompact bugs: touched flag, off-by-one threshold, keepRecent:0
- Fix lazy OutputChannel init in hooks executor to avoid test failures
- Fix pre-existing lint warnings across src, packages/cloud, webview-ui

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 23:50:56 -04:00

59 lines
1.4 KiB
Text

{
"_comment": "Example hooks configuration file for Roo Code. Rename to .roo-hooks.json to use.",
"_comment2": "Hooks are executed before (PreCompact) and after (PostCompact) context condensation.",
"_comment3": "Each hook can be a command (shell command) or http (HTTP POST request).",
"PreCompact": [
{
"matcher": "auto",
"hooks": [
{
"id": "log-pre-compact",
"type": "command",
"description": "Log before automatic condensation",
"command": "echo 'Pre-compact hook triggered at $(date)'",
"shell": "bash",
"timeout": 10
}
]
},
{
"matcher": "manual",
"hooks": [
{
"id": "log-manual-compact",
"type": "command",
"description": "Log before manual condensation",
"command": "echo 'Manual compact triggered'",
"shell": "bash"
}
]
}
],
"PostCompact": [
{
"matcher": "auto",
"hooks": [
{
"id": "log-post-compact",
"type": "command",
"description": "Log after automatic condensation",
"command": "echo 'Post-compact hook: Summary length is ${#HOOK_INPUT}'",
"shell": "bash",
"timeout": 10
},
{
"id": "notify-webhook",
"type": "http",
"description": "Send notification to webhook",
"url": "https://example.com/webhook",
"method": "POST",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
},
"timeout": 30
}
]
}
]
}