---
id: protect-main-branch
track: coding
version: 0.0.5
label: advisory
keyword: advise
where: text
sha256: 0a5d5865b6258b60dea44d05e38bcd58506ac50c13123d35e88a69a598e9aacd
source: https://github.com/open-coder-ai/chock-catalog/tree/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/base/protect-main-branch
catalog_ref: e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4
---

# Protect Main Branch

protect-main-branch · version 0.0.5

Advisory — Advisory only. It is skill text, and nothing stops a violation. Chock adds friction. It is not a security boundary. 

In a git repo: at commit (Chock refuses the commit, locally and in CI.)

 Advisory inside the agent. In a repo set up with chock init, chock enforces it at commit.

## What it does

Keeps agents off main and master: a git hook reads the current branch at commit time and parses the refs being pushed at push time. The hook refuses a violation only where it is installed. As skill text alone this is advice, and nothing stops one.

## Its label on each agent

- Claude Code (tested): Advisory — Advisory only. It is skill text, and nothing stops a violation. Builder: /coding/builder/#client=claude-code&p=protect-main-branch
- Cursor (tested): Advisory — Text only in a plugin. Nothing in the plugin stops a violation. The plugin does not carry the enforcement the manifest declares. Builder: /coding/builder/#client=cursor&p=protect-main-branch
- Codex (tested): Advisory — Text only in a plugin. Nothing in the plugin stops a violation. The plugin does not carry the enforcement the manifest declares. Builder: /coding/builder/#client=codex&p=protect-main-branch
- GitHub Copilot (tested): Advisory — Text only in a plugin. Nothing in the plugin stops a violation. The plugin does not carry the enforcement the manifest declares. Builder: /coding/builder/#client=copilot&p=protect-main-branch
- Devin (tested): Advisory — Text only in a plugin. Nothing in the plugin stops a violation. The plugin does not carry the enforcement the manifest declares. Builder: /coding/builder/#client=devin&p=protect-main-branch
- Grok (tested): Not graded yet for Grok. Builder: /coding/builder/#client=grok&p=protect-main-branch
- goose (tested): Not graded yet for goose. Builder: /coding/builder/#client=goose&p=protect-main-branch
- Antigravity (tested): Not graded yet for Antigravity. Builder: /coding/builder/#client=antigravity&p=protect-main-branch
- OpenHands (untested): Not graded yet for OpenHands. Builder: /coding/builder/#client=openhands&p=protect-main-branch
- Kimi Code (untested): Not graded yet for Kimi Code. Builder: /coding/builder/#client=kimi-code&p=protect-main-branch
- Factory Droid (untested): Not graded yet for Factory Droid. Builder: /coding/builder/#client=factory-droid&p=protect-main-branch

## What it misses

This policy does not state what it misses.

## Examples

- Refused: The agent is on main and runs git commit.
- Allowed: The agent is on a feature branch and commits.

## Latest change

0.0.5 · 2026-11-09 — Changelog order only (IR-F46): entries had been added at the top of a list that ran oldest-first, so it rose and fell by version; they now run newest-first throughout. No entry's text or version, and no rule, guard or eval, changed. Patch bump because the manifest is part of the published pack hash.

## Provenance

- Tested by 4 of 4 cases run automatically
- SHA-256: `0a5d5865b6258b60dea44d05e38bcd58506ac50c13123d35e88a69a598e9aacd`
- Catalog commit: https://github.com/open-coder-ai/chock-catalog/commit/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4
- Source: https://github.com/open-coder-ai/chock-catalog/tree/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/base/protect-main-branch (catalog path `base/protect-main-branch`)
- Presets: Git hygiene
- JSON: `/api/coding/policies/protect-main-branch.json`
- Report a problem: https://chock.sh/report/?policy=protect-main-branch&version=0.0.5&page=%2Fcoding%2Fpolicies%2Fprotect-main-branch%2F
