OpenRadar

Project · Go · Added June 14, 2026

gopher-code

Claude Code rewritten from scratch in Go — single binary, 12ms cold start, zero Node.js, 33 built-in tools, Bubble Tea TUI. The Go-native AI coding agent.

894 stars 23 forks View on GitHub

Gopher Code

Overview

Gopher Code is a ground-up rewrite of Anthropic’s Claude Code in Go. Not a wrapper, not a binding, not a transpilation — every subsystem of Claude Code v2.1.88 has been analyzed and rebuilt natively using the modern 2026 Go ecosystem. The project hit 894 GitHub stars within about ten weeks of its April 2026 launch, which tells you something about the demand for a lightweight, dependency-free AI coding agent.

The project was created by @projectbarks, who looked at Claude Code’s 513,000 lines of TypeScript, its Node.js runtime, bundled Ink/React renderer, native addons for every platform, and a node_modules tree that qualifies as a geological formation — and asked: what if it was just a binary? The answer is a single static executable that starts in 12ms, cross-compiles in seconds, and uses goroutines for parallel tool execution instead of Promise.all. No V8 heap, no garbage collector pauses from React re-renders, no runtime dependencies.

The core problem Gopher Code solves is the bloat tax of Node.js-based developer tools. Claude Code is an incredible tool, but shipping it means bundling Node.js, Electron-era dependencies, and platform-specific native addons. For developers working in Go shops, on resource-constrained machines, in CI/CD pipelines, or on ARM64 edge devices, that overhead is real. Gopher Code compresses the entire AI coding agent experience into something you can go build and drop anywhere Go runs.

Why it matters

The AI coding agent space is exploding. Claude Code, Cursor, Windsurf, Codex, Aider, Continue — the list grows weekly. Almost all of them are built on Node.js or Python. Gopher Code represents a different thesis: that the next generation of developer tools should be native binaries, not interpreted runtimes with dependency trees. This is the same pattern that gave us ripgrep (replacing grep), fd (replacing find), bat (replacing cat), and delta (replacing diff). Go-native tools that are faster, simpler to distribute, and easier to hack on.

The timing matters because AI coding agents are becoming infrastructure. They run in CI pipelines, on remote servers, inside containers, on developer laptops for 8+ hours a day. The startup cost, memory footprint, and distribution complexity of Node.js-based agents adds up. A single Go binary that cross-compiles to any platform in seconds changes the deployment story entirely. You can drop Gopher Code into a Dockerfile with a single COPY command and no npm install.

There’s also the hackability angle. Claude Code’s source is 513K lines across 1,885 TypeScript files. Reading it in a week is optimistic. Gopher Code’s Go implementation is designed to be readable in an afternoon. For developers who want to understand how an AI coding agent works — the query loop, tool execution, permission system, context compaction — a clean Go codebase with explicit state flow and interface-based boundaries is dramatically more approachable.

Key Features

Single Static Binary. go build produces one executable with zero runtime dependencies. No Node.js, no npm, no native addons, no platform-specific builds to manage. Cross-compile for any Go-supported target with a single environment variable change. This alone is a game-changer for CI/CD and container deployments where every megabyte and every second of startup time matters.

12ms Cold Start. The Go runtime initializes in milliseconds, not the multi-second bootstrap that Node.js requires. For a tool that developers invoke hundreds of times per day, those seconds add up. The binary loads, connects to the Anthropic API, and starts streaming responses before a Node.js-based agent has finished loading its module graph.

Bubble Tea TUI. The terminal interface is built on Charm’s Bubble Tea v2 framework — an Elm-architecture TUI library that’s become the standard for Go CLI tools. Lipgloss handles styling, Glamour renders markdown, and Bubbles provides spinners, viewports, and text inputs. The result is a terminal UI that feels polished without the overhead of an Electron renderer.

33 Built-In Tools. File operations, shell execution, git integration, MCP client, glob matching, and more — all implemented natively in Go. The tool system uses interface-based design, making it straightforward to add new tools or modify existing ones. Tool input validation uses JSON Schema, and the permission system evaluates tool calls before execution.

Native Concurrency. Go goroutines handle parallel tool execution, SSE streaming, and background tasks without the complexity of JavaScript’s async/await patterns. The errgroup and semaphore patterns from golang.org/x/sync manage concurrent operations cleanly. Multiple tools can execute simultaneously without blocking the main query loop.

Golden File Parity Testing. The project maintains behavioral parity with Claude Code through golden file tests — captured transcripts from the TypeScript implementation that the Go version must match. This isn’t just structural similarity; the tests verify that message normalization, system prompt assembly, tool schemas, and multi-turn query loops produce equivalent output.

OpenTelemetry Observability. Built-in traces, metrics, and spans via go.opentelemetry.io/otel. You can instrument the agent’s behavior, track API call latency, monitor tool execution times, and export telemetry to any OTLP-compatible backend. This is production-grade observability baked in from day one, not bolted on after the fact.

Use Cases

Pros and Cons

Pros:

Cons:

Getting Started

# Clone the repository
git clone https://github.com/projectbarks/gopher-code.git
cd gopher-code

# Build the binary (requires Go 1.24+)
go build -o gopher ./cmd/gopher

# Run the interactive REPL
./gopher

# Run a single query in headless mode
./gopher -p "explain this codebase"

# Specify a working directory and model
./gopher -c /path/to/project -m claude-sonnet-4-20250514

# Cross-compile for Linux ARM64
GOOS=linux GOARCH=arm64 go build -o gopher-linux-arm64

# Run tests
go test ./...

# Run with race detector
go test -race ./...

CLI flags:

Alternatives

Claude Code — The original. 513K lines of TypeScript, full feature set, production-ready, backed by Anthropic. If you need a working AI coding agent today with all features, Claude Code is the obvious choice. Gopher Code is a reimplementation, not a replacement — not yet.

Aider — Python-based AI coding agent with strong git integration and multi-model support. Aider is more mature, supports more LLM providers, and has a larger community. Choose Aider if you want multi-provider support and proven production reliability. Choose Gopher Code if you want a Go-native binary and are willing to trade feature completeness for distribution simplicity.

OpenCode — Go-based terminal coding agent that’s an alternative to Claude Code. OpenCode is further along in feature parity and has more contributors. If you specifically want a Go-native coding agent that’s closer to production-ready, OpenCode is the safer bet today. Gopher Code is more of a clean-room rewrite with a focus on architectural purity.

Verdict

Gopher Code is one of the most ambitious reimplementation projects in the AI tooling space right now. Taking Claude Code’s 513K lines of TypeScript and rewriting them in idiomatic Go is a massive undertaking, and at ~3% parity, the project has a long road ahead. But the foundation is solid — the query loop works, API streaming works, the Bubble Tea TUI is polished, and the architecture is clean enough to read in an afternoon. For Go developers who want an AI coding agent that ships as a single binary with 12ms cold start, this is the project to watch. It’s not ready for production today. But the Go ecosystem has a track record of replacing bloated tools with lean alternatives — ripgrep, fd, bat, delta — and Gopher Code is applying that same philosophy to AI coding agents. If you’re a Go developer who’s been frustrated by the Node.js tax of current AI tools, star this repo and check back in six months.

Related

Shared tags