Self-hostable AI code review for GitHub.
Use your Claude Code or Codex subscription. No API key needed.
CroCode runs Claude Code,
Codex, or OpenCode in a read-only container, checks every finding against
the diff, and posts inline review comments with severity and suggested
fixes.
CroCode works with the plan you already pay for:
- Claude Code: Use your Claude subscription. Run
claude setup-tokenand setCLAUDE_CODE_OAUTH_TOKEN. - Codex: Use your ChatGPT subscription. Sign in once with
codex login --device-authand setCROCODE_CODEX_AUTH_DIR.
You do not need a per-token API bill. Reviews count against your plan usage limits. API keys also work. See subscription setup.
Note
CroCode is in development. See the releases for available versions.
flowchart LR
GH[GitHub webhook] --> API[Rust API]
API --> DB[(Postgres queue)]
DB --> Worker[Rust worker]
Worker --> SAST[Offline OpenGrep scan]
SAST --> Sandbox[Read-only agent container]
Sandbox --> Validate[Validate and dedupe]
Validate --> Review[GitHub review]
Web[Next.js dashboard] --> API
- The API verifies the webhook signature and queues the pull request.
- A worker claims the job and mints a token for that one repository.
- The worker reads
.crocode.ymlfrom the base commit, not from the pull request. - OpenGrep scans the changed files in an offline sandbox. Its results go to the agent as hints.
- The agent reviews the diff in a container with a read-only checkout and no GitHub token.
- CroCode drops findings outside the diff, removes duplicates, and redacts secrets.
- CroCode posts one
COMMENTreview. It never approves or blocks a pull request.
A new push cancels the old review. A commit that already has a review is not reviewed again.
Sign in with GitHub. Choose an installation to set its agent and model and to follow its review history. Open a review to read each finding and its suggested fix. Admins can retry failed reviews and cancel queued ones. The overview shows agent health, run time, and token usage. An opt-in weekly security digest posts Dependabot alert changes to a chat webhook. The screenshots use demo data.
You need a Linux host with Docker Compose. The worker starts sandbox containers through the Docker socket, so give CroCode a dedicated host.
git clone https://github.com/kacigaya/crocode.git
cd crocode
cp .env.example .env && chmod 600 .envTo let a coding agent do these steps, open the repository in Claude Code or Codex and ask it to set up CroCode.
The crocode-setup skill in .agents/skills/ guides the agent. It asks before sudo commands and never shows secrets.
-
Set separate database setup and runtime passwords and your agent credentials in
.env. Keep each password consistent with its connection URL. For Claude, use a subscription token fromclaude setup-tokenor an API key. For Codex, use a ChatGPT subscription login or an API key. Leave the GitHub App values empty. The dashboard creates the app. -
Set
DOCKER_GIDto the output ofstat -c '%g' /var/run/docker.sock. -
Create the work directory. The host path and the worker path must match.
sudo install -d -m 0755 -o 10000 -g 10000 /var/lib/crocode/work
-
Build the sandbox image and start everything.
sudo docker build -t crocode-sandbox:latest docker/sandbox sudo docker compose --profile dashboard up -d --build
-
Put an HTTPS reverse proxy in front of the stack. Route
/webhooks/githubto the API on port 8080. Route everything else to the dashboard on port 3000. -
Get the setup link from the dashboard logs.
sudo docker compose logs web | grep setup -
Open the link on your public address. Confirm the address and the app name, then click Create the GitHub App. GitHub asks you to confirm. CroCode saves the credentials, and the API and worker start on their own.
-
Follow the steps on the done page: install the app, upload the logo, and sign in.
To configure the app by hand instead, see GitHub App setup. Environment variables always take precedence over the stored app.
Add .crocode.yml to the default branch. Every field is optional.
agent: claude # claude, codex, or opencode
min_severity: low # info, low, medium, high, critical
max_comments: 20
review_drafts: false
ignore:
- "docs/**"
instructions: |
Focus on authentication and data loss.| Agent | Read-only mode | Credentials |
|---|---|---|
| Claude Code | --bare --restricted, tools Read,Grep,Glob only |
Claude subscription token in CLAUDE_CODE_OAUTH_TOKEN, or ANTHROPIC_API_KEY |
| Codex | --sandbox read-only |
ChatGPT subscription login in CROCODE_CODEX_AUTH_DIR, or CODEX_API_KEY |
| OpenCode | Every permission denied except read, glob, and grep | Provider key, for example OPENROUTER_API_KEY |
Codex needs bubblewrap namespaces. Docker's default profile blocks them, so the example config enables Claude and OpenCode only. See image builds and checks before you enable Codex.
Read the documentation site on GitHub Pages.
It needs no sign-in. A local copy is also available at /docs on the dashboard.
The source guides are available here:
cargo fmt --all --check
cargo clippy --all-targets -- -D warnings
cargo test --all
DATABASE_URL=postgres://postgres:postgres@127.0.0.1:55432/postgres \
cargo test --all -- --include-ignoredThe dashboard lives in web/ and uses Bun: bun install, bun run lint,
bun run typecheck, bun test, and bun run build.
CroCode treats all pull request content as hostile. Agents get read-only tools, credentials stay out of the sandbox, and published text is escaped so it cannot ping users or load images. Sandbox network egress is open by default. Read the security model before you review untrusted code.
Apache License 2.0. See LICENSE.