# claude.sh > Claude Code rewritten as a ~1,500-line bash script with zero npm dependencies, using only curl and jq to interact with the Anthropic API. claude.sh is a minimal, dependency-free reimplementation of Claude Code as a single bash script. It replaces ~380,000 lines of TypeScript and 266 npm packages with roughly 1,500 lines of shell script, requiring only `curl` and `jq`. The tool provides a full REPL loop for interacting with Claude models, including real-time streaming, tool execution, and session management — all with instant startup and no Node.js runtime. - **Real-time streaming** via FIFO pipe so text appears as Claude generates it, providing a responsive interactive experience - **6 built-in tools** (Bash, Read, Edit, Write, Glob, Grep) enabling Claude to read, write, and search files and run shell commands - **Tool chaining** supports up to 25 tool calls per turn, allowing complex multi-step tasks - **Permission prompting** asks before running non-safe commands, with `y/n/a` options and configurable permission modes (`ask`, `allow`, `deny`) - **CLAUDE.md loading** reads project instructions from CLAUDE.md files up the directory tree for project-aware context - **Git-aware context** injects branch name, status, and recent commits into the system prompt automatically - **Session save/resume** auto-saves conversations on exit and allows resuming by ID or interactive list - **Retry with backoff** handles 429/529 rate limit errors with exponential backoff - **Cost tracking** displays per-turn and session token cost totals - **Slash commands** including `/help`, `/cost`, `/model`, `/clear`, `/save`, `/resume`, `/commit`, and `/diff` - **Pipe mode** allows non-interactive use: `echo "explain this" | ./claude.sh` - **Modular architecture** split across `api.sh`, `json.sh`, `tools.sh`, and `tui.sh` for maintainability To get started, clone the repository, make the script executable with `chmod +x claude.sh`, set your `ANTHROPIC_API_KEY` environment variable, and run `./claude.sh`. Optionally install `ripgrep` for better search and `python3` for the edit tool. ## Features - Real-time streaming via FIFO pipe - 6 tools: Bash, Read, Edit, Write, Glob, Grep - Tool chaining up to 25 calls per turn - Permission prompting before non-safe commands - CLAUDE.md project instruction loading - Git-aware context injection - Session save and resume - Exponential retry on rate limits - Per-turn and session cost tracking - Slash commands (/help, /cost, /model, /clear, /save, /resume, /commit, /diff) - Pipe mode for non-interactive use - Configurable model and token limits via environment variables ## Integrations Anthropic Claude API, curl, jq, ripgrep (optional), python3 (optional), git ## Platforms MACOS, LINUX, API, CLI ## Pricing Open Source ## Links - Website: https://github.com/jdcodes1/claude-sh - Documentation: https://github.com/jdcodes1/claude-sh - Repository: https://github.com/jdcodes1/claude-sh - EveryDev.ai: https://www.everydev.ai/tools/claude-sh