I've been building at the intersection of Bazel + coding agents for a few months and finally have some fun things to share. The first one is a hermetic, cross-platform Claude Code toolchain let's you easily use Claude in Bazel builds, tests, and runs.
Why is this cool? It lets you use Claude Code in Bazel actions and allows you to take full advantage of Bazel's powerful remote execution, remote caching, and sandboxing features.
Remote execution means you can run 10,000+ prompts in parallel in a remote execution cluster each with its own hermetic sandbox and tightly controlled input root for context management. Remote caching means you never have to run the same prompt twice (unless an input changes). This saves you tokens and allows you to build complex pipelines of Claude prompts that only get rerun when needed. Sandboxing (both locally and remotely) means you don't have to worry about Claude Code having access to files that it shouldn't have access to, and you get a clean reproducible sandbox each time.
A few examples
Hate writing docs? Write a Claude rule to generate docs for you:
claude(
name = "generate_docs",
srcs = ["src/main.py"],
prompt = "Generate markdown documentation for this Python module.",
out = "docs.mdx",
)
Want to make sure your README file isn't broken? Write a Claude test to validate that everything still works as expected:
claude_test(
name = "validate_readme",
srcs = ["README.mdx"],
prompt = "Walk through this README and verify all the steps work correctly.",
)
Want to generate a marketing website for your new Github repo? Point it at the README file and you're off to the races:
claude(
name = "website",
srcs = ["README.mdx"],
prompt = "Generate a complete static marketing website based on this README.",
)
The possibilities truly are endless here, and I'm really excited to see what you all do with it. Feel free to comment or file an issue on Github with any feedback / ideas / etc you have.
siggi•1h ago
Why is this cool? It lets you use Claude Code in Bazel actions and allows you to take full advantage of Bazel's powerful remote execution, remote caching, and sandboxing features.
Remote execution means you can run 10,000+ prompts in parallel in a remote execution cluster each with its own hermetic sandbox and tightly controlled input root for context management. Remote caching means you never have to run the same prompt twice (unless an input changes). This saves you tokens and allows you to build complex pipelines of Claude prompts that only get rerun when needed. Sandboxing (both locally and remotely) means you don't have to worry about Claude Code having access to files that it shouldn't have access to, and you get a clean reproducible sandbox each time.
A few examples
Hate writing docs? Write a Claude rule to generate docs for you:
claude( name = "generate_docs", srcs = ["src/main.py"], prompt = "Generate markdown documentation for this Python module.", out = "docs.mdx", )
Want to make sure your README file isn't broken? Write a Claude test to validate that everything still works as expected:
claude_test( name = "validate_readme", srcs = ["README.mdx"], prompt = "Walk through this README and verify all the steps work correctly.", )
Want to generate a marketing website for your new Github repo? Point it at the README file and you're off to the races:
claude( name = "website", srcs = ["README.mdx"], prompt = "Generate a complete static marketing website based on this README.", )
The possibilities truly are endless here, and I'm really excited to see what you all do with it. Feel free to comment or file an issue on Github with any feedback / ideas / etc you have.