Source URL: https://simonwillison.net/2025/Mar/13/anthropic-api-text-editor-tool/
Source: Simon Willison’s Weblog
Title: Anthropic API: Text editor tool
Feedly Summary: Anthropic API: Text editor tool
Anthropic released a new “tool" today for text editing. It looks similar to the tool they offered as part of their computer use beta API, and the trick they’ve been using for a while in both Claude Artifacts and the new Claude Code to more efficiently edit files there.
The new tool requires you to implement several commands:
view – to view a specified file – either the whole thing or a specified range
str_replace – execute an exact string match replacement on a file
create – create a new file with the specified contents
insert – insert new text after a specified line number
undo_edit – undo the last edit made to a specific file
Providing implementations of these commands is left as an exercise for the developer.
Once implemented, you can have conversations with Claude where it knows that it can request the content of existing files, make modifications to them and create new ones.
There’s quite a lot of assembly required to start using this. I tried vibe coding an implementation by dumping a copy of the documentation into Claude itself but I didn’t get as far as a working implementation – it looks like I’d need to spend a bunch more time on that to get something to work, so my effort is currently abandoned.
Via @alexalbert__
Tags: anthropic, claude, llm-tool-use, ai, llms, claude-artifacts, ai-assisted-programming, generative-ai
AI Summary and Description: Yes
Summary: The text discusses the release of a new text editing tool by Anthropic, which utilizes their AI model Claude. This tool offers various functionalities for file manipulation, but setting it up requires additional developer effort, emphasizing its relevance for professionals dealing with AI and generative AI technologies.
Detailed Description: The provided content revolves around the newly launched text editing tool by Anthropic, designed for use with its AI model, Claude. Here are some major points of significance:
* **Tool Functionality**: The new text editor mimics previous tools offered by Anthropic but comes with enhanced capabilities for text manipulation. Key functions include:
– **view**: Allows users to display a whole file or a specific range.
– **str_replace**: Facilitates exact string replacement within a file.
– **create**: Lets users create a new file with specified content.
– **insert**: Provides functionality to add text at a specific line number.
– **undo_edit**: Allows for reverting the last edit made to a file.
* **Developer Responsibility**: The implementation of these commands is left to developers, indicating a layer of complexity and customization. This presents both challenges and opportunities for developers:
– They need to write code that integrates these commands effectively within their applications.
– The mention of a “vibe coding” attempt highlights the exploratory nature of development in the AI space, especially for leveraging generative models like Claude.
* **Conversations with Claude**: Once the commands are implemented, users can interactively work with Claude to perform file manipulations, showcasing AI’s role in programming and software development.
* **Practical Implications**:
– This tool represents a step toward better integration of AI in programming environments, potentially increasing productivity.
– Developers might find this particularly relevant for tasks involving automation, version control, and collaborative editing workflows.
In summary, the release of this text editor tool by Anthropic underscores the growing intersection of AI capabilities with software development practices, particularly in generative AI contexts. Professionals in AI security and software security fields may need to consider the implications of such tools on the coding landscape and potential security vulnerabilities arising from their integration.