Skip to content

Emit Claude start hook on submit and tool use#19

Merged
trydis merged 1 commit intomainfrom
pretooluse-hook
Mar 11, 2026
Merged

Emit Claude start hook on submit and tool use#19
trydis merged 1 commit intomainfrom
pretooluse-hook

Conversation

@trydis
Copy link
Owner

@trydis trydis commented Mar 11, 2026

Summary by CodeRabbit

  • New Features

    • Added a pre-tool-use hook to the agent runtime that executes before tool use across all surfaces.
  • Tests

    • Updated test assertions to verify the new hook configuration and universal matcher settings.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 780c3104-0a8d-4f56-830a-75a02de5d2eb

📥 Commits

Reviewing files that changed from the base of the PR and between 83f5850 and 26524ee.

📒 Files selected for processing (2)
  • Sources/Shellraiser/Infrastructure/Agents/AgentRuntimeBridge.swift
  • Tests/ShellraiserTests/AgentRuntimeBridgeTests.swift

📝 Walkthrough

Walkthrough

A new "PreToolUse" hook was added to the Claude wrapper's generated settings in AgentRuntimeBridge.swift, configured to match all surfaces and execute a claudeCode "started" command before tool use. Test expectations were updated to reflect this new hook structure.

Changes

Cohort / File(s) Summary
Claude Wrapper Hook Configuration
Sources/Shellraiser/Infrastructure/Agents/AgentRuntimeBridge.swift
Added a new "PreToolUse" hook block to the Claude wrapper settings that mirrors the existing "UserPromptSubmit" hook, applying to all surfaces and executing the same claudeCode "started" command prior to tool use.
Hook Configuration Tests
Tests/ShellraiserTests/AgentRuntimeBridgeTests.swift
Updated test assertions to expect the new "PreToolUse" hook and repositioned the universal matcher entry within the hook structure to align with the updated wrapper generation.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new 'PreToolUse' hook alongside the existing 'UserPromptSubmit' hook to emit Claude's start command in both scenarios.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pretooluse-hook

Comment @coderabbitai help to get the list of available commands and usage tips.

@trydis trydis merged commit f3b30b5 into main Mar 11, 2026
2 checks passed
@trydis trydis deleted the pretooluse-hook branch March 11, 2026 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant