CritiqueCode
Author agent that implements, then is forced through review and verified repair. Published as @critiquedotsh/harness — not the Critique CLI sidecar.
CritiqueCode is the author agent. It implements in an interactive session, then the controller forces the review and verified-repair loop. It is a Claude Code-style coding agent, not a rename of the sidecar reviewer. The hosted Code workspace is the primary browser entry point for an account; the local TTY and local web modes remain available when the repository should stay on your machine.
The package lives in the same npm org as the sidecar:
| Product | Package | Binary |
|---|---|---|
| CritiqueCode (author) | @critiquedotsh/harness | critique-code |
| Critique CLI (sidecar reviewer) | @critiquedotsh/cli | critique |
Do not install CritiqueCode by changing @critiquedotsh/cli. Native evidence stays on /review. /critique and critique_cli spawn the installed critique sidecar when you want that binary.
Install
Run CritiqueCode in the repository you want to edit. The process uses the current working directory.
Published name (same org as the CLI):
npm install --global @critiquedotsh/harness
cd /path/to/your-project
critique-codeFrom this Critique checkout, without installing globally:
cd /path/to/your-project
node /path/to/critique/packages/critique-code/bin/critique-code.mjspnpm critique-code from the Critique checkout uses this repository as cwd unless you pass --cwd. That is the wrong default when you are trying the agent on another project.
Defaults
- Critique Inference
critique/autoaftercritique-code login(approve on the website, no pasted key) or acrt_/CRITIQUE_API_KEY - An OpenRouter key is optional BYOK for power models outside Inference. OpenAI, Anthropic, and other keys remain in
/keysand/settings. They do not take over the default when Critique Inference is connected. - OpenRouter
deepseek/deepseek-v4-flash-0731only when that is the selected BYOK route
Stored keys live in ~/.critique/code/auth.json, not the repository. Override the home directory with CRITIQUE_CODE_HOME.
Point CritiqueCode at the Inference API. Inference bills raw $/1M input and output tokens, not review credits. critique/auto is the coding selector on that API.
Connect without a key
critique-code loginThe terminal prints a URL and code, opens the browser when it can, and waits. Approve on critique.sh/device. CritiqueCode stores a machine key under ~/.critique/code/ and uses Critique Inference.
Same flow from an interactive session: /login.
Commands
critique-code
critique-code login
critique-code web [--port <n>]
critique-code remote [--anywhere] [--site] [--slack] [--telegram] [--port <n>]
critique-code connect [CODE] [--cwd <dir>]
critique-code slack
critique-code telegram
critique-code chat [--intent <text>] [--models provider/model,...] [--cwd <dir>] [--json]
critique-code --voice
critique-code settings | keys | models
critique-code review [--depth quick|standard|paranoid] [--focus general,security]
critique-code repair <review-run-id>
critique-code critique [sidecar argv...]
critique-code capabilities
critique-code skills
critique-code import-skillsInteractive session: type / or /help for the command picker. Slash lines are never sent to the model. /login, /connect, /remote, /slack, /telegram, /voice, /voice on, /review, /review all, /critique, /repair, /ship, /skills, /settings, /models, /keys, /done, /exit.
/critique spawns the installed Critique CLI sidecar (critique review --json by default). That JSON is not /review Evidence. Install @critiquedotsh/cli or set CRITIQUE_CLI. The author can also call critique_cli when you ask for the sidecar. --repair apply and cloud uploads stay slash-only.
critique-code web opens the same author session in a local browser on 127.0.0.1. The kernel stays in this process. It is not the Critique CLI sidecar and not Critique Cloud.
critique-code remote pairs a phone to that same laptop process. On the same Wi-Fi you open the LAN URL and type the terminal PIN. Off-network, DM a Slack or Telegram bot (--slack / critique-code slack) — those connections are outbound from the laptop. --anywhere can publish your own cloudflared or ngrok URL. The author still writes this working tree. This is not the hosted Code workspace.
critique-code connect [CODE] links the same laptop to a deployment that exposes the relay flow. In that flow the website is a remote, not a runner: prompts, exec approvals, and event output relay through Critique, while the kernel and file writes stay on the laptop. It needs critique-code login (a crt_ key) so the machine can claim the code outbound.
Open /connect, select Connect this PC, and run the one-time command it displays from the repository you want CritiqueCode to edit. critique-code remote can also attach to the site relay without a code and prints the remote URL; it does not open that page when browser opening is disabled. /code is reserved for hosted sandbox sessions.
Hosted Code workspace
The /code page is the primary browser workspace for hosted CritiqueCode sessions. A hosted session runs the author harness inside an isolated E2B sandbox with a durable session record, branch, event history, and workspace snapshot. This is different from critique-code web, critique-code remote, and the laptop relay flow above.
The workspace reads capability availability from the server. It does not offer an unconfigured model, attachment storage, sandbox, or native review operation. Repository access comes from the signed-in user's delegated GitHub OAuth connection; no GitHub App installation flow is exposed. Production session creation requires E2B, a usable managed model route, an explicit outbound-network policy, and a GitHub OAuth grant with repository access. Private object storage is required only for image attachments.
Every signed-in user gets four free hosted model routes in the CritiqueCode app: Mercury 2.5 Preview, Laguna S 2.1, MiniMax M3, and DeepSeek V4 Flash 0731. They share a weekly allowance of 15 million input tokens and 5 million output tokens, which resets weekly for all users. Add Inference API credits to reveal the current managed Models catalog and add more capacity.
Environment requirements
These are deployment variables for hosted /code, not install requirements for the local author. GitHub repository access is granted through Connect GitHub repository access in the new-session flow and is stored as an encrypted Better Auth OAuth account. If the hosted variables or GitHub grant are absent, Code remains available as a signed-in shell but reports the unavailable capabilities and disables session creation; it does not pretend that a sandbox is running.
| Variable | Hosted production | Local CritiqueCode |
|---|---|---|
E2B_API_KEY | Required to create the isolated sandbox | Not needed |
OPENROUTER_API_KEY | Required for the four free hosted routes and for the credit-backed Models catalog; an account OpenRouter key can be used as a fallback from Settings | Not needed; use critique-code login or a local provider key |
CRITIQUE_CODE_CLOUD_STORAGE_BACKEND=http | Optional; enables private image attachments | Not needed; local/test uses in-memory storage |
CRITIQUE_CODE_CLOUD_STORAGE_ENDPOINT | Optional URL for a private HTTP adapter backed by S3, R2, or equivalent; a bucket URL alone is not an adapter | Not needed |
CRITIQUE_CODE_CLOUD_STORAGE_SIGNING_SECRET | Optional with the HTTP adapter; generate a new secret with openssl rand -hex 32 and keep it server-side | Not needed |
CRITIQUE_CODE_CLOUD_EGRESS_ALLOW_CIDRS | Required fixed destination list; do not use 0.0.0.0/0 or ::/0 | Not needed |
CRITIQUE_CODE_CLOUD_ALLOW_UNRESTRICTED_EGRESS=true is an explicit temporary private-beta acknowledgement, not a long-term production configuration. Private storage is optional: without it, text-only sessions work and image attachment controls stay disabled. The repository does not provide the optional private storage adapter or your infrastructure's fixed egress addresses; those must be supplied by the deployment owner when those capabilities are enabled. The hosted page surfaces each missing capability without exposing provider secrets to users.
For a complete local run, install @critiquedotsh/harness and run critique-code in the repository you want to edit. Local Code is independent of the hosted E2B, storage, egress, repository-provisioning, and browser transport gates.
Currently supported:
- idempotent session creation with partial-start cleanup;
- worker-owned readiness and heartbeat reconciliation;
- prompts, bounded ordered event replay, diffs, files, checkpoints, pull requests, and expected-head merge protection;
- validated private image attachments with per-session count and byte limits; and
- bounded usage reservations and concurrent-turn limits.
Not yet supported:
- native independent review and verified repair in the hosted workspace;
- a direct realtime browser-to-sandbox PTY transport; and
- guaranteed replay of an in-flight prompt or arbitrary shell side effect after a worker dies.
The hosted terminal uses ordered, reconnect-aware database polling with retention and gap recovery. Idempotent controller operations may resume after a restart. Unsafe in-flight work is reported as retry-required instead of being executed twice.
Voice mode
Speak to the author and the reviewer. Transcription uses Qwen3 ASR 0.6B (qwen/qwen3-asr-0.6b) on the Inference API. The transcript is ordinary session text: prompts go to the author, and spoken review, repair, ship, and exit match the typed commands.
| Command | Effect |
|---|---|
/voice | Record one prompt. Press Enter to stop. |
/voice on | Keep listening after each reply. |
/voice off | Return to the keyboard. |
critique-code --voice | Start the session already listening. |
An empty clip after /voice on drops you back to typing. CritiqueCode ships a bundled ffmpeg recorder (ffmpeg-static). You do not need a system sox or ffmpeg install.
Needs a microphone, an interactive TTY, and Critique Inference (/login or a crt_ key) or an OpenRouter key. Billing is $0.000003 per second of audio, not token rates. Voice is dictation in. The agent does not read replies aloud.
Skills
CritiqueCode ships built-in author skills for code review, when to run /review, and TDD. Every session also loads SKILL.md folders from the harnesses people already use, without a migrate step:
- Project:
.claude/skills,.agents/skills,.codex/skills,.opencode/skills,.cursor/skills,.critique/skills - User:
~/.claude/skills,~/.codex/skills, and~/.critique/code/skills
Built-in skills win on name collision, so a Claude Code code-review skill cannot replace /review. Imported skills are untrusted text, same as CLAUDE.md / AGENTS.md (already loaded). They cannot grant a shell or treat checks as Evidence.
critique-code skills lists what this repo would load. critique-code import-skills copies discovered folders into ~/.critique/code/skills so they survive after you uninstall the old harness. /skills is the same list in the TUI.
The model cannot pick a working directory or run a process on its own. It can call critique_workspace for glob, grep, config parse, durable notes, TypeScript identifier rename, and a single public https page. It can call critique_run for everything else; you approve or deny each request in the TUI, and networked commands require an enforced controller sandbox. It can call critique_task to fan out explore (read-only) or general/implement workers in the same tree. It can call critique_cli to spawn the installed critique sidecar. Worker output and sidecar JSON are not Evidence. Promotion stays on /review and /ship.
The TTY shows a wordmark, a compact live status (thinking / write path / read path), then a one-line ▸ summary before the reply. It does not stream thinking paragraphs.
Interactive TTY sessions keep stdout quiet. Pass --json for the session envelope. review, repair, and capabilities still print JSON on stdout. Live chrome goes to stderr. none_promoted is not a correctness proof.
EOF attempts to review dirty work, while /exit records an incomplete session without claiming completion. Durable state contains the task contract, review handoff, capsule digest, and bounded status—not the author transcript. A later invocation resumes only when the repository still matches that digest; stale state is surfaced explicitly. Partial or failed reports cannot satisfy /done or /ship without an auditable user override.
OpenRouter Activity attributes CritiqueCode generations to critique.sh (HTTP-Referer https://critique.sh, title critique.sh), not to the underlying agent kernel.
See also: Inference API · Critique CLI
CLI Reference
Commands, complete-repository review semantics, bundled methodologies, model roles, repair modes, and agent collaboration for the Critique CLI.
Change Control
How Critique governs the merge boundary with Change Passports, agent risk scoring, evidence contracts, merge policy as code, verified repair, and a learning loop.