What problem does it solve?
Clarifies the inside/outside line of a codebase by preventing ad-hoc direct calls to external systems (LLM APIs, MCP servers, shell, filesystem, Git) and centralizing error handling, retries, and permission checks so tools remain safe and predictable.
Core Features & Use Cases
- Central boundary modules: route Claude API and other external calls through services/api and services/mcp so retry, streaming, and token budget logic live in one place.
- Sandboxed file and shell access: enforce path resolution with getResolvedPath, use execFile wrappers to avoid shell interpolation, and gate operations with the permission system.
- Git helpers and graceful failures: use utils/git.ts wrappers to handle "not a git repo" cases and non-zero exits consistently.
- Use case: Adding a new external integration—build a services/[name] module to encapsulate network errors, rate limits, auth, and retries instead of sprinkling fetch() or exec() calls across tools.
Quick Start
Route all external API, filesystem, and shell calls through a dedicated services module, enforce execFile argument arrays, and resolve paths via the sandboxing helper before allowing tool use.