Skip to content

Update README Claude Code Hooks section - #25

Merged
UserAd merged 2 commits into
mainfrom
claude/update-readme-hooks-C1d0k
Jan 14, 2026
Merged

UserAd merged 2 commits into
mainfrom
claude/update-readme-hooks-C1d0k

Conversation

@UserAd

@UserAd UserAd commented Jan 14, 2026

Copy link
Copy Markdown
Owner

…ooks

Replace the simplified single-hook example with the full hooks configuration from the plugin.json file, including SessionStart, SessionEnd, Stop, and UserPromptSubmit hooks. Update documentation to explain each hook's purpose.

Summary by CodeRabbit

  • Documentation
    • Replaced single prompt-submit hook docs with event-based hook guidance (SessionStart, SessionEnd, Stop, UserPromptSubmit).
    • Reworked configuration examples to show per-event hook tables and purposes.
    • Updated “How It Works” flow to match event hooks and adjusted example outputs to reflect mail handling via Stop.
    • Added Hook Mode Behavior table with conditions, outputs, and exit codes.

✏️ Tip: You can customize this high-level summary in your review settings.

…ooks

Replace the simplified single-hook example with the full hooks configuration
from the plugin.json file, including SessionStart, SessionEnd, Stop, and
UserPromptSubmit hooks. Update documentation to explain each hook's purpose.
@coderabbitai

coderabbitai Bot commented Jan 14, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Restructures README.md Claude Code Hooks docs: replaces a single user-prompt-submit hook with four event-based hooks (SessionStart, SessionEnd, Stop, UserPromptSubmit), adds a Hook Mode Behavior table, and updates the "How It Works" content to reflect per-event agentmail commands.

Changes

Cohort / File(s) Summary
Documentation Updates
README.md
Replaced single inline user-prompt-submit hook with per-event hooks (SessionStart, SessionEnd, Stop, UserPromptSubmit) each mapped to specific agentmail commands; added Hook Mode Behavior table (conditions, outputs, exit codes); updated "How It Works" examples and removed prior per-prompt receive-and-notify flow

Sequence Diagram(s)

sequenceDiagram
  actor Claude
  participant Hooks as Hooks Config
  participant AgentMail as agentmail
  Claude->>Hooks: SessionStart event
  Hooks->>AgentMail: run "onboarding" command
  Claude->>Hooks: UserPromptSubmit event
  Hooks->>AgentMail: run "status work" command
  Claude->>Hooks: Stop event
  Hooks->>AgentMail: run "receive hook" command
  Claude->>Hooks: SessionEnd event
  Hooks->>AgentMail: run "offline" command
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

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 summarizes the main change: updating the README's Claude Code Hooks section with the full hooks configuration and per-event hook details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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



📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29994dc and 1b3646e.

📒 Files selected for processing (1)
  • README.md
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-01-14T17:53:44.830Z
Learnt from: CR
Repo: UserAd/AgentMail PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-14T17:53:44.830Z
Learning: Must be running inside a tmux session to use agentmail

Applied to files:

  • README.md
📚 Learning: 2026-01-14T17:53:44.830Z
Learnt from: CR
Repo: UserAd/AgentMail PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-14T17:53:44.830Z
Learning: Use agentmail send <recipient> "<message>" where recipient is a valid tmux window name

Applied to files:

  • README.md
🔇 Additional comments (2)
README.md (2)

450-489: LGTM! Previous review feedback addressed.

The hooks configuration now correctly omits the matcher field for matcher-less events (SessionStart, SessionEnd, Stop, UserPromptSubmit), aligning with Claude Code's documented best practices. The JSON structure is valid and the commands are appropriate for each event.


496-502: Well-structured documentation.

The table format clearly explains each hook's command and purpose, making it easy to understand the hook lifecycle. The information accurately reflects the configuration above.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 450-493: The hook entries for SessionStart, SessionEnd, Stop, and
UserPromptSubmit include an unnecessary "matcher" field set to an empty string;
remove the "matcher" property from each of these event objects so the entries
match the documented matcher-less format (i.e., keep the event arrays and their
inner "hooks" arrays with the "type" and "command" entries, but delete the
"matcher" key from the objects for SessionStart, SessionEnd, Stop, and
UserPromptSubmit).
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3f15285 and 29994dc.

📒 Files selected for processing (1)
  • README.md
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-01-14T17:53:44.830Z
Learnt from: CR
Repo: UserAd/AgentMail PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-14T17:53:44.830Z
Learning: Must be running inside a tmux session to use agentmail

Applied to files:

  • README.md
📚 Learning: 2026-01-14T17:53:44.830Z
Learnt from: CR
Repo: UserAd/AgentMail PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-14T17:53:44.830Z
Learning: Use agentmail send <recipient> "<message>" where recipient is a valid tmux window name

Applied to files:

  • README.md
🔇 Additional comments (3)
README.md (3)

500-505: LGTM! Hook descriptions accurately match the commands.

The table clearly explains the purpose of each hook, and each description correctly corresponds to its respective command in the JSON configuration.


507-514: LGTM! Hook mode behavior is consistent with command documentation.

The table accurately reflects the exit codes and behavior documented in the receive command section (lines 158-160).


520-528: LGTM! Clear clarification of when mail notifications appear.

The addition of "(on Stop hook)" helps users understand the timing of mail notifications, which aligns with the Stop hook's agentmail receive --hook command.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread README.md
Remove empty "matcher" properties from SessionStart, SessionEnd, Stop,
and UserPromptSubmit hook entries to match the documented matcher-less format.
@UserAd
UserAd merged commit 0e7c67d into main Jan 14, 2026
3 checks passed
@UserAd
UserAd deleted the claude/update-readme-hooks-C1d0k branch January 14, 2026 19:19
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.

2 participants