CodeGate is a local quality gate for Claude Code, Codex and plain Git. Before an agent commits, pushes or opens a PR, it runs your tests, lint and type checks. If anything fails, the command is blocked and the agent is told what to fix.
● Claude wants to run git commit -m "add totals" PreToolUse · CodeGate OK merge conflicts OK python syntax OK secret patterns FAIL unit tests AssertionError: -1 != 5 BLOCKED Fix the failures, then rerun the same action. ● Claude fixes add() and retries PASS 4 checks · commit allowed
There is no AI reviewer and no API key. CodeGate only runs the checks your repository declares in codegate.toml, and it enforces them in three places.
Claude or Codex wants to run git commit, git push, gh pr create or a deploy command you listed.
The plugin's PreToolUse hook runs conflict, syntax and secret scans plus your configured commands.
On pass, the normal permission flow continues. On fail, the command is denied with the failing output.
pre-commit and pre-push hooks gate ordinary Git, and the same runner can be a required CI check.
The plugins load in every project, but they only act in repositories you opted in on your machine: a codegate.toml plus a one-time init. Everywhere else, commands pass through untouched. Requires Python 3.11+ on macOS or Linux.
# inside Claude Code /plugin marketplace add Relay-harness/codegate /plugin install codegate@codegate # then, in the repo you want to protect /codegate:setup
codegate_check) and two skills./codegate:setup in your repo. It detects your test and lint scripts, writes codegate.toml and installs Git hooks.codegate.toml and .codegate/runner.py. Use /codegate:check any time.# add the marketplace codex plugin marketplace add Relay-harness/codegate # restart the ChatGPT desktop app, open Plugins, # install "codegate", then trust its hook in /hooks # in the repo you want to protect uvx --from git+https://github.com/Relay-harness/codegate.git \ codegate init --git
/hooks. Codex does not run plugin hooks until you review them.setup skill, or by running init yourself. Its codegate_check MCP tool takes the repository path.Works in local Codex threads, where tools can reach your files. The ChatGPT web app cannot run local tests, so CodeGate cannot gate code written there. Use the Git hooks and required CI for that.
uv tool install git+https://github.com/Relay-harness/codegate.git # in your repository codegate init --claude --git codegate doctor codegate check # in CI python3 .codegate/runner.py check --json
python3 .codegate/runner.py install --git after cloning.Commands are argv arrays with no implicit shell. They run in order, stop at the first failure, and each has a time limit. With no checks configured, shipping stays blocked. An empty policy never counts as a pass.
# codegate.toml
version = 1
timeout = 300
secret_scan = true
ship_commands = ["npm publish", "vercel --prod"]
[[checks]]
name = "tests"
command = ["npm", "run", "test"]
timeout = 120A pass means your declared checks passed on the code that was checked. It does not mean the code is bug-free.
git commit and git push through hooks