Skip to content

ci: add aireceipts auto-attach hook (two-file kit)#2033

Merged
anandgupta42 merged 2 commits into
masterfrom
dogfood/aireceipts-auto-attach
Jul 8, 2026
Merged

ci: add aireceipts auto-attach hook (two-file kit)#2033
anandgupta42 merged 2 commits into
masterfrom
dogfood/aireceipts-auto-attach

Conversation

@anandgupta42

@anandgupta42 anandgupta42 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds the aireceipts auto-attach hook (second file of the two-file kit) by merging a hooks.PreToolUse entry into the existing .claude/settings.json — your permissions and mcpServers config is preserved unchanged.

The hook runs npx -y aireceipts-cli@latest hook pre-push: it never blocks your push (exits 0 always, no output) and only acts on a real branch push to origin, so receipts generate automatically for the existing pr-check workflow to post. This repo runs no other refs/receipts/* producer (no collision). Revert anytime. Part of the org-wide aireceipts dogfood (v0.6.0).


Note

Low Risk
Local Claude tooling config only; no app runtime, auth, or deployment paths change.

Overview
Extends .claude/settings.json with a hooks.PreToolUse rule for Bash that runs npx -y aireceipts-cli@latest hook pre-push (60s timeout), so receipt generation can run before shell/git push actions without changing existing permissions or mcpServers.

MCP args arrays are reformatted to multi-line only; behavior is unchanged.

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

Summary by CodeRabbit

  • Chores
    • Reformatted the local AI tool configuration to use multi-line array formatting for improved readability (behavior unchanged).
    • Added a pre-execution hook for shell-based actions that runs an aireceipts-cli pre-push check before operations proceed.
    • Included a 60-second timeout to keep the validation fast and responsive.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Updates .claude/settings.json by reformatting existing MCP server arguments and adding a new PreToolUse Bash hook that runs aireceipts-cli with a 60-second timeout.

Changes

Claude Settings Hook

Layer / File(s) Summary
Reformat MCP server args
.claude/settings.json
Rewrites the Playwright and Azure mcpServers args arrays into multi-line form without changing their values.
Add Bash pre-tool hook
.claude/settings.json
Adds a top-level hooks section with a PreToolUse hook for the Bash matcher that runs npx -y aireceipts-cli@latest hook pre-push and sets timeout to 60.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly identifies the main change: adding an aireceipts auto-attach hook.
Description check ✅ Passed The description is mostly complete and explains the change, though it omits explicit Problem, How to test, Screenshot/Demo, and checklist details.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dogfood/aireceipts-auto-attach

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.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfde8c3381

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .claude/settings.json
"hooks": [
{
"type": "command",
"command": "npx -y aireceipts-cli@latest hook pre-push",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Constrain the receipt hook to git pushes

In Claude Code sessions for this repo, the PreToolUse group matches every Bash tool call, and because this handler has no if guard, unrelated commands such as tests, rg, or cat still spawn npx -y aireceipts-cli@latest and wait until it exits or hits the 10s timeout. Claude Code hook resolution supports narrowing Bash handlers with an if pattern to avoid this process-spawn overhead, so this should be filtered to the git-push commands the receipt hook actually needs; otherwise normal terminal work is slowed and noisy whenever npm is cold, offline, or cannot resolve the package.

Useful? React with 👍 / 👎.

Comment thread .claude/settings.json
"hooks": [
{
"type": "command",
"command": "npx -y aireceipts-cli@latest hook pre-push",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pin the hook CLI version

This committed project hook executes aireceipts-cli@latest, so every Claude Code user can run newly published hook code and receipt-generation behavior without any reviewed repo change; I checked npx --help, which describes running local or remote npm package specs as <pkg>[@<version>], and this line deliberately selects the moving latest tag. Since the commit message says the dogfood target is v0.6.0, pinning that version (or vendoring the hook) avoids future CLI releases unexpectedly changing or breaking pushes for contributors.

Useful? React with 👍 / 👎.

Comment thread .claude/settings.json Outdated
{
"type": "command",
"command": "npx -y aireceipts-cli@latest hook pre-push",
"timeout": 10

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow the npx hook to finish on cold installs

On the first git push from a developer machine, npx -y aireceipts-cli@latest may need to resolve and download the package before the receipt logic runs, but this hook gives Claude Code only 10 seconds before cancellation; the Claude hook reference defines timeout as seconds before canceling the handler. In cold npm-cache or slow-network environments the push still proceeds silently while the receipt is never generated, leaving the existing pr-check workflow with nothing to post, so the hook needs a larger timeout or a preinstalled/pinned local executable.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.claude/settings.json (1)

25-25: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Consider pinning the CLI version for reproducibility.

Using @latest means the hook's behavior can change at any time if a new version is published. While this is consistent with the CI workflow's usage, pinning to a specific version (e.g., aireceipts-cli@0.6.0) would improve reproducibility and reduce supply-chain risk for a hook that runs on every bash command.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/settings.json at line 25, The pre-push hook command in the settings
config uses aireceipts-cli@latest, which makes the hook non-reproducible and
subject to unexpected changes. Update the command to use a pinned aireceipts-cli
version instead of `@latest`, keeping it consistent with the hook setup in the
settings configuration and ensuring the version is explicit and stable.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/settings.json:
- Around line 21-26: The Bash hook command in the settings configuration can
still return a non-zero exit code and block all Bash tool invocations. Update
the hook entry for the `command` used by the `hooks` array so it cannot fail the
caller, and make sure the non-blocking safeguard is applied directly in the
configuration alongside the `Bash` matcher and `npx -y aireceipts-cli@latest
hook pre-push` invocation.

---

Nitpick comments:
In @.claude/settings.json:
- Line 25: The pre-push hook command in the settings config uses
aireceipts-cli@latest, which makes the hook non-reproducible and subject to
unexpected changes. Update the command to use a pinned aireceipts-cli version
instead of `@latest`, keeping it consistent with the hook setup in the settings
configuration and ensuring the version is explicit and stable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d2bde75b-0361-49c0-8baf-977acd9a8e67

📥 Commits

Reviewing files that changed from the base of the PR and between 17d4245 and bfde8c3.

📒 Files selected for processing (1)
  • .claude/settings.json

Comment thread .claude/settings.json Outdated
Comment on lines +21 to +26
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "npx -y aireceipts-cli@latest hook pre-push",
"timeout": 10

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Add || true to enforce the "never block" guarantee at the configuration level.

The PR objectives state the hook "always exit with 0" and "never block a push," but the command has no exit-code safeguard. If aireceipts-cli exits non-zero (network error, bug, unexpected input), the PreToolUse hook could block the tool execution. This is especially critical because the Bash matcher fires on every Bash tool invocation — not just git push — so a CLI failure would block all bash commands, not just pushes.

The PR objectives also claim the hook "only runs on a real branch push to origin," but the Bash matcher doesn't enforce this; filtering must happen inside the CLI tool. Every bash command will incur npx overhead regardless.

🛡️ Proposed fix: append `|| true` to guarantee non-blocking behavior
           {
             "type": "command",
-            "command": "npx -y aireceipts-cli@latest hook pre-push",
+            "command": "npx -y aireceipts-cli@latest hook pre-push || true",
             "timeout": 10
           }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "npx -y aireceipts-cli@latest hook pre-push",
"timeout": 10
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "npx -y aireceipts-cli@latest hook pre-push || true",
"timeout": 10
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/settings.json around lines 21 - 26, The Bash hook command in the
settings configuration can still return a non-zero exit code and block all Bash
tool invocations. Update the hook entry for the `command` used by the `hooks`
array so it cannot fail the caller, and make sure the non-blocking safeguard is
applied directly in the configuration alongside the `Bash` matcher and `npx -y
aireceipts-cli@latest hook pre-push` invocation.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bundle Size Report

darwin-arm64: 75.6 MB
Category Size Compressed Files
Native: altimate-core 43.1 MB 15.4 MB 1
Webview JS bundles 36.1 MB 12.3 MB 346
Media assets 29.6 MB 25.8 MB 91
Native: zeromq 20.5 MB 8.2 MB 15
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.8 MB 0.6 MB 1
Python packages 2.0 MB 0.5 MB 95
Native: other node_modules 1.0 MB 0.2 MB 139
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 30 KB 17
Total 151.7 MB 75.5 MB 730
linux-x64: 77.5 MB
Category Size Compressed Files
Native: altimate-core 50.7 MB 16.8 MB 1
Webview JS bundles 36.1 MB 12.3 MB 346
Media assets 29.6 MB 25.8 MB 91
Native: zeromq 21.9 MB 8.7 MB 16
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.8 MB 0.6 MB 1
Python packages 2.0 MB 0.5 MB 95
Native: other node_modules 1.0 MB 0.2 MB 139
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 30 KB 17
Total 160.7 MB 77.4 MB 731
win32-x64: 77.9 MB
Category Size Compressed Files
Native: altimate-core 55.9 MB 17.4 MB 1
Webview JS bundles 36.1 MB 12.3 MB 346
Media assets 29.6 MB 25.8 MB 91
Native: zeromq 20.0 MB 8.1 MB 15
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.8 MB 0.6 MB 1
Native: other node_modules 2.3 MB 0.7 MB 147
Python packages 2.0 MB 0.5 MB 95
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 31 KB 17
Total 165.3 MB 77.8 MB 738

@kilo-code-bot

kilo-code-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No New Issues Found | Recommendation: Merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0

Kilo independently reviewed the changed config and found no new issues beyond what other reviewers have already raised on this PR — no new inline comments were added.

The substantive design points are already covered by existing comments (no duplicates added):

  • Bash matcher scope — the PreToolUse hook fires on every Bash tool call, not only git push (codex).
  • Version pinningaireceipts-cli@latest is unpinned, so behavior can shift without a repo change (codex, CodeRabbit).
  • Non-blocking safeguard — there is no || true; the "always exits 0 / never blocks" guarantee relies entirely on the CLI rather than the config (CodeRabbit).
  • Timeout — the original 10s concern was resolved by the 10s -> 60s bump in commit 2.
Files Reviewed (1 file)
  • .claude/settings.json — adds a hooks.PreToolUse Bash entry running npx -y aireceipts-cli@latest hook pre-push (timeout 60s); reformats existing mcpServers args arrays to multi-line (cosmetic, behavior unchanged).

Reviewed by glm-5.2 · Input: 42.2K · Output: 8.7K · Cached: 144.8K

Review guidance: REVIEW.md from base branch master

@dev-punia-altimate

Copy link
Copy Markdown
Contributor

🤖 Code Review — OpenCodeReview (Gemini) — No Issues Found

No comments generated. Looks good to me.

@anandgupta42 anandgupta42 merged commit a60f825 into master Jul 8, 2026
29 checks passed
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