# Multi Edit

> Apply multiple text replacements to a single file atomically

- Skill: `tashfeenahmed/multi-edit` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tashfeenahmed/multi-edit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tashfeenahmed/multi-edit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tashfeenahmed (https://skillmd.com/u/tashfeenahmed)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/tashfeenahmed/multi-edit

---


# Multi Edit Skill

Apply multiple text replacements to a single file atomically. All edits succeed or none are applied.

## When to Use

Use multi_edit for:

- **Multiple related changes**: Rename a variable across a file
- **Refactoring**: Make several coordinated edits at once
- **Atomic updates**: Ensure partial edits don't corrupt the file

## Input Format

```json
{
  "path": "src/config.ts",
  "edits": [
    { "old_string": "const PORT = 3000", "new_string": "const PORT = 8080" },
    { "old_string": "const HOST = 'localhost'", "new_string": "const HOST = '0.0.0.0'" }
  ]
}
```

### Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `path` | string | Yes | - | File path (relative to workspace) |
| `edits` | array | Yes | - | List of {old_string, new_string} pairs |

## Behavior

- Each edit replaces the **first occurrence** only
- Edits are simulated first — if any `old_string` is not found, all edits fail
- Ambiguous matches (multiple occurrences) cause failure
- No partial writes — all or nothing

## Limitations

- File must be within workspace boundaries
- Each old_string must appear exactly once in the file (after previous edits are simulated)

