Claude Code rewritten as a bash script
CLI ToolFreeHave you ever wondered if Claude Code could be rewritten as a bash script? Me neither, yet here we are. Just for kicks I decided to try and strip down the source, removing all the packages.
Capabilities6 decomposed
claude api interaction via bash subprocess invocation
Medium confidenceExecutes Claude API calls through bash script wrappers that construct HTTP requests using curl, parse JSON responses, and stream output directly to stdout. Implements request/response handling without external dependencies beyond curl and standard Unix utilities, enabling lightweight API integration in shell environments where Python or Node.js may be unavailable or undesirable.
Pure bash implementation with zero external SDK dependencies — uses only curl and POSIX utilities to construct and execute Claude API calls, making it portable across any Unix-like system without package managers or language runtimes
Lighter weight and faster startup than Python/Node.js SDKs for single one-off API calls, but sacrifices robustness and error handling that language-specific clients provide
code generation from natural language prompts via claude
Medium confidenceAccepts natural language descriptions as bash arguments or stdin, sends them to Claude's API with appropriate system prompts, and returns generated code in the user's target language. The script constructs API payloads with temperature and max_tokens parameters tuned for code generation, then parses and outputs the code block from Claude's response.
Bash-native code generation without IDE integration — runs as a standalone CLI tool that can be chained in Unix pipelines, making it suitable for headless servers and automation contexts where VS Code or web UI is unavailable
Faster invocation than opening Copilot or Claude web UI for quick one-off code snippets, but lacks IDE context awareness and multi-file refactoring capabilities of integrated tools
streaming response output with real-time token display
Medium confidenceImplements server-sent events (SSE) parsing in bash to consume Claude's streaming API responses, printing tokens to stdout as they arrive rather than buffering the entire response. Uses curl's streaming mode with line-by-line parsing to extract 'delta' content from SSE-formatted JSON events and display them immediately.
Pure bash SSE parser without external streaming libraries — uses only curl and POSIX text utilities to consume and display server-sent events, avoiding dependencies on Python's requests or Node.js event emitters
Simpler and more portable than language-specific streaming clients, but significantly slower token processing and less robust error handling for malformed or interrupted streams
multi-turn conversation state management in bash
Medium confidenceMaintains conversation history by storing previous messages in bash arrays or temporary files, appending new user input to the message list, and sending the full conversation context to Claude's API on each turn. Implements a simple state machine that tracks message roles (user/assistant) and reconstructs the conversation payload for each API call.
Bash-native conversation state using simple file-based or array-based storage — avoids database dependencies by leveraging shell variables and temp files, making it suitable for lightweight automation without external services
Simpler setup than database-backed conversation systems, but lacks scalability, persistence guarantees, and token management features of production chatbot frameworks
system prompt customization for task-specific behavior
Medium confidenceAllows users to specify or override the system prompt sent to Claude via environment variables or command-line flags, enabling task-specific instruction injection without modifying the script itself. The script constructs the API request with a configurable system message that guides Claude's behavior (e.g., 'You are a code reviewer' or 'You are a technical writer').
Environment-variable-driven system prompt injection — allows runtime customization without code changes, making it easy to swap task-specific behaviors in shell pipelines and automation scripts
More flexible than hardcoded system prompts, but less structured than prompt management systems with versioning, templates, and quality metrics
error handling and api failure recovery via bash conditionals
Medium confidenceImplements basic error detection by checking curl exit codes and HTTP response status codes, then outputs error messages or retries based on failure type. Uses bash conditionals to distinguish between network errors, authentication failures, and rate limiting, with optional retry logic for transient failures.
Bash-native error handling using only shell conditionals and exit codes — avoids external error handling libraries by leveraging curl's built-in status reporting and bash's control flow
Simpler than SDK-based error handling with fewer dependencies, but lacks sophisticated retry strategies, circuit breakers, and structured error logging of production frameworks
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with Claude Code rewritten as a bash script, ranked by overlap. Discovered automatically through the match graph.
Claudraband – Claude Code for the Power User
Hello everyone.Claudraband wraps a Claude Code TUI in a controlled terminal to enable extended workflows. It uses tmux for visible controlled sessions or xterm.js for headless sessions (a little slower), but everything is mediated by an actual Claude Code TUI.One example of a workflow I use now is h
ai-sdk-provider-claude-code
AI SDK v6 provider for Claude via Claude Agent SDK (use Pro/Max subscription)
Continuous Claude – run Claude Code in a loop
Continuous Claude is a CLI wrapper I made that runs Claude Code in an iterative loop with persistent context, automatically driving a PR-based workflow. Each iteration creates a branch, applies a focused code change, generates a commit, opens a PR via GitHub's CLI, waits for required checks and
Claude-replay – A video-like player for Claude Code sessions
I got tired of sharing AI demos with terminal screenshots or screen recordings.Claude Code already stores full session transcripts locally as JSONL files. Those logs contain everything: prompts, tool calls, thinking blocks, and timestamps.I built a small CLI tool that converts those logs into an int
crystal
(Crystal is now Nimbalyst) Run multiple Codex and Claude Code AI sessions in parallel git worktrees. Test, compare approaches & manage AI-assisted development workflows in one desktop app.
BrowserOS – "Claude Cowork" in the browser
Hey HN! We're Nithin and Nikhil, twin brothers building BrowserOS (YC S24). We're an open-source, privacy-first alternative to the AI browsers from big labs.The big differentiator: on BrowserOS you can use local LLMs or BYOK and run the agent entirely on the client side, so your company&#x
Best For
- ✓DevOps engineers and sysadmins automating infrastructure tasks
- ✓Solo developers building lightweight CLI tools that need LLM capabilities
- ✓Teams with existing bash-heavy workflows avoiding polyglot dependencies
- ✓Developers wanting fast code scaffolding without context switching to web UI
- ✓Build automation engineers embedding code generation into deployment pipelines
- ✓Prototypers iterating quickly on proof-of-concept implementations
- ✓Interactive CLI users who want immediate feedback
- ✓Developers building real-time monitoring or logging systems
Known Limitations
- ⚠No built-in request batching or connection pooling — each invocation creates a new HTTP connection
- ⚠Manual JSON parsing via grep/sed/awk is fragile and error-prone for complex nested responses
- ⚠No automatic retry logic or exponential backoff for rate limits or transient failures
- ⚠Streaming responses require careful shell quoting and escape handling to avoid data corruption
- ⚠No local caching of API responses — every identical request re-queries Claude
- ⚠No syntax validation — generated code may have runtime errors or incomplete logic
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
About
Show HN: Claude Code rewritten as a bash script
Categories
Alternatives to Claude Code rewritten as a bash script
Search the Supabase docs for up-to-date guidance and troubleshoot errors quickly. Manage organizations, projects, databases, and Edge Functions, including migrations, SQL, logs, advisors, keys, and type generation, in one flow. Create and manage development branches to iterate safely, confirm costs
Compare →Are you the builder of Claude Code rewritten as a bash script?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →