In short.
This guide helps developers build Claude assistants that read and edit text files, but the application must perform and protect every file operation. It explains the text_editor_20250728 tool, file viewing, replacement, creation and insertion, with API examples and implementation guidance. Its practical value is a defined editing interface and conversation pattern; it does not supply a complete editor implementation or establish editing accuracy. Model token charges apply, including documented tool overhead, while dollar costs and runtime performance remain unknown.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete selected page at [https://platform.claude.com/docs/en/agents-and-tools/tool-use/text-editor-tool.md], including its examples, implementation guidance, security advice, pricing table, changelog and availability and data-handling notices. Linked model references, pricing pages, retention requirements and other tool documentation are excluded. Nothing was executed. Runtime behavior, deployment compatibility, editing quality and total task cost remain unassessed.
The overview
Identity
Text editor tool is Anthropic’s documentation for integrating a Claude file-editing interface into an application. The selected source is the complete documentation page at [https://platform.claude.com/docs/en/agents-and-tools/tool-use/text-editor-tool.md].
The documented tool is named str_replace_based_edit_tool and uses type text_editor_20250728 for Claude 4 and later models. This resource is an integration guide rather than a downloadable editor application.
Assessment
The guide is useful when building an assistant that needs to inspect files and make targeted changes. It explains the responsibilities on both sides: Claude requests an operation, and the application validates and performs it. The implementation examples leave core command handlers unfinished, so developers still need to build the filesystem layer, protections and verification. Reliability and development effort are not quantified.
Users
The strongest fit is developers building debugging assistants, code review integrations, documentation workflows or other applications that edit text files. Beginners can learn how model tool requests become file operations, but implementation requires familiarity with API messages and filesystem programming. Experienced developers get command parameters, matching rules, error responses and token-overhead figures.
Capabilities
The interface provides four commands. view reads a file or lists a directory. str_replace replaces an exact text match. create writes a new file with supplied content. insert adds text after a specified line, with 0 indicating the beginning of the file.
File views can request a line range using 1-based numbering; an ending value of -1 means through the end. The page proposes debugging, refactoring, documentation and test creation as applications. These are intended uses, not demonstrated success rates.
Using it
Requirements
An integration needs access to a compatible Claude model, a Messages API conversation loop and an application environment that can perform the permitted file operations. The tool has a model-defined input schema: developers do not supply or modify that schema.
The page lists availability through Claude API and several cloud platforms, while directing readers to a separate tool reference for model support. Exact compatibility for a particular deployment is not established by the supplied page alone. Minimum SDK versions and hardware requirements are not specified.
Mechanism
Claude returns a tool_use block containing a command and its parameters. The application reads or changes the relevant file, then sends a user message containing a tool_result linked to the original tool_use_id. It retains the assistant’s tool request in the conversation and continues until Claude finishes or requests another operation.
Declaring the tool does not itself provide filesystem access. File operations run in the application’s environment, and file contents returned in tool_result messages are sent to Claude.
Setup
Include type text_editor_20250728 and name str_replace_based_edit_tool in the request’s tools list. Optionally set max_characters to control file-view truncation; the page’s example uses 10000, which is an example value rather than a stated default. This option requires text_editor_20250728 or later.
Implement handlers for all four commands, validate paths and permissions, create backups and return operation results. Return failures with is_error set to true, including missing files, denied permissions and replacement text with zero or multiple matches. Line-numbered views help Claude use line ranges and insertion positions.
Example
The documentation illustrates fixing a missing colon in primes.py. Claude first requests a file view. After the application returns the contents, Claude requests a replacement of the loop line with a version ending in a colon. The application reports that exactly one location changed, and Claude explains the edit.
This illustrates the message exchange and a narrow replacement. The example’s final assurance that the program should run is not accompanied by a test result, so it does not establish that the program was executed or behaves correctly.
Assessment & evidence
Limitations
Replacement text must match exactly, including whitespace and indentation, and must identify exactly one location. The application must reject ambiguous or missing matches. Truncated views can omit context relevant to an edit.
The current command set has no undo_edit command; the changelog says it was removed in text_editor_20250429. Recovery therefore needs application-managed backups or another recovery mechanism. The command-dispatch examples are scaffolding, and checks such as Python syntax parsing do not establish complete program correctness.
Why it may fit
The defined commands make the requested operation explicit: the application receives a path, command and relevant text or line position instead of having to interpret a prose editing suggestion. Exact-match replacement provides a clear condition the application can check before writing. This makes the interface a plausible fit for controlled, targeted editing, but it does not prove that Claude chose the correct change.
Alternatives
For work where a person can apply changes, the page contrasts direct file interaction with having Claude suggest edits. Keeping manual application is an option when an automated filesystem integration is unnecessary.
The page also links to Claude’s Bash tool for shell commands at [https://platform.claude.com/docs/en/agents-and-tools/tool-use/bash-tool]. That linked resource is outside the supplied evidence, so its implementation, costs and suitability are not assessed. The page supplies no comparative benchmarks.
Evidence
The evidence is a complete captured Anthropic documentation page containing command definitions, API examples, illustrative outputs, implementation advice, pricing overhead and availability notices. It supports an explanation of the intended interface and integration responsibilities.
The sample outputs are documentation examples, not independent execution records. Editing accuracy, latency, recovery behavior and security enforcement are not assessed, and no benchmark results are supplied.
Access & freshness
Costs
The page states that standard input and output token pricing applies for the chosen Claude model. It lists additional input overhead for text_editor_20250728 of 974 tokens for Claude 4.7 and later models and Claude Mythos Preview, or 745 tokens for Claude 4.6 and earlier models.
Model dollar rates are not included. Total task cost is unknown because it also depends on file contents, generated responses and the number of tool exchanges. Implementation, hosting and maintenance costs are not quantified.
Rights and data handling
The supplied page does not state a licence for its prose or code examples. Permission to redistribute those materials and any applicable commercial-use terms are unknown.
The data-handling table marks the feature eligible for zero data retention, excluding Covered Models, and eligible for HIPAA use. Those eligibility statements do not establish the configuration or compliance of a particular application. The linked retention requirements are outside the supplied evidence, and local file execution does not mean returned file contents stay local.
Freshness
The supplied page was captured on 15 November 2026. Its latest listed tool-version entry is text_editor_20250728, dated 28 July 2025, which added max_characters and unspecified fixes. The capture date does not establish when every part of the page was last revised.
The examples use claude-opus-5-5 and the API version header 2026-10-21. These are documented example values, not independently verified compatibility guarantees. The page’s broad statement that the tool is available on every model should be read alongside its model list and instruction to match tool and model versions.
Getting started
Before integrating, confirm support for the intended model and platform and obtain the applicable model pricing. Build path and permission checks, backups and unique-match enforcement into the application’s file handlers.
Start with a small backed-up file and a narrowly described edit. Inspect the resulting change, return operation errors accurately and run appropriate checks on the edited code. Treat a successful replacement as confirmation that text changed; program correctness requires separate verification.
