CodeRefactor
CodeRefactor brings your local commit-review and refactor loop into VS Code.
What It Does
- Watches commit-level review updates from
refactor watch --json.
- Shows commit status in a dedicated CodeRefactor sidebar (Commits view).
Commit timeline (Commits view)
The Commits view renders your reviewed commits as a colored, Graphite-style
lane graph — the base (main/master) branch on lane 0, and each refactor
branch on its own colored lane, with resolved-request rows nested underneath the
finalize commit that produced them. A legend at the top maps each color to its
branch (and how many requests it applied).
Each commit card is a navigation/status surface — click it to open its requests
in the Requests panel. Phase-scoped actions live on the card:
- Latest commit: a Fresh Review (↻) button re-reviews the commit from
scratch (discards its current requests) — runs headlessly.
- Finalize commits: Merge, Drop, Diff, Back to Review.
- Resolved-request rows: Revert.
Merge/Drop and Fresh Review run headlessly (no terminal) with an in-editor
confirmation, streaming output to the CodeRefactor output channel. In review-only
(local_heuristic) mode the apply/merge/drop/revert buttons are hidden.
When your working tree has uncommitted changes and the project is fully set up,
an Uncommitted changes node appears at the tip of the trunk with a
Commit… button — commit locally (git add -A && git commit -m …) without
leaving the panel. The resulting commit is reviewed automatically via the
post-commit hook.
Request cards (Requests view)
Click a commit to open its Refactor Request cards in the Requests panel —
a click-first detail surface (no terminal, no prompts):
- Each card shows a severity dot, location, request id, rationale,
recommendation, and the proposed diff.
- Refactor / Reject apply or skip a single request headlessly; Revert
undoes an applied one; Apply all processes each request in turn.
- Actions stream their output into the card and refresh its status on completion.
- In review-only (
local_heuristic) mode the apply/revert buttons are hidden.
Onboarding (initialize git, refactor init, login, install hook) and switching
the execution mode can all be done headlessly from the panel — the terminal
refactor flow is unchanged and can still be used directly.
Requirements
refactor CLI installed and available on PATH (pipx install is supported).
- Open workspace must be a git repository.
- Run
refactor login once.
- Install hook once with
refactor hook install.
Install
- VS Code — from the Visual Studio Marketplace (search "CodeRefactor").
- Cursor / VSCodium / other OpenVSX-based editors — from
Open VSX (search "CodeRefactor").
Local VSIX (private / pre-release)
cd vscode-extension
npm install
npm run package
Then in your editor:
- Open Extensions
... menu -> Install from VSIX...
- Select the generated
.vsix
- Reload window
First Run
- Open command palette ->
CodeRefactor: Check Status
- Open the CodeRefactor activity view
- Make a commit in your repo
- Watch the commit appear and update in the Commits panel
Configuration
refactorai.cliPath: path to refactor executable (default: refactor).
refactorai.autoOpen: auto-focus CodeRefactor panel when new commit arrives.
refactorai.historyLimit: commit history depth for initial stream load.
Troubleshooting
- CLI not found: set
refactorai.cliPath (common GUI PATH issue).
- Not authenticated: run
refactor login.
- No commit events: run
refactor hook install.
- No panel updates: use the panel Refresh button or reload window.