Skip to content

Latest commit

History

267 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Patchloom logo

Patchloom for VS Code

CISecurityCoverageVS Code MarketplaceOpen VSXOpenSSF ScorecardOpenSSF Best PracticesLicense: MIT

The official VS Code extension for Patchloom. Set up your workspace for AI agent workflows in seconds: detect the CLI, generate agent rules, configure MCP servers, and run structured file operations from the command palette.


Install

Install from the VS Code Marketplace or the Open VSX Registry.

Or search for Patchloom in the Extensions view (Ctrl+Shift+X / Cmd+Shift+X).

Get started in 30 seconds

  1. Install the Patchloom CLI (or run Patchloom: Install Patchloom from the command palette; recommended: tracks GitHub Releases with checksum verification)
    brew install patchloom/tap/patchloom # macOS / Linux (Homebrew)
    npm install -g patchloom # npm (Node.js)
    curl -LsSf https://github.com/patchloom/patchloom/releases/latest/download/patchloom-installer.sh | sh # shell script
    cargo install patchloom # from source
    scoop bucket add patchloom https://github.com/patchloom/scoop-bucket
    scoop install patchloom # Windows (Scoop; preferred PATH channel)
    On Windows, prefer the extension managed installer or Scoop. Avoid winget and Chocolatey for install or upgrade: both lag GitHub Releases and often leave you on an old CLI.
  2. Open a project and run Patchloom: Setup Workspace

Setup Workspace demo

The extension finds the CLI automatically. If it's not on PATH, point patchloom.path to it in settings.


Features

One-click workspace setup

Run Patchloom: Setup Workspace to walk through everything your project needs: binary detection, AGENTS.md generation, and MCP server configuration.

Agent rules generation

Patchloom: Initialize Project generates an AGENTS.md file from patchloom agent-rules. You pick integration mode (CLI/MCP/all), shell platform, and surface (full document or core pack for system-prompt injection, CLI 0.24+). If AGENTS.md already exists, the extension opens a diff so you can merge updates manually.

MCP server configuration

Patchloom: Configure MCP injects the Patchloom MCP server into your editor's config. Supports:

  • VS Code (.vscode/mcp.json)
  • Cursor (.cursor/mcp.json)
  • Windsurf (~/.codeium/windsurf/mcp_config.json)

When configuring, pick Full tool inventory (default) or Core pack. Core sets PATCHLOOM_MCP_SURFACE=core on the server entry.

CLI 0.28.0 (and 0.24+) exposes 58 MCP tools by default (including list_files and apply_fragment). The core pack is 11 tools: read_file, search_files, list_files, replace_text, batch_replace, doc_get, doc_set, doc_query, md_replace_section, execute_plan, server_info. Absolute paths that resolve inside the MCP workspace root are allowed; empty paths, ../, and outside paths still reject with stable error_kind peels.

Status bar

The status bar shows MCP and binary readiness at a glance:

  • $(plug) Patchloom MCP when the MCP server is configured
  • $(check) Patchloom when the binary is ready but MCP is not yet set up
  • $(warning) Patchloom when the binary is missing or needs an upgrade

Click it to see full diagnostics, including per-editor MCP configuration status (VS Code, Cursor, Windsurf).

Verify MCP Server

Patchloom: Verify MCP Server spawns patchloom mcp-server, sends a JSON-RPC initialize handshake, and confirms the server responds correctly. Reports the server name and version on success, or a diagnostic error on failure.

Quick actions

Patchloom: Quick Action opens an interactive picker with structured editing operations:

ActionWhat it does
Replace textLiteral text replacement with diff preview before applying
Insert text after matchLine-oriented insert after each match (CLI 0.16+)
Insert text before matchLine-oriented insert before each match (CLI 0.16+)
Apply fragment at anchorMorph-style freeform fragment at a unique anchor (--after / --before / --old, CLI 0.22+)
Tidy fileWhitespace and newline cleanup with diff preview
Set structured valueUpdate a JSON, YAML, or TOML key with diff preview
Search textFind pattern matches across workspace files (results in output channel)
Create fileScaffold a new file with optional content and open it in the editor
Append to fileAppend content to an existing file
Prepend to filePrepend content to the start of an existing file (CLI 0.9+)
Read structured valueRead a JSON/YAML/TOML key and copy to clipboard
Delete structured valueRemove a key from JSON, YAML, or TOML with diff preview
Merge into structured fileMerge a partial JSON object into a config file (optional multi-doc selector, CLI 0.16+)
Append to arrayAppend a value to a JSON, YAML, or TOML array
Prepend to arrayPrepend a value to a JSON, YAML, or TOML array
Ensure structured valueIdempotent set: write only if the key is missing
Move/rename keyMove or rename a selector path in JSON, YAML, or TOML
Insert after headingInsert content immediately after a markdown heading line
Insert after sectionInsert a sibling markdown section after a full section body (CLI 0.14+)
Insert before headingInsert content immediately before a markdown heading line
Append table rowAppend a row to a markdown table under a heading
Upsert bulletAdd a bullet under a heading if it is not already present
Replace markdown sectionReplace content under a markdown heading
Merge patch (three-way)Apply a stale patch using three-way merge (v0.2.0+)
Undo last changeRestore files from the latest Patchloom backup session

