Start in 60 seconds
Pick the path that matches what you have. Each one is a single command away from a working agent.
Nothing. No account, no key. Install Ollama, then:
ollama pull qwen2.5-coder:7b
gocode # finds Ollama, uses your local model, says so
One key for every hosted model. Get one at openrouter.ai/keys:
export OPENROUTER_API_KEY=sk-or-...
gocode --model anthropic/claude-sonnet-4-6
A provider key you already have:
export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, ...
gocode
Then two commands worth knowing before you trust a model with your code:
gocode doctor --model qwen2.5-coder:7b # can it stream, follow a system prompt, call tools, call several at once?
gocode chat --max-cost 2 # hard stop at $2 of estimated spend, before the next tool runs
If you type gocode with nothing set up, it prints exactly these three paths
instead of an error.
Why gocode
We loved what Claude Code did for terminal-based AI coding. But we wanted something faster, model-agnostic, and dependency-free.
So we built gocode from scratch in Go — inspired by the best ideas in terminal AI agents, but with a completely original architecture. Every subsystem was designed and written from the ground up: the provider layer, the agent runtime, the tool executor, the orchestrator, the memory system, the planning engine. All of it.
The result: a single 12MB binary that starts in under 10 milliseconds, works with 200+ models across 11 providers, and ships with capabilities that most agents don't even attempt.
What Makes gocode Different
Any Model. Your Choice.
Most terminal agents lock you into one provider. gocode works with all of them. Claude, GPT, Gemini, Grok, DeepSeek, Mistral, Llama, local models — set one env var and go. Or use OpenRouter and access every model with a single API key.
A Team of Agents, Not Just One
gocode doesn't run a single agent loop. It runs an orchestrator with specialist sub-agents that plan, coordinate, and delegate to each other. Up to 5 concurrent background agents, each with their own model preference and tool permissions.
Memory That Persists — and Dreams
Cross-session memory that remembers your preferences, project conventions, and architectural decisions. Plus a dream system that autonomously consolidates and prunes memory during idle periods, keeping what matters and forgetting what doesn't.
IDE-Level Tooling in Your Terminal
Real LSP integration (actual renames, actual go-to-definition — not regex). AST-grep for structural code search. A WebSocket bridge that connects to VS Code, Cursor, Kiro, and Antigravity. This isn't a chatbot with file access. It's an agent with IDE capabilities.
Instant. Always.
Under 10ms startup. 12MB binary. No runtime dependencies. No Python. No Node. No virtual environments. go install and you're done.
Cheap Where It Counts
The fixed part of every request is small: about 1,700 tokens of system prompt plus twelve tool schemas. On Anthropic that prefix and the conversation so far are prompt-cached, so a 30-turn tool loop pays full price for them once, not thirty times. Tool output is capped at 40 KB per call and file reads are paged, so one stray cat cannot flood the context. /cost shows the split per model, cache reads included, and --max-cost puts a ceiling on a session in dollars.
What's New
v0.10.0 — the any-model release has to actually work with any model
No new parity rows. The provider layer, the permission boundary, and the agent
loop got their first tests, and what the tests found got fixed: streams that
broke mid-reply were being recorded as complete, fallback never fired for rate
limits, streamed token counts were zero, and a trusted git * approved
git status; rm -rf /. New: a loop guard that stops a model repeating the same
failing tool call, --max-cost for unattended runs, a per-model cost ledger
behind /cost, gocode doctor --model X to probe what a model can do, zero-config
local models through Ollama or LM Studio, and an opt-in eval harness under
evals/ that scores gocode per model on real tasks. Details in the
changelog.
v0.9.0 — One More Thing.
Eighteen new capabilities. Eight new skills that change how the agent thinks. A dream system that consolidates memory while you sleep. A planning engine that delegates to the strongest model in the room. Vim keybindings. A cron scheduler. A swarm of agents that talk to each other. A WebSocket bridge for IDE integration. PDF reading. Output styles. And a buddy system — because even an AI agent deserves a companion.
v0.8.0 — The Universal Model Layer
200+ models. 11 providers. Local inference. Persistent memory. Task management. Web search. The agent can delegate to specialists and remember what you told it last week.
v0.7.0 — The Agent Operating System
Full terminal UI. Multi-agent orchestration. Model fallback. 21 slash commands. Skills system. Plugin architecture. LSP integration. AST-grep.
Modes
Supported Models
Every model. Every provider. One binary. No lock-in.
4 native providers. 7 proxy services. Local inference. 200+ models. Set one env var and go.
gocode chat --model sonnet # Claude
gocode chat --model gpt5 # GPT-5.4
gocode chat --model deepseek # DeepSeek
gocode chat --model groq-llama # Llama on Groq (800 tok/s)
gocode chat --model qwen2.5-coder:7b # any model installed in Ollama, no key, no config
gocode chat --goal coding # auto-pick the best coding model
One Key. Every Model.
Don't want to manage 11 API keys? Set one OpenRouter key and access every model from every provider.
export OPENROUTER_API_KEY=sk-or-your-key
gocode chat --model openai/gpt-4o # GPT-4o
gocode chat --model anthropic/claude-sonnet-4-20250514 # Claude Sonnet
gocode chat --model google/gemini-2.5-pro-preview # Gemini
gocode chat --model x-ai/grok-3 # Grok
gocode chat --model deepseek/deepseek-chat # DeepSeek
gocode chat --model meta-llama/llama-3.3-70b-instruct # Llama
gocode chat --model mistralai/mistral-large-latest # Mistral
One binary. One key. Every model on the planet. Get your key at openrouter.ai/keys.
The Full Feature Set
Multi-Agent Orchestration
- 4 built-in sub-agent profiles: coordinator, deep-worker, planner, debugger
- Up to 5 concurrent background agents with independent contexts
- Agent-to-agent messaging: every spawned agent joins the swarm under its own name, can message
mainor a sibling withsend_agent_message, seeslist_agents, and reads its inbox at the start of each turn; background agents report their result tomainwhen they finish - Category-based model routing (deep/quick/visual/ultrabrain)
- Automatic model fallback on rate limits and server errors
Planning & Strategy
/plan— interview-style planning sessions/ultraplan— deep planning with strongest available model (background, 30min timeout)- Structured plan output with scope analysis and step-by-step blueprints
Memory & Persistence
- Cross-session memory with 3 scopes and team sync
- Dream system — autonomous memory consolidation (orient → gather → consolidate → prune)
- Session persistence and resume (
-c/-rflags) - Memory aging and relevance-based pruning
IDE-Level Tools
- LSP integration — real renames, go-to-definition, find-references, diagnostics
- AST-grep — structural code search and rewrite (Go, JS, TS, Python)
- Hash-anchored file I/O — CRC32 line hashes prevent stale edits
- Auto-format on save (gofmt, prettier, black, rustfmt)
IDE Bridge
- WebSocket server for bidirectional IDE communication
- Works with VS Code, Cursor, Kiro, Antigravity
- Permission forwarding and real-time response streaming
- Multiple concurrent IDE connections
Terminal UI
- Full bubbletea TUI with split panels (chat + git diff viewer)
- 4 built-in themes: golang, monokai, dracula, nord
- Custom themes via
.gocode/theme.json - Custom keybinds via
.gocode/keybinds.json - Vim keybindings — full normal/insert/visual modes with motions, operators, text objects
MCP Server & Client
- Full MCP protocol compliance (server mode for IDEs)
- MCP client — connect to external MCP servers for extended capabilities
- 14+ built-in tools
- Dual transport: stdio and HTTP
Skills System
- 16 built-in skills (see below)
- Custom skills via
.gocode/skills/JSON files - Mid-session skill switching with
/skill - Skills with MCP server configs auto-start child processes
Scheduling & Automation
- Cron scheduler with 5-field expressions
- Background agent execution on schedule
- Persistent schedules in
.gocode/cron.json - GitHub Actions integration (
gocode-actionfor PR review and issue implementation)
Session & Git
- Git checkpoints with
/undo Nand per-session refs - Git worktree tools for parallel branch work
/diff— see changes made this session/review— agent self-reviews its own changes/commit— auto-generated commit messages
More
- PDF reading (text extraction, 50MB limit, pure Go)
- Web search (DuckDuckGo, no API key needed)
- Web fetch (URL content extraction)
- Structured JSON output with
--output-format jsonand--output-schema - Output styles (concise, verbose, markdown, minimal) + custom styles
- Notebook editing (Jupyter .ipynb cell-level operations)
- Tmux persistent terminal sessions
- Plugin system with hook pipeline
- Migrations system for automatic config upgrades
- 25+ slash commands
- 23 CLI subcommands
Skills — Expertise on Demand
One flag, and your agent becomes a specialist.
gocode chat --skill golang-best-practices # writes Go like a senior engineer
gocode chat --skill nothing-design # designs like Teenage Engineering
gocode chat --skill loop # autonomous keep-going mode
16 Built-in Skills
Create your own — drop a JSON file in .gocode/skills/.
Community Skills — Standing on the Shoulders of Giants
Installation
One-Line Install (macOS / Linux)
curl -fsSL https://raw.githubusercontent.com/AlleyBo55/gocode/main/install.sh | bash
One-Line Install (Windows PowerShell)
irm https://raw.githubusercontent.com/AlleyBo55/gocode/main/install.ps1 | iex
Go Install (all platforms, requires Go 1.21+)
go install github.com/AlleyBo55/gocode/cmd/gocode@latest
Download Binary Manually
Grab the binary for your platform from GitHub Releases:
Linux Packages (deb/rpm)
# Debian/Ubuntu
curl -fsSL https://github.com/AlleyBo55/gocode/releases/latest/download/gocode_amd64.deb -o gocode.deb
sudo dpkg -i gocode.deb
# Fedora/RHEL
curl -fsSL https://github.com/AlleyBo55/gocode/releases/latest/download/gocode_amd64.rpm -o gocode.rpm
sudo rpm -i gocode.rpm
Build from Source
git clone https://github.com/AlleyBo55/gocode.git
cd gocode
go build -o gocode ./cmd/gocode/
sudo mv gocode /usr/local/bin/
Verify
gocode --version
Quickstart
# 1. Install
go install github.com/AlleyBo55/gocode/cmd/gocode@latest
# 2. Set your API key (pick any provider)
export ANTHROPIC_API_KEY=sk-ant-...
# 3. Chat
gocode chat
# Or one-shot
gocode prompt "find all TODO comments in this project"
No Python. No Node. No virtual environments. One binary, one env var, go.
Architecture
26 internal packages. Clean interfaces. Zero external runtime dependencies. Goroutines and channels for native concurrency. go:embed for compiled-in registries. Atomic file writes for zero-corruption session persistence.
gocode/
├── cmd/gocode/ # CLI entrypoint — 23 subcommands
├── data/ # Embedded command/tool registries
├── internal/
│ ├── agent/ # ConversationRuntime, ToolExecutor, permissions, hooks
│ ├── apiclient/ # Provider interface, Anthropic/OpenAI/Gemini/xAI/proxy providers
│ ├── orchestrator/ # Multi-agent orchestration, background agents
│ ├── swarm/ # Agent-to-agent messaging, discovery registry
│ ├── ultraplan/ # Deep planning with strongest model
│ ├── dream/ # Autonomous memory consolidation
│ ├── lsp/ # Language Server Protocol integration
│ ├── astgrep/ # Structural code search
│ ├── bridge/ # WebSocket IDE bridge
│ ├── mcp/ # MCP server (full protocol)
│ ├── mcpclient/ # MCP client (external servers)
│ ├── tui/ # Bubbletea terminal UI
│ ├── repl/ # Interactive REPL
│ ├── vim/ # Vim keybinding engine
│ ├── skills/ # Skills system
│ ├── cron/ # Cron scheduler
│ ├── session/ # Session persistence
│ ├── memory/ # Persistent memory
│ ├── buddy/ # Terminal companion system
│ └── ... # 6 more packages
Documentation
gocode vs Claude Code
gocode is inspired by Claude Code but built from scratch with a different architecture, different language, and a broader vision. Here's how they compare:
Contributing
git clone https://github.com/AlleyBo55/gocode.git
cd gocode
make test && make build
The Buddy System
One more thing. gocode comes with a terminal companion. 18 species across 5 rarity tiers. Deterministic gacha seeded from your user ID. Tracks DEBUGGING, CHAOS, and SNARK stats. Displays ASCII sprites in your REPL banner.
Because even an AI agent deserves a friend.
you> /buddy
License
MIT — use it, fork it, ship it.
Search Keywords
claude code alternative · claude code replacement · claude code open source · open source claude code · ai coding agent go · go ai agent · mcp server go · cursor mcp server go · kiro mcp server · vscode mcp server golang · fast ai agent go · single binary ai agent · multi model ai agent · multi agent orchestration go · deepseek coding agent · groq fast inference agent · ollama coding agent · local llm coding agent · 200 models ai agent · openai compatible agent · ai pair programmer terminal · terminal coding agent golang · claude code but faster · claude code go alternative