Skip to main content
rule CX Codex

caliber-pre-commit — Claude Code rule: what it does, how to install

caliber-pre-commit — a commit-time rule: it checks for the Caliber git hook and, when the hook is absent, syncs and stages your agent config files.

MIT ★ 1,319 updated 2026-09-24

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/caliber-pre-commit.mdc
Open on GitHub

What caliber-pre-commit does

The rule runs on every commit. Before anything gets fixed in history, the agent greps .git/hooks/pre-commit for caliber and lands on one of two answers.

With the hook in place, the commit goes through untouched and Caliber handles the sync on its own. Without it, the agent calls caliber refresh, stages CLAUDE.md, .claude/, .cursor/, .cursorrules, .github/copilot-instructions.md, .github/instructions/, AGENTS.md and CALIBER_LEARNINGS.md, then reports what changed.

If caliber is missing entirely, the rule points the agent to .cursor/skills/setup-caliber/SKILL.md, where the setup-caliber skill walks through installing Caliber. So the rule only pays off once the CLI exists on the machine. Until then each commit ends in the same install detour.

What it helps with

  • keep agent config files current before a commit
  • check whether the Caliber hook sits in .git/hooks/pre-commit
  • stage refreshed CLAUDE.md and .claude/ files after a sync
  • find out what a sync actually changed
  • install Caliber when the command is missing

Example prompts for the agent

  • Commit these changes and make sure the agent configs are up to date.
  • Run caliber refresh before the commit and stage the updated files.
  • Check whether the Caliber hook is installed in this repo.

How to install caliber-pre-commit

Manually: put the files in place

.cursor/rules/caliber-pre-commit.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about caliber-pre-commit

How to install caliber-pre-commit in Claude Code?

Copy the rule file to .claude/rules/caliber-pre-commit.md. From then on it applies to every commit.

What does caliber-pre-commit do?

It checks whether the Caliber hook exists in .git/hooks/pre-commit. When the hook is absent, it runs caliber refresh and stages the refreshed agent configs before you commit.

What do I need for the rule to work?

A working caliber command. Without it the rule sends the agent to .cursor/skills/setup-caliber/SKILL.md to follow the setup-caliber skill and install Caliber first.

Source text

caliber-pre-commit.mdc · MIT
---
description: Run Caliber sync before git commits to keep agent configs up to date
alwaysApply: true
---
Before every git commit, check if the Caliber pre-commit hook is installed:
Run: `grep -q "caliber" .git/hooks/pre-commit 2>/dev/null && echo "hook-active" || echo "no-hook"`

If hook-active: just commit normally — Caliber syncs automatically via the hook. Tell the user: "Caliber will sync your agent configs automatically."
If no-hook: run `caliber refresh && git add CLAUDE.md .claude/ .cursor/ .cursorrules .github/copilot-instructions.md .github/instructions/ AGENTS.md CALIBER_LEARNINGS.md 2>/dev/null` before committing, and tell the user what was updated.

If `caliber` is not found, read the setup-caliber skill from .cursor/skills/setup-caliber/SKILL.md and follow its instructions to install Caliber.

© caliber-ai-org · MIT · caliber-ai-org/ai-setup

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

From the same set17

The whole set →
caliber-conventions The caliber-conventions rule sets conventions for Caliber TypeScript CLI development. Use it to guide an agent working on project code, tests, and commits. CX Codex +1 ★ 1,319repo stars testing-patterns testing-patterns is a Claude Code rule for Vitest conventions: test locations, LLM mocks, and running a single spec. CX Codex +1 ★ 1,319repo stars scoring-patterns scoring-patterns defines coding rules for the src/scoring/** directory. It keeps scoring checks deterministic without external network calls or random values. CX Codex +1 ★ 1,319repo stars llm-patterns The llm-patterns rule sets patterns for LLM providers in a project. Use it when provider interfaces, model settings, CLI errors, or streamed responses need consistent handling. CX Codex +1 ★ 1,319repo stars find-skills find-skills discovers community skills from the Caliber registry and installs them directly into your coding session. CX Codex +1 ★ 1,319repo stars save-learning save-learning turns a user's lasting preferences into project learnings. Use it when an agent should carry a rule from one session into the next. CX Codex +1 ★ 1,319repo stars setup-caliber setup-caliber walks a project through Caliber setup: installs the CLI, hooks agent config sync into every commit, and creates the config files your agents are missing. CX Codex +1 ★ 1,319repo stars adding-a-command adding-a-command generates Commander.js CLI commands in src/commands/, connects them to src/cli.ts, and sets up telemetry tracking. CX Codex +1 ★ 1,319repo stars

Project sponsors

Companies that keep this analytics open