A coding agent you can read
Fast, correct, autonomous.
Pick two.
elelem is a coding agent for your terminal. The core is 978 lines of Ruby. Models, tools, and interfaces are plugins, and every one of them is short enough to read.
gem install elelem elelem-builtins> the date parser drops time zones. find out why and fix it.
grep parse_date lib/
read lib/calendar/parser.rb
edit lib/calendar/parser.rb
execute bundle exec rspec spec/parser_spec.rb
12 examples, 0 failures
The parser called Time.parse on the date portion only, so the
offset was discarded. It now parses the full string and keeps the zone.An illustration of a session. Tools shown come from elelem-builtins and elelem-tools.
Principles
Small enough to read.
You hand an agent your codebase and a shell. You should be able to read the agent. elelem's core fits in an afternoon: the loop, the conversation, the toolbox, the plugin registry. No framework underneath.
Everything else is a plugin.
Models, tools, slash commands, even the terminal UI. A plugin is a Ruby file that calls
Elelem.configure. Drop it in.agents/plugins/and it loads. Package it as a gem to share it.Your model, your machine.
Use Claude, OpenAI, or Ollama. Or load a GGUF file straight into the elelem process with llama.cpp and keep every token on your laptop. No server, no API key, no network.
Unix at heart.
elelem chatfor a session.elelem askreads stdin and writes stdout, so it fits in a pipe, a git hook, or a Makefile.
How it fits together
A small loop in the middle. Plugins on every side.
The core sends the conversation to a provider, runs the tools the model asks for, and repeats until the model is done. Everything it talks to is swappable.
How the agent loop worksExtend it
A tool is a block of Ruby.
Describe the parameters, return a hash. elelem validates the arguments against the schema, calls your block, and hands the result back to the model. Save the file and start a session.
Write your first toolElelem.configure do |config|
config.setup(:word_count) do |agent|
agent.toolbox.add("word_count",
description: "Count words in a file",
params: { path: { type: "string" } },
required: ["path"]) do |args|
{ words: File.read(args["path"]).split.size }
end
end
end- Your first session Install elelem with the default tools and Ollama, chat with a local model, and ask a one-shot question.
- Run elelem fully offline Run a GGUF model inside the elelem process with elelem-llama, with GPU offload and a context size you choose.
- Write a tool plugin Add a tool the model can call, in one Ruby file, then package it as a gem.
Start with one command.
gem install elelem elelem-builtins elelem-ollamaRequires Ruby 4.0 or later. Then run elelem chat -p ollama. Installation details