← ClaudeAtlas

sandbox-tool-builderlisted

How to build a NEW tool of your own by writing its code in your sandbox, testing it, and forging it into a live, callable tool with `env(action="forge_tool")`. Use when no existing tool does what you need and you can implement it as a small script. Multiple tools + skills can be saved together as one reusable Sandbox Tool Pack.
CocoRoF/geny-executor · ★ 2 · AI & Automation · score 79
Install: claude install-skill CocoRoF/geny-executor
# Building your own sandboxed tool When you lack a tool you need, **write one**. A sandboxed tool is just a script in your workspace that reads a JSON request on stdin and writes a JSON response on stdout. You author it, test it, then `forge_tool` registers it as a real tool you can call from the next turn — and it always runs **inside your sandbox**, not on the host. You need a sandbox (an isolated workspace) attached to this session. If you don't have one, `forge_tool` will tell you. ## The loop 1. **Write the script** into your workspace with your file-write tool, at a stable path like `tools/<name>/main.py`. The contract: - read the whole request from **stdin** (a JSON object), - write the result to **stdout** as a JSON object, - on failure, print `{"error": "..."}` (or exit non-zero) — that surfaces as a tool error. Minimal Python example (`tools/wordcount/main.py`): ```python import sys, json req = json.load(sys.stdin) text = req.get("text", "") print(json.dumps({"words": len(text.split()), "chars": len(text)})) ``` 2. **Test it** with your shell tool, exactly how the tool will be invoked: ``` echo '{"text":"a b c"}' | python3 tools/wordcount/main.py ``` Iterate until the output JSON is right. 3. **Forge it** — register it live: ``` env(action="forge_tool", args={ "name": "wordcount", "description": "Count words and characters in text.", "entrypoint": "tools/wordcount/main.py", "runtime":