1This is a tool for making multiple edits to a single file in one operation. It is built on top of the Edit tool and allows you to perform multiple find-and-replace operations efficiently. Prefer this tool over the Edit tool when you need to make multiple edits to the same file.
 2
 3Before using this tool:
 4
 51. Use the Read tool to understand the file's contents and context
 6
 72. Verify the directory path is correct
 8
 9To make multiple file edits, provide the following:
10
111. file_path: The absolute path to the file to modify (must be absolute, not relative)
122. edits: An array of edit operations to perform, where each edit contains:
13   - old_string: The text to replace (must match the file contents exactly, including all whitespace and indentation)
14   - new_string: The edited text to replace the old_string
15   - replace_all: Replace all occurrences of old_string. This parameter is optional and defaults to false.
16
17IMPORTANT:
18
19- All edits are applied in sequence, in the order they are provided
20- Each edit operates on the result of the previous edit
21- All edits must be valid for the operation to succeed - if any edit fails, none will be applied
22- This tool is ideal when you need to make several changes to different parts of the same file
23
24CRITICAL REQUIREMENTS:
25
261. All edits follow the same requirements as the single Edit tool
272. The edits are atomic - either all succeed or none are applied
283. Plan your edits carefully to avoid conflicts between sequential operations
29
30WARNING:
31
32- The tool will fail if edits.old_string doesn't match the file contents exactly (including whitespace)
33- The tool will fail if edits.old_string and edits.new_string are the same
34- Since edits are applied in sequence, ensure that earlier edits don't affect the text that later edits are trying to find
35
36When making edits:
37
38- Ensure all edits result in idiomatic, correct code
39- Do not leave the code in a broken state
40- Always use absolute file paths (starting with /)
41- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.
42- Use replace_all for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.
43
44If you want to create a new file, use:
45
46- A new file path, including dir name if needed
47- First edit: empty old_string and the new file's contents as new_string
48- Subsequent edits: normal edit operations on the created content