Sub topic 12
Agent mode beyond VS Code
This chapter assumes you have read the earlier chapters on the agent loop, built-in tools, tool approval, instructions files, and MCP servers. You should be comfortable with those ideas in VS Code. Here you will see how they carry over to JetBrains IDEs, Cursor, and similar editors, and where the differences cause trouble.
The same loop in a different shell
Most editors that offer an agent mode implement the same loop you already know. The model plans a step, calls a tool, reads the result, and repeats until it decides the task is done or you stop it. The editor supplies the user interface around that loop: the chat panel, the approval prompts, the diff view, and the settings.
What differs from editor to editor falls into four areas:
- Naming. The same feature may be called agent mode, an agent, or a named assistant.
- Configuration files. Instructions files and MCP settings live at different paths and sometimes use different key names.
- Approval and undo controls. Defaults, granularity, and checkpoint features vary.
- Model access. Each editor offers its own list of models, and some let you bring your own API key.
Product names and file paths change often. Treat the examples below as a map of what to look for, and confirm details in each product's current documentation.
What each editor calls it
The table summarizes common setups at the time of writing. Check each product for the current state.
| Editor | Agent feature | Typical instructions location | Typical MCP configuration |
|---|---|---|---|
| VS Code with GitHub Copilot | Agent mode in Chat | `.github/copilot-instructions.md` | `.vscode/mcp.json`, top-level key `servers` |
| JetBrains IDEs | Agent features in the AI Assistant, the Junie agent, or the GitHub Copilot plugin | Depends on the plugin, often a guidelines file in the project | Settings dialog, or a JSON entry pasted into the plugin's settings |
| Cursor | Agent mode in Chat | Rules files under `.cursor/rules` | `.cursor/mcp.json`, top-level key `mcpServers` |
| Windsurf | Cascade | Rules files in the project or user settings | Settings UI backed by a JSON file |
| Visual Studio | Copilot agent mode | `.github/copilot-instructions.md` | Settings UI and a JSON file |
The pattern to notice is that the Copilot family shares one instructions file across editors, while other products use their own rules format. A growing number of tools also read a generic AGENTS.md file at the repository root. If your team uses more than one editor, check whether each tool reads that file before you duplicate your rules.
Instructions files across editors
The content of a good instructions file barely changes between editors. The same build commands, conventions, and prohibitions apply. Only the file location and sometimes the metadata change.
Here is the Copilot version from earlier in the tutorial:
# Project instructions
- This is a TypeScript project using npm. Install with `npm ci`.
- Run tests with `npm test` before finishing any change.
- Use named exports. Do not add default exports.
- Keep new code under `src/` and tests next to the file as `*.test.ts`.
- Do not edit files under `dist/` or `package-lock.json` by hand.In Cursor you would place the same text in a rules file under .cursor/rules. Cursor's rules format lets you add metadata that controls when a rule applies, for example always, or only for files matching a glob pattern. VS Code's Copilot also supports scoped instruction files, but the mechanism and file names differ.
Practical advice for multi-editor teams:
- Keep the shared facts, such as commands and conventions, in one source of truth.
- Use thin editor-specific files that point to or copy that content.
- Avoid editor-specific wording like "in Copilot, do X". The instructions should describe the project, not the tool.
- Commit the files so every teammate's agent gets the same guidance.
MCP configuration differs in small, breaking ways
MCP itself is a protocol, so a server that works in VS Code should work in other MCP-capable clients. The failure usually comes from the configuration wrapper around it.
This is the VS Code entry for the reference filesystem server:
{
"servers": {
"filesystem": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"${workspaceFolder}"
]
}
}
}The equivalent Cursor file, .cursor/mcp.json, uses a different top-level key:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"${workspaceFolder}"
]
}
}
}Three details cause most copy-and-paste errors:
- The top-level key. VS Code uses
servers. Cursor and several desktop clients usemcpServers. A file with the wrong key often loads without an error and shows no tools. - The
typefield. VS Code entries commonly state the transport, such asstdio. Some clients infer it from whether you give acommandor aurl. - Variable substitution.
${workspaceFolder}is a VS Code variable. Other editors may support it, use a different variable, or require an absolute path. If the server starts but cannot see your files, check what path it actually received.
Also remember that each editor starts the server process itself. Both npx and Node.js must be on the PATH that the editor sees. On macOS and Linux, an editor launched from a desktop icon can have a different PATH than your shell. If the server fails to start in only one editor, this is a likely cause.
Approvals, checkpoints, and undo
The approval ideas from earlier chapters still apply: read-only tools are low risk, and file edits and terminal commands deserve a deliberate decision. Editors differ in how they present that decision.
- Some ask before every terminal command by default and offer an allow list for commands you trust.
- Some offer an "auto-run" or "YOLO" style setting that skips confirmations. Treat that setting as high risk outside a disposable environment.
- Some keep their own checkpoints so you can restore an earlier state of the files from the chat history.
- Some present edits as a single multi-file diff you accept or reject, while others apply edits to the working tree and rely on you to review through source control.
Do not assume the editor's checkpoint feature replaces Git. Editor checkpoints often cover only files the agent edited through its own tools. They may not capture changes made by a terminal command such as a code generator or a sed call. A Git commit before a long agent run protects you in every editor.
Model choice and bring-your-own-key
Each editor decides which models you can pick. A model that exists in one editor's picker may be missing in another, or may sit behind a different plan or quota. Some editors allow you to supply your own API key for a provider. Others route all requests through the vendor's service.
This affects agent work in two ways. First, agent tasks involve many tool calls, so a model with weak tool-calling performs poorly in any editor. Second, usage limits are counted differently. One agent run can use many requests, and an editor may count each step or only the task. Read how your plan counts them before you start a long task.
Data handling differences
Where your code goes depends on the editor and the model route. When you move between editors, check:
- Whether file contents are sent to the vendor, to a third-party model provider, or both.
- Whether your plan allows the vendor to keep prompts or use them for training.
- Whether the editor can ignore files, for example through an ignore file, so that secrets and generated data never enter the context.
An ignore file in one editor does nothing in another. If you keep .env files in the workspace, confirm that each editor you use excludes them, or move the secrets out of the project folder.
A portable task prompt
Good prompts travel well because they describe the task and not the tool. This prompt from earlier works in any editor's agent mode:
Add input validation to the createUser function in src/users.ts.
Reject empty names and malformed email addresses with a clear error.
Add unit tests for both cases next to the existing tests, then run `npm test` and fix any failures.
Do not change the public function signature.Avoid editor-specific references such as "use the Copilot terminal tool". Name the outcome, the verification step, and the constraint. The agent chooses the tool.
Common errors when switching editors
| Symptom | Likely cause | Fix |
|---|---|---|
| Agent ignores your conventions | The editor does not read the instructions file you wrote | Put the content in the file format and location the editor reads |
| MCP tools do not appear | Wrong top-level key or the server failed to start | Check the key name and the editor's MCP log |
| Server works in terminal but not in the editor | The editor's `PATH` lacks `npx` or Node.js | Use an absolute command path or launch the editor from a shell |
| Agent edits files you wanted left alone | No ignore rule or instruction for that path | Add the prohibition to instructions and use the ignore feature |
| Undo does not restore a file | The change came from a terminal command, not an edit tool | Restore with Git |
| Same prompt behaves differently | Different model, context window, or system prompt | Pin the model where possible and make the prompt more explicit |
Choosing an editor for agent work
You rarely need to pick an editor only for its agent. Decide on these criteria in order:
- Your existing workflow. A JetBrains user gets more from the JetBrains agent integration than from switching tools for a slightly different loop.
- Language and tooling support. The agent is only as useful as the editor's diagnostics, test runner, and debugger integration for your stack.
- Policy and data handling. Your organization may allow only certain vendors or require a specific plan.
- Extensibility. Check MCP support and the quality of the instructions format.
- Review ergonomics. Prefer the editor whose diff and undo experience you can use quickly and reliably.
Exercise
A teammate copies the VS Code .vscode/mcp.json into .cursor/mcp.json unchanged. Cursor shows no filesystem tools and no error. What is the most likely cause, and how do you fix it?
Show answer
The top-level key is servers, which is the VS Code format. Cursor expects mcpServers. Rename the key, remove the type field if the client does not need it, and check that ${workspaceFolder} resolves to the right path. Then restart or reload the MCP server in Cursor.
Exercise
You run a long agent task in an editor with built-in checkpoints. The agent ran a terminal command that regenerated several files, and you want to roll back. Why might the checkpoint not restore them, and what should you have done before the run?
Show answer
Checkpoints often track only changes made through the agent's edit tools, not files changed by terminal commands. Restore with Git instead. Before the run, commit or stash your work so Git holds a clean state to return to.