Keep your coding agents on track.
Codecut turns project rules into automatic checks. When an agent breaks a rule, Codecut explains what happened and how to fix it.
git push commands whose outgoing branch diff has Codecut lint findingsCodecut only blocks behavior it can check reliably. Everything else stays visible as advice.
macOS and Linux:
curl -fsSL https://raw.githubusercontent.com/treadiehq/codecut/main/scripts/install.sh | bash
Windows PowerShell:
irm https://raw.githubusercontent.com/treadiehq/codecut/main/scripts/install.ps1 | iex
Set up Claude Code for every repository:
codecut setup
This is equivalent to codecut setup --user --agent claude. It installs a
user-level hook that works in every repository and starts with a safe warning
for temporary agent context left in code comments.
For a different agent, select it explicitly:
codecut setup --user --agent cursor
codecut setup --user --agent codex
codecut setup --user --agent devin
codecut setup --user --agent opencode
codecut setup --user --agent polytoken
Remove --user to configure only the current project:
codecut setup --agent claude
codecut setup --agent cursor
Check that everything works:
codecut status
codecut test
Write rules in AGENTS.md, CLAUDE.md, .cursor/rules, or .devin/rules:
- All unit tests must pass
- Keep comment lines below 15% of added source lines
- Require clean Codecut lint for git push
- Open a non-draft PR
Refresh the policy:
codecut setup --agent cursor --refresh-policy --accept
--accept activates rules that can block work. Without it, new blocking rules
stay advisory.
Personal rules that should work in every repository live in
~/.config/codecut/AGENTS.md. Refresh them with:
codecut setup --user --agent cursor --refresh-policy --accept
git pushCodecut only blocks behavior it can verify. Everything else remains advice.
Claude Code, Cursor, Codex, Devin, OpenCode, and Polytoken have native setup. For T3 Code, configure the Claude, Codex, or OpenCode provider it launches.
Private and unsupported agents can use the versioned JSON hook protocol:
codecut hook --agent generic --schema
Send one JSON event on stdin and read one JSON decision from stdout. Custom
agents must honor the returned action.
Try Codecut on any repository or pull request:
codecut lint
codecut lint --staged
codecut lint --base origin/main
codecut lint --pr 123
codecut status # Show active rules and hook health
codecut test # Check that the rules work
codecut update # Install the latest release and refresh project hooks
pnpm install
pnpm check
pnpm build:binary
TypeScript
92.2%
JavaScript
5.8%
Shell
1.1%
Keep your coding agents on track.
Codecut turns project rules into automatic checks. When an agent breaks a rule, Codecut explains what happened and how to fix it.
git push commands whose outgoing branch diff has Codecut lint findingsCodecut only blocks behavior it can check reliably. Everything else stays visible as advice.
macOS and Linux:
curl -fsSL https://raw.githubusercontent.com/treadiehq/codecut/main/scripts/install.sh | bash
Windows PowerShell:
irm https://raw.githubusercontent.com/treadiehq/codecut/main/scripts/install.ps1 | iex
Set up Claude Code for every repository:
codecut setup
This is equivalent to codecut setup --user --agent claude. It installs a
user-level hook that works in every repository and starts with a safe warning
for temporary agent context left in code comments.
For a different agent, select it explicitly:
codecut setup --user --agent cursor
codecut setup --user --agent codex
codecut setup --user --agent devin
codecut setup --user --agent opencode
codecut setup --user --agent polytoken
Remove --user to configure only the current project:
codecut setup --agent claude
codecut setup --agent cursor
Check that everything works:
codecut status
codecut test
Write rules in AGENTS.md, CLAUDE.md, .cursor/rules, or .devin/rules:
- All unit tests must pass
- Keep comment lines below 15% of added source lines
- Require clean Codecut lint for git push
- Open a non-draft PR
Refresh the policy:
codecut setup --agent cursor --refresh-policy --accept
--accept activates rules that can block work. Without it, new blocking rules
stay advisory.
Personal rules that should work in every repository live in
~/.config/codecut/AGENTS.md. Refresh them with:
codecut setup --user --agent cursor --refresh-policy --accept
git pushCodecut only blocks behavior it can verify. Everything else remains advice.
Claude Code, Cursor, Codex, Devin, OpenCode, and Polytoken have native setup. For T3 Code, configure the Claude, Codex, or OpenCode provider it launches.
Private and unsupported agents can use the versioned JSON hook protocol:
codecut hook --agent generic --schema
Send one JSON event on stdin and read one JSON decision from stdout. Custom
agents must honor the returned action.
Try Codecut on any repository or pull request:
codecut lint
codecut lint --staged
codecut lint --base origin/main
codecut lint --pr 123
codecut status # Show active rules and hook health
codecut test # Check that the rules work
codecut update # Install the latest release and refresh project hooks
pnpm install
pnpm check
pnpm build:binary
TypeScript
92.2%
JavaScript
5.8%
Shell
1.1%