Configuration reference
Save JSON at .github/codehawk.json. Provider, model and spend settings are read only from the repository's default branch through the contents API. Editing the settings file in a pull request does not change its model routes or caps before merge. Other sections keep their current source: the trusted base checkout for PR review, the reviewed checkout for weekly jobs, and the base commit for fix publication. Unknown keys and invalid types stop the relevant job. $schema and _comment are ignored.
The default-branch file does not protect caller workflow inputs. A collaborator who can push a branch can also edit that branch's caller workflow on pull_request events, including the inference document, cap inputs and workflow or action pins. A nonempty legacy inference input overrides file routes, and a cap input can raise or remove a file cap. Protect workflow files with CODEOWNERS and rulesets. The hosted Worker still requires an allowed released reusable workflow and enforces its event permission slice.
Models and spend caps
Section titled “Models and spend caps”Settings commands let repository writers propose provider, model and spend cap changes from a comment.
Start with two settings on the default branch and a provider key in the named Actions secret:
{ "provider": "openai", "model": "your-model-id" }There is no implicit provider, model or dollar cap. The automatic setup pull request writes a starter file with provider: "openai", model: "your-model-id" and caps of 1 USD per PR review and 0.10 USD per reply. Pick a provider and a model before merging. The setup page offers openai, anthropic, google and cloudflare. Other OpenAI-compatible endpoints: edit the file by hand, see the connection settings below. The _comment field explains setup and is ignored by the action. A cap of null removes the limit. Missing settings or a required key produce a setup comment and a failed job. Only the keys used by the job's primary and fallback roles are needed. Model checks are free GET requests before model work. A rejected key or unknown model stops the job. Rate limits, provider outages and inconclusive checks warn and continue. Cloudflare gateways are checked by the first model call. Compatible endpoints without a models list also rely on that call.
| Key | Accepted value | Meaning |
|---|---|---|
provider |
openai, anthropic, google, openai-compatible, cloudflare |
Connection type. Required together with model. |
model |
Model id, at most 200 characters, letters, numbers and ._:/-, starting with a letter or number |
Model used by omitted roles. |
base_url |
Public HTTPS endpoint | Required only for compatible and Cloudflare routes. Other providers forbid it. Compatible endpoints follow the endpoint policy. |
upstream |
openai, anthropic, google |
Required for Cloudflare, forbidden otherwise. |
credential |
Integer 1 through 8 | Optional explicit CODEHAWK_CREDENTIAL_N slot instead of the standard secret. |
reasoning_effort |
Empty, minimal, low, medium, high |
Optional model reasoning effort. |
price |
{ "input": 2, "output": 8 } |
Positive USD rates per million tokens. Compatible endpoints otherwise use the $10 input and $50 output ceiling. |
jobs |
Object keyed by the roles below | Optional per-role route overrides and ordered fallbacks, at most eight per role. |
caps |
Object keyed by the cap jobs below | Positive USD limits or null for uncapped. Omitted jobs are uncapped. |
| Provider | Standard secret |
|---|---|
| OpenAI | CODEHAWK_OPENAI_API_KEY |
| Anthropic | CODEHAWK_ANTHROPIC_API_KEY |
CODEHAWK_GOOGLE_API_KEY |
|
| OpenAI-compatible endpoint | CODEHAWK_GATEWAY_TOKEN |
| Cloudflare AI Gateway | CODEHAWK_GATEWAY_TOKEN |
Pass the secret under the reusable workflow's secrets: mapping. Composite actions take openai-api-key, anthropic-api-key, google-api-key and gateway-token. Never put a key value in the JSON. The standard secret names have no legacy-prefix aliases. Explicit credential slots retain their compatibility aliases for this release.
The ten roles are pr_review, pr_summary, pr_reply, weekly_security, weekly_bug, weekly_confirm, fix_issues, flows_plan, flows_driver and flows_diagnosis. A job that omits provider inherits the top-level connection and model. Its own model overrides the default. An explicit provider replaces all connection fields, including the credential selection. Reasoning effort inherits only with the connection, and price only with both connection and model. Each fallback must name a model, inherits the resolved job connection unless it names a provider, and uses only its own reasoning effort and price. Weekly confirmation must use a different model from the finder.
Compatible endpoint:
{ "provider": "openai-compatible", "base_url": "https://models.example.com/v1", "model": "vendor/model", "price": { "input": 2, "output": 8 } }Cloudflare gateway:
{ "provider": "cloudflare", "base_url": "https://gateway.ai.cloudflare.com/v1/your-account/review", "upstream": "anthropic", "model": "your-model-id" }Per-job overrides and a fallback:
{ "provider": "openai", "model": "your-model-id", "reasoning_effort": "low", "jobs": { "pr_review": { "model": "your-review-model", "fallbacks": [{ "provider": "anthropic", "model": "your-backup-model" }] }, "weekly_confirm": { "provider": "google", "model": "your-independent-model" }, "flows_driver": { "provider": "openai-compatible", "base_url": "https://models.example.com/v1", "model": "vendor/driver", "credential": 3 } }}| Cap job | Default | Deprecated section key | Deprecated caller override |
|---|---|---|---|
pr_review |
Uncapped | pr_review.max_usd |
REVIEW_PR_MAX_USD |
pr_reply |
Uncapped | pr_review.reply_max_usd |
None |
weekly |
Uncapped | weekly.max_usd |
REVIEW_WEEKLY_MAX_USD |
fix_issues |
Uncapped | fix_issues.max_usd |
FIX_ISSUES_MAX_USD |
fix_issues_per_issue |
Uncapped | fix_issues.max_usd_per_issue |
None |
flows |
Uncapped | None | FLOWS_MAX_USD |
{ "provider": "openai", "model": "your-model-id", "caps": { "pr_review": 1, "pr_reply": 0.1, "weekly": 3, "fix_issues": 3, "fix_issues_per_issue": 1, "flows": 1 } }Routes use a nonempty CODEHAWK_INFERENCE document first, with a deprecation warning, then the default-branch settings file. The document overrides file routes for one release. Caps still come from the file. Caps use a nonempty deprecated caller input first, then caps.<job>, then the deprecated section key on the default branch, then uncapped. Caller strings accept a positive number or uncapped. Empty means no override. JSON null explicitly removes a cap. Section keys retain their existing validation and warn when used. The legacy filename .github/codereview-hawk.json is tried on the same default branch when the new filename is absent.
A PR that changes the settings file gets this note in its summary, with its actual path and default branch:
This pull request changes
.github/codehawk.json. Code Hawk reviewed it with the settings onmain. The new settings apply after the change is merged.
A pull request that adds the first settings file gets a passing notice instead of a review, reply or pull request flow run: "This pull request adds .github/codehawk.json. Code Hawk reviews pull requests after it is merged." This applies only when the PR targets the default branch, both current and legacy settings files are absent there, and the current path is newly added in the PR. Code Hawk never reads the head copy for this check. It removes any stale setup comment and makes no model call. Modified or renamed files, existing default-branch settings and other target branches keep the normal checks. Merging the unchanged your-model-id starter produces the existing unknown model message when a usable provider key is present.
Settings paths must be relative and cannot contain ... Section-level model and reasoning keys remain refused. Use top-level settings or jobs instead.
Project
Section titled “Project”| Key | Accepted type | Default | Use |
|---|---|---|---|
project |
String | "this repository" |
The project name in prompts. |
stack |
String | "" |
A short stack description for PR review. |
Pull request review
Section titled “Pull request review”Keys below live under pr_review. None means there is no environment override.
| Key | Accepted type | Default | Override variable | Use |
|---|---|---|---|---|
base_branches |
String array | [] |
None | Accept any base if empty. |
rules |
String array | [] |
None | Rules used where a break causes a concrete fault. |
skip_paths |
String array of globs | [] |
None | Exclude additional paths. |
hand_written_below |
null or an object with paths (string array) and marker (regex string) |
null |
None | Review only additions below the marker in matching files. |
max_usd |
Positive number or null |
Unset | REVIEW_PR_MAX_USD |
Deprecated PR review budget. For the override, use uncapped instead of null. |
input_tokens |
Integer ≥ 2,000 | 12000 |
None | Input budget for each chunk. |
output_tokens |
Integer ≥ 256 | 6000 |
None | Output limit per chunk, including reasoning where applicable. |
areas_dir |
Nonempty repository path without .. segments |
".claude/rules" |
None | Base-commit rules matched by paths frontmatter. |
rule_chars |
Integer ≥ 0 | 6000 |
None | Max characters of matched rules per chunk. 0 disables area rules. |
context_tokens |
Integer ≥ 0 | 4000 |
None | Max input tokens for selected unchanged files from the immutable base. 0 disables repository context. |
context_files |
Integer from 0 to 50 | 12 |
None | Max unchanged files supplied to one review run. |
context_exclude_paths |
String array of globs | [] |
None | Extra paths excluded from repository context. skip_paths also apply. |
related_repositories |
Up to three distinct owner/repository strings |
[] |
None | Optional related context under the same owner. Private related repositories are available only when the current repository is also private. |
reply_max_per_pr |
Integer ≥ 0 | 10 |
None | Per-PR reply ceiling. 0 disables replies. |
reply_output_tokens |
Integer ≥ 256 | 1500 |
None | Output limit per reply. |
reply_max_usd |
Positive number | Unset | None | Deprecated budget for each reply. |
Related context consent
Section titled “Related context consent”Keys below live under related_context. The token Worker reads this setting from the default branch of the repository being shared.
| Key | Accepted type | Default | Override variable | Use |
|---|---|---|---|---|
allow |
Up to 20 distinct owner/repository or owner/* strings |
[] |
None | Repositories under this owner that may read this repository as related review context through the hosted CodeHawk App. |
Consent cannot share a private repository with a public caller. The Worker checks both repositories' visibility through the installation-scoped repository API.
Weekly review
Section titled “Weekly review”Keys below live under weekly.
| Key | Accepted type | Default | Override variable | Use |
|---|---|---|---|---|
about |
String | "" |
None | Background for both finding passes. |
project_rules_file |
String | "" |
None | Project rule file, such as AGENTS.md, empty means none. |
areas_dir |
Nonempty repository path without .. segments |
".claude/rules" |
None | Area files with paths globs. |
security_focus |
String array | Security defaults | None | What the security pass looks for. |
bug_focus |
String array | Bug defaults | None | What the bug pass looks for. |
max_usd |
Positive number | Unset | REVIEW_WEEKLY_MAX_USD |
Deprecated USD cap per run. |
auto_fix_severities |
Array of blocker, small, or theoretical |
[] |
None | Add the fix label to filed issues at these severities. |
context_tokens |
Integer ≥ 1,000 | 80000 |
REVIEW_WEEKLY_CONTEXT_TOKENS |
Input context for the finding passes. |
confirm_context_tokens |
Integer ≥ 1,000 | 40000 |
None | Context per check, including cited files and their direct imports. |
import_aliases |
Object mapping string prefixes to repository paths without .. segments |
{} |
None | Additional aliases, e.g. {"@/": "src/"}. The nearest TypeScript config is also read. |
Default focus lists
Section titled “Default focus lists”The security pass checks access control, skipped authentication checks, secrets and configuration exposure, and unsafe handling of input. The bug pass checks logic errors, incorrect totals and figures, edge cases, races, and swallowed errors. To review a narrower set, replace the corresponding list with explicit strings.
Verified fixes
Section titled “Verified fixes”Keys below live under fix_issues. The caller can set fix overrides as environment variables on the composite action. Apply the same override in both stages.
| Key | Accepted type | Default | Override variable | Use |
|---|---|---|---|---|
label |
String of 1 to 50 letters, digits, spaces, or : . _ - |
"codehawk-fix" |
None | Label used to pick and consume issues. |
base_branch |
Empty string or branch name, up to 100 characters from letters, digits, . _ / -, without .. |
"" |
None | Branch the fixes target. Empty uses the default branch. Check out the same branch in the fix job. |
output_tokens |
Integer ≥ 1,000 | 16000 |
None | Output limit for each attempt. |
context_tokens |
Integer ≥ 1,000 | 40000 |
None | Context from cited files and their imports. |
max_usd |
Positive number | Unset | FIX_ISSUES_MAX_USD |
Deprecated USD cap for the run. |
max_usd_per_issue |
Positive number | Unset | None | Deprecated cap per issue. |
max_issues |
Integer 1 to 20 | 5 |
None | Issues picked per run. |
test_commands |
Array of up to 10 objects: paths (nonempty list of nonempty glob strings) and run (nonempty list of nonempty command/argument strings) |
[] |
None | Tests run as run plus matching changed test files. Empty disables the fix stage. |
test_env |
Array of uppercase environment variable names, bot/runner prefixes are refused | [] |
None | Extra values tests can receive. |
test_timeout_seconds |
Integer 30 to 1,800 | 600 |
None | Timeout per test command. |
deny_paths |
String array of globs | [] |
None | Block additional paths beyond the built-in restrictions. |