iCode Workbench · Harness · Cursor CLI

Cursor CLI in iCode Workbench

Cursor CLI is the terminal agent from Cursor, launched with the cursor-agent command. In Workbench it runs as a launchable harness: each session gets its own Git worktree, the task sits in a durable queue, and the diff is reviewed in the checkout where it was made.

This page is currently available in English only.

What Cursor CLI is good at

  • Terminal-native tasks. cursor-agent reads the repository, edits files, and runs commands from the shell.
  • Cursor's model workflow. Use your Cursor account and model selection; Workbench does not replace the agent or its provider.
  • Resumable sessions. Workbench can resume a Cursor CLI session by id when the harness reports one.

Workbench changes where the session runs and how the result is tracked; it does not change Cursor's model behavior or permissions.

Why run it in Workbench

  • One worktree per session. Two agents in one checkout can overwrite each other; Workbench gives each its own branch and working directory.
  • A durable queue. A session is a process; a task has states. Workbench tracks queued, running, waiting, completed, and failed work.
  • A managed status hook. Workbench installs Cursor's status hook at ~/.cursor/hooks.json, so the session row can report what the agent is doing. Without the hook, the session stays unknown rather than guessing.
  • Review in place. Files, Search, and Source Control live beside the terminal, scoped to the session checkout, with line notes and a separate review decision.

Setup

  1. Install Cursor CLI using Cursor's official instructions, then confirm cursor-agent --version works in your shell.
  2. Run it once outside Workbench so Cursor's authentication and settings are in place.
  3. Install the status hook from Workbench's harness settings, and confirm the hook file exists at ~/.cursor/hooks.json.
  4. Add the repository to Workbench and open it. The harness keeps its own credentials.

If Cursor CLI is installed but Workbench does not see it, check that cursor-agent is on the PATH of the shell Workbench launches. On Windows, a WSL target needs it installed inside the distro.

Launch and resume

Create a new session from New worktree, choose Cursor CLI, and give the task a scope. Workbench launches cursor-agent in the session checkout. Each session is independent: its own branch, its own terminal, its own context.

Workbench uses the resume recipe --resume $TOKEN when a session id was captured. If the app restarts, the detached host keeps the PTY alive; sleep a session to stop the process and keep the checkout, then wake it to resume where the harness supports it.

Status at a glance

The session row shows the project, branch, target, and state. Cursor CLI reports through the managed status hook; a session without the hook stays unknown rather than showing a false running. Sleep a session to stop the process and keep the checkout; wake it to resume where the harness supports it.

A concrete task

Task: “Fix the settings toggle losing its state after a reload.”

  1. Create a worktree from main and name the branch after the task.
  2. Scope the session: owned paths src/renderer/settings/** and its tests; the settings schema and route table are out of scope.
  3. Launch Cursor CLI in the session checkout with the task statement and the done-when command.
  4. Queue the task if another session is running; one worktree per task.
  5. Review the diff in the checkout: run the settings tests, check the reload path, and look for a changed default.
  6. Decide accept, revise, or reject; merge after the combined result passes.

If the task is UI-heavy, compare the before and after states in the checkout; a passing unit test does not prove the toggle still looks and behaves correctly. The goal is a reviewed diff, not a faster terminal.

What the managed hook changes

The hook is what turns a terminal into a row with a state. Without it, Workbench can see the process but cannot distinguish running from waiting; the row stays unknown. The hook writes a small config file at ~/.cursor/hooks.json and does not proxy model traffic or capture prompts. If you remove it, sessions still run; they just lose the status detail.

If you use Cursor's editor at the same time, keep the CLI session in its worktree; the editor and the agent should not share a checkout.

Limits

  • Workbench is not the Cursor editor. It does not embed Cursor's IDE features; it runs the CLI agent in a worktree.
  • Desktop only. Workbench is a desktop app; there is no mobile or remote server. If you need those, Orca is the broader tool.
  • Pre-1.0. Workbench is still changing; verify current behavior before standardizing a team on it.