maki

the efficient coder

I got frustrated with existing coding agents and hitting hourly/weekly token limits.

So I built Maki, a lightweight Rust TUI with some novel context token reduction techniques.

In benchmarks, it reduces cost by 2x and finishes them 2x faster too.

0:00 / 0:00

to see the snake game Opus 4.6 created

Where tokens go

index

Parses 15 languages into skeletons: imports, type defs, function signatures with their line ranges.

Costs 59 tok/turn, saves 224 on reads. Reads were ~65% of my tokens, so this one is big.

code_execution

A sandboxed Python interpreter where every tool is an async function.

The model gathers 50 reads, greps them, prints the 3 lines that matter. The rest never touches your context.

tool_search

Datadog's MCP server has over 100 tools. Every definition sits in your context on every request, used or not.

Maki hides them behind one search tool and loads what the model asks for.

task

The model picks weak, medium, or strong for each subagent. Haiku-tier for grep-heavy research, opus-tier for architecture.

You get a summary, not the transcript.

compaction

Long sessions get compacted: images and thinking blocks go first, then old turns get summarized.

The system prompt and tool descriptions are short too.

index: read less, know more

Instead of reading full files, index parses with tree-sitter and returns a compact skeleton.

The model sees the structure, then reads only the lines it needs.

main.rshover to restore
use std::fs;use clap::Parser;use color_eyre::Result; #[derive(Parser)]struct Args {    paths: Vec<PathBuf>,    #[arg(short, long)]    lines: bool,} fn count_words(text: &str) -> usize {    text.split_whitespace().count()} fn count_lines(text: &str) -> usize {    text.lines().count()} fn main() -> Result<()> {    let args = Args::parse();    for path in &args.paths {        let text = fs::read_to_string(path)?;        let n = if args.lines {            count_lines(&text)        } else {            count_words(&text)        };        println!("{}: {n}", path.display());    }    Ok(())}
maki index main.rsskeleton
imports: [1-3]
  clap::Parser, color_eyre::Result, std::fs

types:
  #[derive(Parser)]
  struct Args [5-9]
    paths: Vec<PathBuf>
    lines: bool

fns:
  count_words(text: &str) -> usize [11-13]
  count_lines(text: &str) -> usize [15-17]
  main() -> Result<()> [19-29]
29 lines 13 lines 55% smaller

code_execution: think inside the sandbox

Tools are exposed as async Python functions.

The model writes a script, runs it sandboxed, and only the print() output enters your context.

scriptpython
# find dead exports in a TS repo
files = await glob(pattern='src/**/*.ts')
srcs = await asyncio.gather(
    *[read(path=f) for f in files]
)

exports = {}
imports = set()
for f, src in zip(files, srcs):
    for m in re.finditer(r'^export \w+ (\w+)', src, re.M):
        exports[m.group(1)] = f
    for m in re.finditer(r'import\s*\{([^}]+)\}', src):
        imports.update(n.strip() for n in m.group(1).split(','))

for name, f in exports.items():
    if name not in imports:
        print(f'{f}  {name}')
output3 lines
src/lib/csv.ts       parseCsvLegacysrc/auth/jwt.ts      signV1src/utils/phone.ts   formatE164
~40k tokens ~30 tokens 1300x reduction

What you get

Lua plugins

Extend maki in Lua with a Neovim-style plugin API: add tools, slash commands, keymaps, and UI.

Anything maki does out of the box, your plugins can do too.

Rust TUI, 60 FPS

Native binary. No javascript runtime, no react. Even the splash screen animation uses SIMD.

Syntax highlighting runs on a background thread pool so it never blocks your input.

Full visibility

Philosophy: don't hide anything. Token count, cost, and model are always in the status bar.

Each subagent gets its own chat window you can flip through with /tasks (Ctrl-X). Ctrl-F for fuzzy search.

/btw runs a side query without touching the current session. ! runs shell commands, !! runs them silently.

Sensible permissions

Bash commands are parsed with tree-sitter so maki knows what's actually being run.

git diff && rm -rf / correctly flags both git and rm. Most agents only see git. Handles subshells, command substitution, pipes.

Per-tool allow/deny rules, or --yolo to skip it all.

Also in there: parallel sessions you can switch away from, long-term memory, double-Escape to rewind, plan mode, MCP over stdio or HTTP, skills, ACP, opt-in OpenTelemetry, 26 themes, image paste, and --print for headless.

Lua plugins: hackable all the way down

Every built-in tool, read, bash, edit, even batch, is itself a Lua plugin. Read them in ./plugins.

The API mirrors Neovim (maki.fs, maki.uv, maki.keymap, maki.treesitter), so it feels familiar.

Drop a file in ~/.config/maki/plugins/ to add tools, slash commands, keymaps, or UI.

add a ci_status tool: the model checks CI itself
maki.api.register_tool({
  name = "ci_status",
  description = "Latest CI run for this branch",
  schema = { type = "object", properties = {} },
  handler = function()
    local res, err = maki.net.request(
      "https://ci.internal/runs/json?branch=main")
    if err then
      return { llm_output = err, is_error = true }
    end
    local buf = maki.ui.buf()
    buf:lines(maki.ui.highlight(res.body, "json"))
    return { llm_output = res.body, body = buf }
  end,
})
add /standup: show yesterday's commits
maki.api.register_command({
  name = "/standup",
  description = "Yesterday's commits",
  handler = function()
    local buf = maki.ui.buf()
    local win = maki.ui.open_win(buf, { title = "standup" })
    maki.fn.jobstart(
      "git log --since=yesterday --oneline", {
        on_stdout = function(_, line) buf:line(line) end,
      })
    repeat
      local ev = win:recv()
    until not ev or ev.key == "esc"
    win:close()
  end,
})

And yes... it can even run DOOM!

0:00 / 0:00

Providers

Set an API key env var, or use maki auth login openai for OAuth.

Anything that speaks the OpenAI or Anthropic API works too.

Write a short provider script. OpenAI oauth example included.