Skip to content
Critique/docs
Platform

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.

CritiqueCode is open source under MIT. The public repository contains the local author, review, evidence, repair, and repository-intelligence code.

The package lives in the same npm org as the sidecar:

ProductPackageBinary
CritiqueCode (author)@critiquedotsh/harnesscritique-code
Critique CLI (sidecar reviewer)@critiquedotsh/clicritique

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-code

From this Critique checkout, without installing globally:

cd /path/to/your-project
node /path/to/critique/packages/critique-code/bin/critique-code.mjs

pnpm 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/auto after critique-code login (approve on the website, no pasted key) or a crt_ / CRITIQUE_API_KEY
  • An OpenRouter key is optional BYOK for power models outside Inference. OpenAI, Anthropic, Google Gemini, xAI, Groq, DeepSeek, LLM Gateway, Vercel AI Gateway, and custom OpenAI-compatible endpoints are direct routes in /keys, /settings, and the web Connections panel.
  • OpenRouter deepseek/deepseek-v4.1-flash by default when that is the selected BYOK route; V4 Flash 0731 remains selectable

Stored keys live in ~/.critique/code/auth.json, not the repository. Override the home directory with CRITIQUE_CODE_HOME.

You can connect several providers at once. The most recently connected provider becomes the author route with a bundled default model, and you can switch to any other connected provider without pasting its key again. The web panel labels environment and stored credentials separately, displays only a masked hint, and lets you replace or remove stored keys. Remove an environment variable from the launching shell to disconnect an environment credential.

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 login

The 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 connections
critique-code connections status
critique-code connections doctor [linear|sentry|vercel]
critique-code connections connect linear|sentry|vercel
critique-code connections map linear --team ENG [--repository owner/name]
critique-code connections map sentry PROJECT [--repository owner/name]
critique-code connections map vercel PROJECT [--repository owner/name]
critique-code connections comment ISSUE "text" [--yes]
critique-code connections set-status ISSUE STATE [--yes]
critique-code connections slack-post CHANNEL "text" [--thread-ts TS] [--yes]
critique-code connections activity
critique-code skills
critique-code import-skills

Interactive session: type / or /help for the command picker. Slash lines are never sent to the model. /login, /connect, /connect linear, /connect sentry, /connect vercel, /connections, /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.

critique-code LIN-482 starts an author session with that issue as the intent. Sentry issue URLs and Vercel dpl_ ids do the same for those connections. If the provider is not connected, CritiqueCode opens a focused sign-in and resumes the original prompt. Account Work connections is the control center; the session tray on hosted Code reports the same health. Connected source text is untrusted context, not review proof. Linear comments, status changes, and Slack posts require a user preview.

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 model route, and a GitHub OAuth grant with repository access. Private object storage is required only for image attachments.

Hosted sessions can start with an active CritiqueCode All In subscription, a positive Inference API balance, or an encrypted provider key connected directly on /code. Hosted BYOK supports OpenRouter, LLM Gateway, and OpenAI; keys stay in the server-side control plane and never enter the sandbox. Inference-credit and BYOK users share 10 cloud sessions per calendar month with no separate session fee. Model usage bills the selected Inference balance or provider account. After session 10, /code prompts the user to subscribe to All In or wait for the next month. All In $10 includes 50 cloud sessions and $20 of inference at provider cost per month; All In $30 includes 100 sessions and $60 of inference. All In Founders Edition includes unlimited cloud sessions and $400 of inference for $150 per month, with frontier-model access and priority benefits. Failed initial sandbox provisioning releases the reserved session.

The composer includes a reasoning slider from Low to Extra high. OpenAI and Anthropic routes expose Extra high; other models stop at High. Claude Sonnet 5, GPT-5.6 Terra, Kimi K3, and Qwen 3.8 Max are on All In and warn in the picker because they use the inference allowance faster than DeepSeek V4.1 Flash, GLM-5.3 Flash, and GLM-5.3.

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.

VariableHosted productionLocal CritiqueCode
E2B_API_KEYRequired to create the isolated sandboxNot needed
OPENROUTER_API_KEYRequired for Critique-managed hosted inference; not required when the user selects a compatible encrypted provider keyNot needed; use critique-code login or a local provider key
CRITIQUE_CODE_ALL_IN_CAPACITY_MODELS_ENABLED=trueOptional; exposes capacity-dependent frontier routes while capacity is availableNot used
CRITIQUE_CODE_CLOUD_STORAGE_BACKEND=httpOptional; enables private image attachmentsNot needed; local/test uses in-memory storage
CRITIQUE_CODE_CLOUD_STORAGE_ENDPOINTOptional URL for a private HTTP adapter backed by S3, R2, or equivalent; a bucket URL alone is not an adapterNot needed
CRITIQUE_CODE_CLOUD_STORAGE_SIGNING_SECRETOptional with the HTTP adapter; generate a new secret with openssl rand -hex 32 and keep it server-sideNot needed
CRITIQUE_CODE_CLOUD_EGRESS_ALLOW_CIDRSOptional outbound destination allowlist; when omitted, outbound internet access is enabled; /0 entries are rejectedNot needed
LINEAR_CLIENT_ID / LINEAR_CLIENT_SECRETOptional; enables Linear OAuth for Work connections and hosted CodeNot needed; local CritiqueCode uses the same Account OAuth
SENTRY_CLIENT_ID / SENTRY_CLIENT_SECRETOptional; enables Sentry OAuth for Work connectionsSame Account OAuth
CRITIQUE_VERCEL_CONNECTION_CLIENT_ID / CRITIQUE_VERCEL_CONNECTION_CLIENT_SECRETOptional; enables Vercel OAuth for Work connections. Do not reuse VERCEL_CLIENT_ID (Better Auth login)Same Account OAuth

Private storage is optional: without it, text-only sessions work and image attachment controls stay disabled. Set CRITIQUE_CODE_CLOUD_EGRESS_ALLOW_CIDRS when the deployment has fixed destinations and should restrict sandbox outbound traffic. 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;
  • idle sandbox pause after five minutes without prompts or worker events, with the next message waking the box;
  • 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.

CommandEffect
/voiceRecord one prompt. Press Enter to stop.
/voice onKeep listening after each reply.
/voice offReturn to the keyboard.
critique-code --voiceStart 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

PR activity inside your session

Authenticate GitHub CLI with gh auth login, then use /prs to see your open PRs and incoming personal review requests for the current repository. Changes-requested PRs appear first. /stats shows sample counts, p50/p90 review latency and PR size, plus requests waiting over 24 elapsed hours and PRs larger than 400 changed lines.

/prs
/stats
/prs --json
/stats --json
/prs work 123

The history covers non-draft PRs created in the last 90 days. Incoming open review requests have no creation-date cutoff. Durations use elapsed time, including nights and weekends. Each search is capped at 100 PRs; nested reviews and request events are also bounded at 100. Partial results are labeled, incomplete histories are excluded from timing summaries, and missing timestamps remain unknown. These metrics describe GitHub activity, not verified CritiqueCode outcomes.

The JSON variants display structured data in the session. /stats --json includes computed metrics. Each command refreshes from GitHub; no separate analytics cache is created. Private PR metadata is visible in the session when your GitHub account has access.

To address feedback, check out the PR locally and run /prs work 123. CritiqueCode checks that local HEAD matches the open PR's current head before passing its body, conversation comments and review summaries into the normal author-and-review workflow. It does not switch branches or automatically post, push or merge. Inline review threads are not included; provide a focused request for feedback that exists only inline or exceeds the context limit.

Business-hour calendars, team request queues, mentions, snoozes, charts and local execution-time metrics are not yet available.