Simon Willison

Results 2637 comments of Simon Willison

Claude computer use has three versions of a `text_editor` tool for three different models: https://docs.anthropic.com/en/docs/agents-and-tools/computer-use#pricing ![Image](https://github.com/user-attachments/assets/2a7ac00a-0477-4dff-94a4-3f35231b45fe) They provide a reference implementation here: https://github.com/anthropics/anthropic-quickstarts/blob/99502f5d33df22b3e88bd3c2a52691414e8994e4/computer-use-demo/computer_use_demo/tools/edit.py ```python Command_20250124 = Literal[ "view", "create", "str_replace",...

They deal with long responses by truncating through [this function](https://github.com/anthropics/anthropic-quickstarts/blob/99502f5d33df22b3e88bd3c2a52691414e8994e4/computer-use-demo/computer_use_demo/tools/run.py#L9): ```python TRUNCATED_MESSAGE: str = "To save on context only part of this file has been shown to you. You should...

I wonder why Anthropic bundled all of those things into a single tool function that takes the command as its first argument? Maybe they were missing an abstraction like my...

Here's how their [undo edit feature](https://github.com/anthropics/anthropic-quickstarts/blob/99502f5d33df22b3e88bd3c2a52691414e8994e4/computer-use-demo/computer_use_demo/tools/edit.py#L248C1-L259C1) works: ```python def undo_edit(self, path: Path): """Implement the undo_edit command.""" if not self._file_history[path]: raise ToolError(f"No edit history found for {path}.") old_text = self._file_history[path].pop() self.write_file(path,...

In https://github.com/anthropics/anthropic-quickstarts/commit/ef0bbbd0b327fe7d643f619b7f9c48d8b22f7867 it says about Claude 4: > These models bring next-generation capabilities with the updated str_replace_based_edit_tool that replaces the previous str_replace_editor tool. The undo_edit command has been removed in...

Open question how much of the Claude tool design to imitate. I believe the Claude computer use model has been fine-tuned for that specific design of those tools, but the...

Interesting note from Paul Gauthier about the Claude tool: - https://github.com/Aider-AI/aider/issues/3529#issuecomment-2725011163 > This is just a new version of a tool that's been around since last year. I've tested previous...

Tip [from @gojira](https://twitter.com/gojira/status/1928644489456816251): OpenAI have their own apply patch demo. I tracked the system prompt down here: https://github.com/openai/codex/blob/4f3d294762e7351268d4670812a24cd4a876a73a/codex-cli/src/utils/agent/apply-patch.ts#L774 Then printed that out in a notebook here: https://observablehq.com/@simonw/applypatchtoolinstructions > ```` >...

OK, to get this done I'm going to have to simplify, in a way that keeps open adding extra features in the future. I'm going to go with this: -...

```bash llm -m o4-mini -o reasoning_effort high \ -f issue:https://github.com/simonw/llm/issues/1095 \ -s 'Implement the new class Files based on the latest design' ``` https://gist.github.com/simonw/4ed9c0116639cbcf1d7e370d2e0c22bf - pretty good starting point.