Skip to content

docs(hooks): clarify cross-file execution order - #12295

Merged
jdx merged 1 commit into
mainfrom
docs/clarify-hook-order
Aug 22, 2026
Merged

jdx merged 1 commit into
mainfrom
docs/clarify-hook-order

Conversation

@jdx

@jdx jdx commented Aug 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • clarify that matching hooks from multiple config files are additive
  • document highest-to-lowest precedence execution order
  • add a conf.d example and recommend arrays for order-dependent hooks

Context: #12276

Validation

  • git diff --check
  • hk run --check --safe --format json scoped to docs/hooks.md

AI-assisted — Tool: Codex; model: OpenAI/GPT-5; version: unavailable.


Note

Low Risk
Documentation-only clarification of hook execution order; no code or behavior changes.

Overview
Documents that matching hooks from multiple config files are additive, not overridden, and run from highest- to lowest-precedence files (arrays keep listed order within a file).

Adds a conf.d example (c, then b, then a) and recommends putting order-dependent hooks in one array.

Reviewed by Cursor Bugbot for commit d3c2821. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Documentation
    • Documented hook execution order across multiple configuration files.
    • Clarified precedence rules and ordering for hook entries and configuration fragments.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 34879a45-502b-4973-92a3-5d4b26bd8f3a

📥 Commits

Reviewing files that changed from the base of the PR and between 20375ee and d3c2821.

📒 Files selected for processing (1)
  • docs/hooks.md

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The hook documentation now states that all matching hooks execute across loaded configuration files. It defines descending precedence, listed array order, and alphabetical conf.d ordering.

Changes

Hook execution order

Layer / File(s) Summary
Document hook precedence and ordering
docs/hooks.md
The documentation states that matching hooks from all loaded configuration files execute in descending precedence order. Array entries retain their listed order, and alphabetical conf.d precedence determines cross-file order.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to d3c28

This documentation-only change clarifies hook ordering without changing product behavior or runtime code; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: risu729, marukome0743

Poem

A rabbit reads the hooks in line,
From highest perch to lower sign.
Arrays keep their order bright,
conf.d hops by alphabetic right.
All matching hooks now run along.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the documentation change that clarifies hook execution order across configuration files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Clarifies how hooks are combined and ordered across multiple configuration files.

  • Documents that matching hooks are additive rather than overridden.
  • Explains highest-to-lowest precedence and reverse-alphabetical conf.d execution.
  • Recommends a single ordered array for hooks with ordering dependencies.

Confidence Score: 5/5

The documentation-only change appears safe to merge.

The documented additive behavior, highest-to-lowest config precedence, reverse-alphabetical fragment example, and listed array ordering agree with the hook-loading behavior.

Important Files Changed

Filename Overview
docs/hooks.md The added guidance accurately reflects cross-file precedence and within-file array ordering; no actionable issue was identified.

Reviews (1): Last reviewed commit: "docs(hooks): clarify cross-file executio..." | Re-trigger Greptile

@jdx
jdx merged commit 1501d61 into main Aug 22, 2026
24 of 26 checks passed
@jdx
jdx deleted the docs/clarify-hook-order branch August 22, 2026 18:09
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