🤖 ai neuro
TypeScript Execution Layer vs Bash for AI Agents
Bash is a stepping stone for AI agents, not the final answer. TypeScript-based execution layers offer significant advantages for AI tool calling.
The Problem with Bash
- Context flooding: Dumping codebase into prompt = more tokens = dumber model
- No standards: No common pattern for safe operations, permissions, or state sharing
- Probabilistic filtering: Asking AI to filter files is unreliable
- Fragile: Shell escaping, quoting, and environment issues
The TypeScript Alternative
Tools like Just, Dax, and Cloudflare’s Code Mode use TypeScript as the execution layer.
Benefits
| Benefit | Detail |
|---|---|
| Strongly typed | Clear inputs/outputs, IDE support |
| Deterministic | grep/ripgrep > AI probabilistic filtering |
| Portable | Just a file, no Docker needed |
| Sandboxable | V8/Node.js/Worker isolates |
| Composable | Functions can call functions |
Real Results
From Theo’s analysis (t3.gg):
- 40% reduction in token usage
- +3 points accuracy improvement
Key Insight
“Context flooding (dump codebase ke prompt) = bad. More tokens = dumber model”
Use deterministic tools for deterministic tasks. Reserve AI for actual reasoning.
When to Use What
| Task | Tool |
|---|---|
| File search | ripgrep (deterministic) |
| Code parsing | AST parsers (deterministic) |
| Refactoring | AI + TypeScript layer |
| Build orchestration | TypeScript task runner |
References
- Video: “Bash Is Not Enough” by Theo (t3.gg)
- Tools: Just, Dax, Just JS, Cloudflare Code Mode