Workspace Quick Actions and Batch Apply pass --contain so CLI paths stay inside the workspace root (CLI 0.10+). Containment is relative to the effective working directory (the workspace folder). Patch merge skips containment when the patch file may live outside the workspace.

Batch operations

Patchloom: Batch Apply opens a line-oriented plan template where you can compose multiple operations (replace, fuzzy replace, doc.set, multi-match doc.update, multi-doc doc.merge, file append, markdown section inserts, tidy). The extension pipes the plan to patchloom batch --apply so all changes land atomically.

Output channel

All CLI invocations, arguments, and output are logged to the Patchloom output channel. Run Patchloom: Show Output to open it. Useful for debugging and copying full error messages for bug reports.

Compatibility diagnostics

The extension detects outdated CLI builds and warns with upgrade guidance. It requires Patchloom 0.3.0 or newer.


Commands

CommandDescription
Patchloom: Setup WorkspaceGuided walkthrough for binary, AGENTS.md, and MCP readiness
Patchloom: Initialize ProjectGenerate or diff AGENTS.md from patchloom agent-rules (mode, platform, surface full/core)
Patchloom: Configure MCPInject Patchloom MCP server config (full or core tool surface) into editor config files
Patchloom: Quick ActionBuild a Patchloom CLI command from an interactive picker
Patchloom: Batch ApplyOpen a batch plan and execute all operations atomically
Patchloom: Show OutputOpen the Patchloom output channel for CLI logs and diagnostics
Patchloom: Show StatusDisplay binary readiness, version, compatibility, and workspace state
Patchloom: Verify MCP ServerSpawn the MCP server and verify it responds to a JSON-RPC initialize request
Patchloom: Install PatchloomDownload and install the Patchloom CLI with checksum verification
Patchloom: Update PatchloomUpdate a managed Patchloom install to the latest release
Patchloom: Reinstall PatchloomRe-download and reinstall the managed Patchloom binary
Patchloom: Open SettingsJump to Patchloom extension settings
Patchloom: Open DocumentationOpen the Patchloom documentation site in a browser
Patchloom: Open ReleasesOpen the Patchloom releases page in a browser

Settings

SettingDefaultDescription
patchloom.path""Absolute path to the Patchloom binary. When empty, the extension searches PATH and then the managed install location.
patchloom.showStatusBartrueShow a status bar item reporting whether Patchloom is available.
patchloom.enabletrueEnable the extension. When disabled, the status bar is hidden and background checks are skipped.
patchloom.trace.server"off"Trace level for CLI output (off, messages, verbose).
patchloom.env{}Additional environment variables passed to the CLI (e.g., {"PATCHLOOM_LOG": "debug"}).
patchloom.managedInstall.autoUpdatetrueAutomatically check for CLI updates on activation.

Remote and multi-root workspaces

  • In multi-root workspaces, commands target the active editor's workspace folder. If no editor is active, you pick the folder.
  • Remote sessions (WSL, SSH, dev containers, Codespaces) stay focused on workspace-scoped flows. User-scoped MCP config targets are hidden in remote environments.
  • Unknown remote environments are surfaced as unverified so failures are explicit.

Troubleshooting

Patchloom not found Set patchloom.path in settings, or add the CLI to your PATH.

CLI compatibility warning / upgrade path The extension requires Patchloom 0.3.0 or newer; 0.28.0 is recommended. Which fix to use depends on how the CLI was resolved (status shows Source):

  1. Source: managed installPatchloom: Update Patchloom (checksum-verified GitHub release into extension storage)
  2. Source: PATH → upgrade that install in place (Scoopscoop update patchloom on Windows; Homebrew / npm / cargo / the official installer elsewhere). Managed Install will not override a PATH binary.
  3. Source: patchloom.pathOpen Settings and point at a current binary, or clear the setting so PATH/managed resolution can take over

