Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

Remind Claude Code to tag commits with customer attribution

merged#2857CedarCopilot

CedarCopilot wants to merge 0 commits into staging from feat/customer-trailer-commit-hook

Live on prod, watching, 1 day leftTimeline and evidence
  1. Opened
    Sep 21, 2026, 5:45 AM
  2. Merged
    Sep 21, 2026, 6:14 AM
  3. Live on prod
    Sep 21, 2026, 6:14 AM
  4. Observed 0 hours
    Sep 21, 2026, 6:14 AM
  5. Watching

    Live on prod, watching, 1 day left

    Sep 21, 2026, 6:14 AM
  6. Pipelines steady after this deploy
    Sep 21, 2026, 6:14 AM

Behaviors Libra is checking

When Claude Code stages files with `git add`, it reminds the developer to add a `Customer: <name>` commit trailer for customer-specific work, comma-separating multiple customers and omitting the trailer otherwise.Not checked
prod

Libra has verdicts on 0 of 1 tracked behaviors on prod; 1 is still being checked. Libra checks hourly for 3 days after each deploy.

Summary

  • Adds a PreToolUse hook in .claude/settings.json that fires on git add (before the commit message is composed) and reminds the agent to add a Customer: <name> trailer when the upcoming commit was built to fix a specific customer's bug, or started from investigating a specific customer's setup/problems/features/use cases.
  • Kept out of CLAUDE.md deliberately so it doesn't sit in every message's context all session , it only surfaces right before staging a commit.
  • No trailer is required or enforced; when there's no customer link, the trailer is simply omitted (no Customer: none boilerplate).

Why git add instead of git commit

A hook matched on git commit fires only after the full commit command (including the -m message) is already composed, so its reminder always arrives one commit too late. Matching on git add (which almost always happens as its own step before the commit is composed) gets the reminder into context in time to actually shape the message. Known gap: a combined git commit -am "..." skips the separate staging step, so that specific commit would miss the reminder.

Test plan

  • Validated JSON syntax and hook schema with jq -e
  • Pipe-tested the hook command directly against a synthetic PreToolUse payload
  • Confirmed live: fired on git add --dry-run, stayed silent on unrelated commands (true), and confirmed a hook on git commit fires too late (context arrives after the commit already executes)

šŸ¤– Generated with Claude Code

RetriggerConfidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

Summary

Adds a Claude Code PreToolUse hook that conditionally reminds agents staging changes with git add to include customer attribution in the eventual commit message when appropriate.

  • Limits the reminder to matching Bash tool calls.
  • Emits the reminder as additional hook context.
  • Leaves customer attribution optional when no customer is associated with the work.

Reviews (1) Ā· Last reviewed commit: "feat(claude-config): remind agents to ta..."

Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • .claude/settings.jsonno production surface mapped