Editors: VS Code, JetBrains and Cursor
Protects against an agent in your editor doing what it could not do in the terminal: Claude Code in the editor runs the same tools, and the editor itself runs what its project configuration names.
| Editor | What protects it |
|---|---|
| VS Code, JetBrains | Claude Code’s extension and plugin use the same claude-code hook as the CLI: every tool call the hook reports goes through OpenMoat, and a hook that fails to start, crashes or times out blocks the call. There is no separate host to set up. |
| Cursor | Cursor’s own hooks for the agent (Supported agents), and Tab, Cursor’s inline completion, is refused secret files. |
Set it up
Section titled “Set it up”-
Run
openmoat initTerminal window openmoat init # finds the VS Code extension's Claude Code tooThe VS Code extension bundles its own Claude Code and puts no
claudeon your search path. OpenMoat reads the extension’s version fromextensions.jsonin the extensions folder of VS Code, VS Code Insiders, VS Code Server (remote hosts), Cursor, Windsurf and VSCodium. It runs nothing there. For Cursor,openmoat initalso installsbeforeTabFileRead. -
Check it
Terminal window openmoat status # lists each Claude Code it foundEach copy gets a line such as
Claude Code 2.1.318 bundled by the VS Code extension at ~/.vscode/extensions/anthropic.claude-code-2.1.318-darwin-arm64. -
Run
openmoat initagain after an old extension updatesopenmoat initwritesonFailure: "block"(a failed hook blocks the call) only when every Claude Code it finds is 2.1.295 or later, since an older copy may reject the key and drop every hook in the file. If an old extension is left over, update or remove it, then runopenmoat init.openmoat doctorsays when.
JetBrains: the plugin bundles no Claude Code. It runs the claude on your search path, or the command set in Settings → Tools → Claude Code [Beta] → Claude command. OpenMoat does not read that setting, so if you set one, point it at the same claude that is on your search path.
What is checked
Section titled “What is checked”| In the editor | How OpenMoat decides it |
|---|---|
Every Claude Code tool (Bash, Read, Edit, WebFetch, MCP tools, …) |
as in the terminal |
getDiagnostics (mcp__ide__getDiagnostics, mcp__claude-vscode__getDiagnostics): the editor’s errors and warnings, which quote the file’s lines |
a read of the file its uri names: a secret’s diagnostics are denied, a project file’s are left to Claude Code |
executeCode (mcp__ide__executeCode, VS Code): Python run in the open notebook’s kernel |
needs review; the editor still asks Execute or Cancel |
A write to .vscode/, *.code-workspace, .idea/, JetBrains’ shared *.run.xml |
needs review (runs-later): the editor runs the tasks, launch configurations, MCP servers and programs they name. Reading them stays allowed |
A write to .venv/bin/ or venv/bin/ |
needs review (runs-later): the editor’s Python extension and test runners start them outside any sandbox |
A write to .devcontainer/ or .devcontainer.json |
needs review (runs-later): its initializeCommand runs on this machine when the editor opens the folder |
| Cursor’s Tab reading a file | refused for a file the policy refuses an agent (a secret, another agent’s login); every other file as before |
Try it against your policy:
openmoat policy check "$PWD/.vscode/tasks.json" --kind fs-write # exit 3: review (runs-later)openmoat policy check "$PWD/src/main.rs" --kind fs-write # exit 0: allow (project-fs)openmoat policy check "$PWD/.vscode/tasks.json" --kind fs-read # exit 0: allowCursor and Claude Code’s hooks. Cursor also runs Claude Code’s hooks from ~/.claude/settings.json by default. OpenMoat reads such a call with Cursor’s field names and answers a review there as a deny, since Cursor would run a call answered ask. That hook is not Cursor’s protection: Cursor runs it fail-open and ranks its own hooks above it. With both set up, a call is in the audit log twice.
Limits
Section titled “Limits”- A repository’s own git configuration.
.git/configcan name programs git runs (core.fsmonitoron everygit status, a hooks folder, a pager, filters,!aliases). The editor’s git extension and the agent run git in the background when the folder opens, before any hook, so OpenMoat cannot stop it.openmoat statusandopenmoat doctorname each such key of the current repository. - The editor selection and the open file. Claude Code adds the text you select, and the path of the open file, to each prompt. That is no tool call, so no hook sees it. VS Code’s
claudeCode.attachSelectionandattachOpenFileturn it off. - A process wrapper. VS Code’s
claudeCode.claudeProcessWrapperruns another program as Claude Code; OpenMoat checks only what that program sends the hook. - A project that turns hooks off. A repository’s
.claude/settings.jsonwithdisableAllHooks: trueturns OpenMoat’s hook off for that project in the editor as in the terminal.openmoat statusandopenmoat doctorreport it (Project settings that turn hooks off). - Windows before Claude Code 2.1.310. Without Git for Windows or Git Bash, a hook’s block could still let the call through;
statusanddoctorwarn about such a copy. - Cursor: cloud agents do not load your user hooks, so OpenMoat does not check them. Cursor’s hook docs name no browser, web or memory tool; a tool that reaches
preToolUseis decided, one that does not is not checked.