Skip to content
Agentmart
Submit a tool

lsp-simulate

Speculative code editing session — simulate changes in memory before touching disk.

Skill by blackwell-systems

IndexedMIT★ 164
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/blackwell-systems-lsp-simulate

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Speculative code editing session — simulate changes in memory before touching disk. Use when planning edits that might break things, exploring refactors across multiple files, or verifying an edit is safe before applying.

Use cases: writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/lsp-simulate

Tools it pre-approves 9

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • mcp__lsp__start_lsp
  • mcp__lsp__create_simulation_session
  • mcp__lsp__simulate_edit
  • mcp__lsp__simulate_chain
  • mcp__lsp__evaluate_session
  • mcp__lsp__commit_session
  • mcp__lsp__discard_session
  • mcp__lsp__destroy_session
  • mcp__lsp__preview_edit

What's inside

Skill name
lsp-simulate
Description
Speculative code editing session — simulate changes in memory before touching disk. Use when planning edits that might break things, exploring refactors across multiple files, or verifying an edit is safe before applying.
License
MIT
Compatibility
Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp)
Allowed tools
mcp__lsp__start_lsp, mcp__lsp__create_simulation_session, mcp__lsp__simulate_edit, mcp__lsp__simulate_chain, mcp__lsp__evaluate_session, mcp__lsp__commit_session, mcp__lsp__discard_session, mcp__lsp__destroy_session, mcp__lsp__preview_edit
Instructions
205 lines in SKILL.md · view on GitHub

Files (2)

  • SKILL.md
  • patterns.md · references/

SKILL.md (first lines)

> Requires the agent-lsp MCP server.

# lsp-simulate

Simulate code edits in memory before writing to disk. The LSP server applies
your changes to an in-memory overlay, runs diagnostics, and reports whether
the edit is safe — without touching any files.

## Prerequisites

LSP must be running for the target workspace. If not yet initialized, call
`start_lsp` before any simulation tool.

```
mcp__lsp__start_lsp(root_dir: "/your/workspace")
```

Auto-init note: agent-lsp supports workspace auto-inference from file paths.
Explicit `start_lsp` is only needed when switching workspace roots.

## Quick Start (single edit)

For a single what-if check, use `preview_edit` — it creates a session,
applies the edit, evaluates, and destroys the session in one call:

```
mcp__lsp__preview_edit(
  workspace_root: "/your/workspace",
  language: "go",
  file_path: "/abs/path/to/file.go",
  start_line: 42, start_column: 1,
  end_line: 42, end_column: 20,
  new_text: "replacement text"
)
```

Result:

```
{ net_delta: 0 }   -- safe to apply
{ net_delta: 2 }   -- 2 new errors introduced; do NOT apply
```

`net_delta: 0` means no new errors were introduced. Positive values mean
errors were introduced — inspect `errors_introduced` before deciding.

## Full Session Workflow (multiple edits)

Use a full session when applying several edits that build on each other, or
when you want to inspect the patch before deciding whether to write to disk.

**Step 1 — Create a simulation session**

```
mcp__lsp__create_simulation_session(
  workspace_root: "/your/workspace",
  language: "go"
)
→ { session_id: "abc123" }
```

**Step 2 — Apply edits in-memory**

Call `simulate_edit` one or more times. All edits are in-memory only.
Positions are 1-indexed (matching editor line numbers and `cat -n` output).

```
mcp__lsp__simulate_edit(
  session_id: "abc123",
  file_path: "/abs/path/to/file.go",
  start_line: 10, start_column: 1,
  end_line: 10, end_column: 30,
  new_text: "func NewClient(cfg Config) *Client {"
)
→ { session_id: "abc123", edit_applied: true, version_after: 1 }
```

Repeat for additional edits as needed.

**Step 3 — Evaluate the session**

```
mcp__lsp__evaluate_session(
  session_id: "abc123",
  scope: "file"
)
→ {
    net_delta: 0,
    confidence: "high",
    errors_introduced: [],
    errors_resolved: [],
    edit_risk_score: 0.0,
    affected_symbols: []
  }
```

`scope: "file"` (default) is faster and returns `confidence: "high"`.
`scope: "workspace"` catches cross-file type errors but returns
`confidence: "eventual"` (results may not be fully settled).

**Step 4 — Decision gate**

If `net_delta == 0`, proceed to commit. Otherwise, discard:

```
mcp__lsp__discard_session(session_id: "abc123")
```

**Step 5 — Commit the session**

```
-- Preview patch only (no disk write):
mcp__lsp__commit_session(session_id: "abc123", apply: false)

-- Write to disk:
mcp__lsp__commit_session(session_id: "abc123", apply: true)
```

**Step 6 — Destroy the session (always)**

From blackwell-systems/agent-lsp, MIT.

More from blackwell-systems/agent-lsp

Signals

Stars
164
Forks
20
Open issues
5
Contributors
9
Last commit (this folder)
May 10, 2026 (5 months ago)
Last release
Oct 24, 2026 (4 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from blackwell-systems

Cite this page

lsp-simulate skill. Agent Mart. https://agentmart.dev/skills/blackwell-systems-lsp-simulate (last updated 2026-10-24)