EDIT_ABSOLUTE

Constant EDIT_ABSOLUTE 

Source
pub const EDIT_ABSOLUTE: &str = "Performs exact string replacements in files.\n\nUsage:\n- You must use your Read tool at least once in the conversation before editing. This tool will error if you attempt an edit without reading the file.\n- When editing text from Read tool output, ensure you preserve the exact indentation (tabs/spaces) as it appears AFTER the line number prefix. The line number prefix format is \"L{n}: \". Everything after that prefix is the actual file content to match. Never include any part of the line number prefix in `old_string` or `new_string`.\n- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.\n- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.\n\n### Parameters\n\n- `file_path`: Absolute path to the file to modify (required)\n- `old_string`: Exact text to find and replace (required)\n- `new_string`: Replacement text (required)\n- `replace_all`: Replace all occurrences when true, default false (optional)\n\n### Error Behavior\n\n- The edit will FAIL if `old_string` is not found in the file with an error \"oldString not found in content\".\n- The edit will FAIL if `old_string` is found multiple times in the file with an error \"oldString found multiple times and requires more code context to uniquely identify the intended match\". Either provide a larger string with more surrounding context to make it unique or use `replace_all` to change every instance of `old_string`.\n\n### When to Use This Tool\n\n- Making targeted changes to existing files\n- Fixing bugs in specific code sections\n- Updating function implementations\n- Renaming variables across a file (with `replace_all: true`)\n- Adding new code to existing files\n\n### When NOT to Use This Tool\n\n- Creating new files - use Write tool instead\n- When most of a file needs to change - use Write tool instead\n- When you haven\'t read the file yet - read it first!\n\n### Examples\n\nReplacing a single occurrence:\n```\nfile_path: \"/home/user/project/src/main.rs\"\nold_string: \"fn old_name() {\"\nnew_string: \"fn new_name() {\"\n```\n\nRenaming a variable everywhere in a file:\n```\nfile_path: \"/home/user/project/src/main.rs\"\nold_string: \"old_var\"\nnew_string: \"new_var\"\nreplace_all: true\n```\n\nAdding code after an existing line:\n```\nfile_path: \"/home/user/project/src/main.rs\"\nold_string: \"use std::io;\"\nnew_string: \"use std::io;\\nuse std::fs;\"\n```\n\n### Best Practices\n\n1. Always read the file first using the Read tool\n2. Copy the exact text from the Read output, preserving whitespace and indentation\n3. Include enough context in `old_string` to make it unique\n4. When adding new code, include the line before/after in `old_string` for context\n5. Use `replace_all: true` when renaming variables or making consistent changes\n6. Don\'t include line number prefixes (like \"L42: \") in your old_string or new_string\n\n### Common Mistakes to Avoid\n\n- Forgetting to read the file first\n- Including line number prefixes in old_string\n- Not including enough context (causes \"found multiple times\" error)\n- Changing indentation unintentionally\n- Forgetting that old_string must match EXACTLY (including whitespace)\n";
Expand description

Edit tool context for absolute path mode.