Roo-Code/packages
Roo Code d8b53b814a feat: add prompt-based hooks for agent lifecycle events
Implements prompt-based hooks that allow a smaller/different model to step in
at specific agent lifecycle events and provide read-only advisory output.

Hook events supported:
- PreToolUse: fires before tool execution (with optional tool name matcher)
- PostToolUse: fires after tool execution completes
- Stop: fires when attempt_completion is invoked

Configuration via .roo/hooks.json (project) and ~/.roo/hooks.json (global),
using a Claude Code-compatible format. Hooks are read-only (no tool access)
and receive conversation context. Uses the active profile API configuration.

New files:
- src/shared/hooks.ts: types, interfaces, and validation
- src/services/hooks/HooksManager.ts: config loading with file watchers
- src/services/hooks/HookExecutor.ts: hook prompt building and execution
- src/shared/__tests__/hooks.spec.ts: 18 validation tests
- src/services/hooks/__tests__/HookExecutor.spec.ts: 15 executor tests

Modified files:
- packages/types/src/message.ts: added hook_output ClineSay type
- src/core/webview/ClineProvider.ts: HooksManager initialization
- src/core/assistant-message/presentAssistantMessage.ts: PreToolUse/PostToolUse hooks
- src/core/tools/AttemptCompletionTool.ts: Stop hook

Addresses #11504
2026-02-17 17:32:52 +00:00
..
build Custom tool calling (#10083) 2025-12-21 12:43:06 -08:00
cloud Reapply Batch 1: 22 clean non-AI-SDK cherry-picks (#11473) 2026-02-14 13:47:12 -07:00
config-eslint Upgrade to ESLint 9 + share eslint config across workspaces (#3815) 2025-05-21 21:30:21 -07:00
config-typescript Move @roo-code/cloud to the Roo-Code repo (#7503) 2025-08-28 11:18:45 -07:00
core Add back post-revert bug fixes and features (Step 2) (#11463) 2026-02-13 18:40:28 -05:00
evals Reapply Batches 3-4: Skills, browser removal, provider removals (6 major-conflict cherry-picks) (#11475) 2026-02-14 22:06:24 -07:00
ipc Better IPC error logging (#9727) 2025-12-01 15:02:34 -08:00
telemetry fix(condense): remove custom condensing model option (#10901) 2026-01-22 20:06:04 -05:00
types feat: add prompt-based hooks for agent lifecycle events 2026-02-17 17:32:52 +00:00
vscode-shim Some cleanup in ExtensionHost (#10600) 2026-01-10 02:29:33 -08:00