Tin

Examples · anthropic · 46 of 339

editor

The text editor tool (text_editor_20250728): Claude views and edits files under ./workspace.

examples/anthropic/editor.tintin run examples/anthropic/editor.tin
// The text editor tool (text_editor_20250728): Claude views and edits files under ./workspace. Each edit
// is guarded, so a person approves it first (or TIN_APPROVE=edit).
import "std/anthropic"

/// View and edit files in ./workspace.
guarded tool fn edit(input: string): Result<string, string> => anthropic.textEditor("workspace").call(input)

agent Fixer {
  model: "claude-haiku-4-5"
  tools: [edit]
  clientTools: { textEditor: { tool: edit, maxCharacters: 20000 } }
}

fn main() {
  print(Fixer("workspace/primes.py has a syntax error. Fix it."))
}