Skip to main content
hook CX Codex

repopilot — Claude Code hook: stops agents that weaken tests and CI

repopilot takes a repo snapshot at session start and checks it again before the agent stops. If tests, suppressions or CI gates got weaker, the session will not end quietly.

no license ★ 1,596 updated 2026-10-29

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/settings.json
Open on GitHub

What repopilot does

The hook has two jobs. SessionStart runs snapshot.sh to capture how the repository looks before the agent touches anything. Stop runs guard.sh, which compares the current state with that snapshot. If the agent weakened tests, slipped in suppressions or bypassed CI gates, the hook stops it. One signal, one stop. Everything runs locally, so the outcome is deterministic.

Because the snapshot happens at session start, the comparison is not against git history but against the state right before the agent began. This catches edits that have not been committed yet. The timeouts are generous: 60 seconds for the snapshot, 180 for the pre-stop review.

Installation for Claude Code means editing .claude/settings.json. The scripts live in ${CLAUDE_PLUGIN_ROOT}/scripts/. If an agent removes a test to make a build pass, the hook blocks the session from wrapping up cleanly.

What it helps with

  • detect when an agent removed or weakened tests
  • catch suppressions added to silence errors
  • stop CI gate bypasses before they get committed
  • capture a repo snapshot before the session starts
  • review the agent's output before the session ends

Example prompts for the agent

  • Start a session so repopilot takes a repo snapshot
  • Stop the agent and check if it weakened any tests
  • Review the repository state before finishing the session

How to install repopilot

Manually: put the files in place

.claude/settings.json

The hooks block: event (PreToolUse, PostToolUse, Stop…) → command. Personal ones go to ~/.claude/settings.json

Step by step, with commands for each platform: Claude Code hooks: what they are, where to configure them, how to block a risky command

Questions about repopilot

How do I install repopilot in Claude Code?

Add the hook config to .claude/settings.json: on SessionStart run ${CLAUDE_PLUGIN_ROOT}/scripts/snapshot.sh with a 60-second timeout, on Stop run ${CLAUDE_PLUGIN_ROOT}/scripts/guard.sh with a 180-second timeout.

What does repopilot do?

It snapshots the repo when a session starts and compares the current state with that snapshot before the agent stops. If tests, suppressions or CI gates became weaker, the hook halts the agent.

Does repopilot work with Codex?

The hook ships with the repopilot plugin for Claude Code and triggers on SessionStart and Stop. It runs locally and needs no external services.

Similar hooks

Everything for Testing and QA →

From the same set391

The whole set →
stop-that-shit The stop-that-shit hook for Claude Code and Codex checks agent actions against explicit task modes and bounds decisions about dependencies, hashes, and subagents. CX Codex ★ 1,596repo stars board A SessionStart hook that tells the agent what is on the project board. The board lives in plain Markdown files, so you can read it straight from the terminal. CX Codex ★ 1,596repo stars steinwall The steinwall hook for Claude Code and Codex provides cost controls, action guards, and loop recovery for unattended agent sessions with shell execution. CX Codex ★ 1,596repo stars session-orchestrator session-orchestrator — a hook for Claude Code and Codex that wraps each agent session in structured planning, staged execution, and quality gates. Fires on SessionStart, PreToolUse, PostToolUse, Stop, and SubagentStop. CX Codex ★ 1,596repo stars codex-project-autopilot codex-project-autopilot — a hook for Claude Code and Codex that runs a check after every file write or edit. Fires automatically on PostToolUse events. CX Codex ★ 1,596repo stars praxis This hook loads Praxis triage when a session starts or resumes, so the agent can work toward a defined outcome instead of a step list. CX Codex ★ 1,596repo stars off-the-wall The off-the-wall hook quotes your earlier fixes into the prompt before every Codex answer. The model sees what you corrected before and stops repeating the same mistakes. CX Codex ★ 1,596repo stars nightshift nightshift binds Codex work sessions to strict time limits, tracking punch lists, deferred decisions, and run logs. CX Codex ★ 1,596repo stars

Project sponsors

Companies that keep this analytics open