MCPcopy Index your code
hub / github.com/shareAI-lab/learn-claude-code / run_write

Function run_write

agents/s12_worktree_task_isolation.py:514–521  ·  view source on GitHub ↗
(path: str, content: str)

Source from the content-addressed store, hash-verified

512
513
514def run_write(path: str, content: str) -> str:
515 try:
516 fp = safe_path(path)
517 fp.parent.mkdir(parents=True, exist_ok=True)
518 fp.write_text(content)
519 return f"Wrote {len(content)} bytes"
520 except Exception as e:
521 return f"Error: {e}"
522
523
524def run_edit(path: str, old_text: str, new_text: str) -> str:

Callers 1

Calls 1

safe_pathFunction · 0.70

Tested by

no test coverage detected