3code, the economical coding agent

4 min read Original article ↗

The economical
coding agent.

It's so lean you can use it for free!

╶──╮ ╶──┤ 3code v0.5.1 the economical coding agent ╶──╯ provider baseten model GLM-5.2 type a prompt. :help for commands. :q or Ctrl-D to exit.  

Never stop coding

When your subscription runs out, or you don't have one, keep vibecoding with 3code. There are many open-weight model providers, some of them free. 3code gives you a nice, familiar interface and special tuning so you can use them for coding.

Get started

1

Get a provider

3code also supports moonshot's Kimi (both subscriptions and api), Deepseek, OpenRouter, and many others.

More providers

2

Install 3code and enter your API key

$ curl -fsSL https://3code.capocasa.dev/install | sh
$ curl -fsSL https://3code.capocasa.dev/install | sh
> irm https://3code.capocasa.dev/install.ps1 | iex
$ mkdir myprojectdir
$ cd myprojectdir
$ 3code
  ╶──╮
  ╶──┤    3code v0.5.0   the economical coding agent
  ╶──╯

  no provider configured. let's add one. (ctrl+d to quit)
  supported: deepinfra, ovh, nvidia, nebius, fireworks

  api key              : ************************
  provider name or url : nvidia
  verifying... ok
  saved to ~/.config/3code/config

3

Run your first prompt

 Build me a Hello World program in Nim

Why 3code

3code, the economical coding agent is as useful as any top coding agent, but also takes special care not to burn any more tokens, computer power or brain cycles than it absolutely needs to.

How 3code pulls it off

  • programmed in Nim - expressive power saves tokens and tiny footprint comes for free
  • aggressive token caching covers all bases
  • simple-yet-robust algorithmic security model - no AI decisions, no interactive permissions
  • partial self-context-resetting plan/execution skill for larger tasks
  • smart defaults and the freedom to experiment

We eat our own dog food! Recently 3code is completely written with 3code, using GLM 5.2.

Design: The 3E E's

E1

Token efficiency

There are a many, many design choices where small adjustments lead to huge savings. Then there is one unique innovation- chunked mode- that constantly extracts relevant and discards irrelevant data and keeps agentic coding with very little context- and it improves results because of intelligent discarding.

E2

Computer efficiency

3code is written as a system program and is absolutely tiny. It always loads and responds instantly- as an AI assisted programmer you are an extremely productive individual- your coding agent should not keep you waiting, even for a few seconds.

E3

Ergonomics

The idea that you have to trade efficiency for ease of use is so widespread, most designs that are efficient technically will have poor usability. But it doesn't have to be that way- Enjoy efficiency that's a joy to use.

Data to back it up

SWE-bench Verified: tasks resolved

10-task subset, both agents on Z.ai glm-5.2 via the same LiteLLM proxy, 600s per-task timeout

3code 6 / 10

opencode 5 / 10

Non-cached input tokens

batch total (9 tasks, excluding sympy-23534)

3code ~295k

opencode ~1.45M

opencode sent 4.9× the non-cached input of 3code on comparable work, driven by higher tool-call volume: more file reads, more bash, more context re-sent per turn.

Cached input tokens

batch total (9 tasks, excluding sympy-23534)

3code ~4.7M

opencode ~10.7M

On most providers cached input accounts for 90%+ of token spend, so this is where efficiency pays off most.

Output tokens

batch total (9 tasks, excluding sympy-23534)

3code ~69k

opencode ~106k

Technical Details

  • 1.6 MB binarysingle executable, no runtime dependencies
  • cross-platformlinux x86-64/arm64 · macos universal · windows
  • no daemon, no web UIrun it, use it, done
  • low visual noisehigh information density; terse output, nothing wasted
  • 40 known-good combosvalidated provider + model pairings, just works out of the box
  • loop guarddetects runaway autonomous edits, halts at configurable thresholds
  • session persistencehuman-readable .3log format; resume any past session
  • native web searchstartpage built-in, no curl dependency
  • context compactionsupersede-aware; later writes elide stale reads to shrink context
  • context clear toolwipe accumulated context mid-session to start a subtask fresh
  • self-clearing executionplan/execute skill resets context between phases for larger tasks
  • experimental modeunlock models beyond the validated set for power users
  • no telemetrysessions stay local, nothing phoned home
  • MIT licensedo whatever you want with it