Fast apply of file edits
With this tool, you can apply code changes suggested by an LLM to your existing code files fast (2000+ tokens/second).
Traditional code generation requires generating the entire files every time, which can be slower for large files. With this approach your LLM only generates the specific changes needed, and this tool applies them to the original file.
Configure environment variables
- Morph
- Relace
Pass your Morph API key and Morph model (default = morph-v2) set as environment variables when creating the sandbox.
Use the tool via Blaxel SDK
Call thefastapply endpoint of the Sandbox API via the Blaxel SDK to fast-apply a targeted edit to a specified file with Morph or Relace, with instructions and partial contents.
Use the tool via MCP
Call thecodegenEditFile tool on the MCP server of a sandbox to fast-apply a targeted edit to a specified file, with instructions and partial contents.
Use Blaxel SDK to retrieve the tool in any compatible agent framework (here in AI SDK format):
Other tools built for codegen
Use the following codegen-optimized functions by making tool calls through the MCP server or REST API of a sandbox. See example above on how to retrieve and execute the tools.| Tool | Description |
|---|---|
codegenCodebaseSearch | Semantic search to find relevant code snippets |
codegenFileSearch | Fast fuzzy file path search |
codegenGrepSearch | Exact regex search using ripgrep engine |
codegenListDir | List directory contents (quick discovery) |
codegenReadFileRange | Read file contents within a specific line range (max 250 lines) |
codegenRerank | Performs semantic search/reranking on code files in a directory |
codegenParallelApply | Plan parallel edits across multiple file locations |
codegenReapply | Use smarter model to retry a failed edit |
Connect Claude Code to a Blaxel Sandbox
Build a Claude Agent SDK agent that connects to a Blaxel sandbox and operates it using the sandbox’s MCP server.
