CRH uses a two-tier agent model to keep individual context windows focused while still reviewing large diffs end-to-end. A single orchestrator agent receives the full workspace and decides how to partition the review work. It then fans out to N ephemeral sub-agents — one per scope — that run in parallel, each with its own isolated context window. When all sub-agents have reported, the orchestrator aggregates their findings and callsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/goulinkh/code-review-harness/llms.txt
Use this file to discover all available pages before exploring further.
submit_review to end the session.
Orchestrator agent
The orchestrator is the top-level agent created bycreateReviewSession. It operates against the full prepared workspace.
What it receives:
- The complete workspace tree:
metadata.json,description.md,ci.json,preview-diffs/,agent/ - The default orchestrator system prompt (or a custom
systemPromptoverride)
PR tools
mp_metadata, preview_diffs_list, diff_list_files, diff_get_file, diff_numbered, diff_map_line, comments_general, comments_inline, agent_files_list, mark_file_reviewedSession tools
delegate_review, submit_reviewRepo tools (delegation path only)
repo_ls, repo_read, repo_grep, repo_statUtility
calcdelegate_review. Files in the same module, feature, or touched API surface go into the same scope. Each sub-agent has at least 250k tokens of context, so the orchestrator packs as many related files as possible per scope to minimize the total number of sub-agents spawned. A file only gets its own scope if it has ≥ 1,500 changed lines or is semantically independent.
Sub-agents
Sub-agents are ephemeral agents spawned inside thedelegate_review tool. Each call to delegate_review with a scopes array creates one sub-agent per entry, all running in parallel via Promise.all.
How a sub-agent is created:
Each scope in the scopes array produces a SliceSchema entry:
createDelegateReviewTool spawns a fresh createAgentSession per slice, each with its own in-memory SettingsManager and SessionManager. Sub-agents do not share state.
Tools available to sub-agents:
| Category | Tools |
|---|---|
| Read-only built-ins | read, grep, find, ls |
| PR tools | mp_metadata, preview_diffs_list, diff_list_files, diff_get_file, diff_numbered, diff_map_line, comments_general, comments_inline, agent_files_list, mark_file_reviewed |
| Repo tools | repo_read, repo_ls, repo_grep, repo_stat |
| Utility | calc |
| Terminal action | report_findings |
report_findings exactly once as its final action. Calling report_findings sets terminate: true, ending the session. If the sub-agent exits without calling it, delegate_review returns empty findings with a warning summary.
The report_findings schema (Findings):
| Level | When to use |
|---|---|
blocker | Production or security break |
major | Wrong behavior on a realistic input |
minor | Real but narrow impact |
nit | Do not emit — drop instead |
info | Informational, no action required |
delegate_review merges their Findings arrays into a single flat list and concatenates summaries:
submit_review with the final consolidated findings.
Tool constraints
Timeout
Most tools have a hard timeout of 10,000 ms. If a tool call exceeds the limit, the call is rejected with a timeout error. Two tools are exempt from this limit:delegate_review— sub-agents may take arbitrarily longsubmit_review— sink emission (e.g. posting to Launchpad) may involve network I/O