Do not rely on winget or Chocolatey to stay current. Those community packages lag moderation and Microsoft publish, so upgrades often stay stuck on older CLI versions.

Path rejected by workspace guard Quick Actions and Batch Apply pass --contain so paths stay inside the open workspace folder. On CLI 0.18+, sandbox escapes report error_kind: guard_rejected (not a generic invalid_input). Keep targets under the workspace root, or open the folder that owns the files.

Empty or blank path On CLI 0.28+, empty, whitespace-only, or format-character-only paths fail early with error_kind: invalid_input and message path must not be empty (they no longer look like workspace-root failures). Prefer a real relative or workspace-absolute path.

Batch replace shape Batch lines use replace PATH OLD NEW (and optional flags such as --fuzzy). Do not paste CLI form replace OLD --new NEW path into a batch plan; CLI 0.18+ returns a clear parse error with the PATH OLD NEW hint.

Create or rename destination already exists On CLI 0.19+, create/rename conflicts report error_kind: already_exists (not a generic invalid_input). Use the force flag when overwriting is intentional, or pick a free destination path.

Binary, invalid UTF-8, or non-regular file On CLI 0.20+, sole-path loads of binary or invalid UTF-8 files report error_kind: binary or invalid_encoding (not a soft no_matches). On CLI 0.26+, FIFOs and other special nodes refuse with multi-path refused[].reason: not_regular_file (not a permission error). Use a regular text file, or force-create when overwriting non-text is intentional.

Fuzzy match span refused On CLI 0.22+, over-wide fuzzy matches can report error_kind: fuzzy_span_suspicious. Prefer an exact old string, structured doc/md/ast edits, or apply-fragment with a unique anchor.

Doc selector needs multi-match op On CLI 0.27+, doc set / doc ensure / doc delete with a predicate or wildcard selector stay error_kind: invalid_input and may include suggested_op (doc.update or doc.delete_where). The extension surfaces that hint in the Output channel and notifications. Use the multi-match op (or a concrete index path such as items.0.val).

Ambiguous markdown heading On CLI 0.25+, section ops that match the same heading more than once report error_kind: ambiguous. Make the heading unique or use a level-qualified query (for example ## Rules).

MCP config not injected Run Patchloom: Configure MCP and select the target editor config.

Managed install failure persists after restart Run Patchloom: Show Status to see persisted diagnostic details. If the managed binary is present but not usable, choose Reinstall Patchloom (or the status-bar action) to re-download from GitHub Releases.

Debugging CLI errors Run Patchloom: Show Output to see full CLI invocations, arguments, stdout, and stderr in the output channel.


Security model

The managed installer work is intentionally conservative:

  • Downloads must come from https://github.com/patchloom/patchloom/releases/download/...
  • Each archive must match a published SHA-256 checksum before the extension trusts it
  • Checksum failures stop the install before any managed binary is used
  • A failed install never replaces an already working binary
  • Binary promotion creates a backup before swapping; failures restore the backup
  • Failure records persist across extension reloads for diagnostics

Reporting issues

File bugs and feature requests at patchloom/patchloom-vscode/issues. Include the output of Patchloom: Show Status and your VS Code version.


Requirements

  • VS Code 1.90 or newer (or compatible editors: Cursor, Windsurf, VSCodium)
  • Patchloom CLI 0.3.0 or newer (0.28.0+ recommended for empty-path fail-closed (path must not be empty), suggested_op on fail-closed doc navigation, not_regular_file soft peels, ambiguous markdown headings, list_files MCP inventory, apply-fragment, full error_kind peels (binary / invalid_encoding / fuzzy_span_suspicious / already_exists / guard_rejected / ambiguous), optional PATCHLOOM_MCP_SURFACE=core 11-tool pack, multi-doc doc merge --selector, line-oriented inserts, batch replace PATH OLD NEW hints, 58 MCP tools, and agent-facing JSON envelopes)

Contributing

See CONTRIBUTING.md for the full guide. Quick start:

npm install
npm run check # full gate: compile + test + package

Open the repo in VS Code and press F5 to launch the Extension Development Host.

About

VS Code extension for Patchloom. Installs, configures, and integrates the Patchloom CLI for editor-first workflows.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages