Claude can use Anthropic’s text editor tool to view and modify text files, helping you debug, fix, and improve code or other text documents. This enables Claude to interact directly with your files, providing practical assistance rather than just suggestions.Documentation Index
Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
Use this file to discover all available pages before exploring further.
Preparation Before Using the Text Editor Tool
Select a Compatible Model Anthropic’s text editor tool supports the following Claude models:- Claude 4 Models (
claude-opus-4-20250514,claude-sonnet-4-20250514):text_editor_20250429 - Claude 3.7 Sonnet (
claude-3-7-sonnet-20250219):text_editor_20250124 - Claude 3.5 Sonnet (
claude-3-5-sonnet-20241022):text_editor_20241022
Model-Specific Tool Configuration
| Model Version | Tool Type | Tool Name | Supported Features |
|---|---|---|---|
| Claude 4 (Opus/Sonnet) | text_editor_20250429 | str_replace_based_edit_tool | view, str_replace, create |
| Claude 3.7 Sonnet | text_editor_20250124 | str_replace_editor | view, str_replace, create, undo_edit |
| Claude 3.5 Sonnet | text_editor_20241022 | str_replace_editor | view, str_replace, create, undo_edit |
Evaluating Use Cases
Here are some typical scenarios for using the text editor tool:- Code Debugging: Help identify and fix issues in code, from syntax errors to logical problems.
- Code Refactoring: Improve code structure, readability, and performance through targeted edits.
- Documentation Generation: Add docstrings, comments, or README files to your codebase.
- Test Creation: Create unit tests based on implementation understanding.
Using the Text Editor Tool
Provide the text editor tool to Claude through the Messages API: You need to install theanthropic package:
Migrating to Claude 4
If you’re migrating from Claude 3.7 Sonnet to Claude 4 models, please note the following changes:Update Tool Configuration
python
Remove Unsupported Features
undo_editcommand: Claude 4 models no longer support the undo edit functionality- Please remove any logic that depends on
undo_editfrom your code