A small (standard-library-only Python) terminal coding agent for a local Ollama model. Deterministic code does discovery, search, editing, permissions, context pruning and statistics. The model is used only for reasoning and code generation: one inference per step, no background or auxiliary model calls.
command ada [-w WORKSPACE] [-m MODEL] [-c] [-t [true|false]] [-r [ID]] [-p "one request"] [-v 0..3] [-j] [-n] [-l] [-V] [-h]
[--setting VALUE ...] [--root DIRECTORY] [--ignore PATTERN] [-s]
Every flag has a long form: --workspace --model --chat --think --resume --prompt --verbosity --json-statistics --no-session --preload --version --help.
-c, --chat chats with the model in the same interface, without tools, a workspace or instructions: no trusted directory
question, no /cd, and a plain cd line goes to the model as words. Chats keep their own sessions, separate from every directory.
-t, --think lets a thinking model think before it answers, dimmed above the answer and never saved; --think false turns
thinking off. Without it the model decides.
Profile options set any configuration key for one run, on top of the files: --context --output --temperature --threads
--keep-alive --step-limit --tool-characters --preview-characters --preload-seconds --host --color --approvals --mode --system --system-file --memory
--memory-index-characters --project-file --project-file-characters --repository-map-characters --prune-at
--prune-to --shell-timeout --shell-output-bytes --search-timeout --sandbox-mask-limit --sandbox-memory-megabytes --sandbox-processes --request-timeout --sessions-keep
--web --search-url --vision-model --diagnostics-timeout --helper-steps, plus --root DIRECTORY
(trusts a directory for this run) and --ignore PATTERN, both repeatable. Values are checked like the files; a bad one exits
with code 2. --keep-alive takes seconds, a duration such as 10m or 1h30m, or -1 for always.
-s, --save keeps the model, thinking, verbosity and profile options given in your own configuration.json; roots and ignore
grow without duplicates, the system root is refused.
-l, --preload loads the model for the directory of your latest session and exits. install.sh enables it at login as the
systemd user service ada-preload.service (Ollama keeps the model loaded with OLLAMA_KEEP_ALIVE=-1), so the countdown at
start usually ends in a few seconds. It waits up to 2 minutes for Ollama. Log: journalctl --user -u ada-preload.
Slash commands: /help /cd [directory] /statistics /context /reset /save /sessions /resume [id] /model [model] /configuration /memory [topic] /exit.
/stats and /info run /statistics, /config runs /configuration, and any unique start of a command runs it (/sess is /sessions).
Tab completes slash commands at the start of the line; / then Tab lists them all.
A blank line parts every prompt from its response, whether an answer, a command or a directory switch.
/cd directory (or a plain cd directory line) switches directory and starts a new session; it never goes to the model.
At start and after /cd, ADA preloads the model with a countdown (preload_seconds, default 30, 0 turns it off;
Ctrl+C skips it), so the first request only reads your message. The countdown stands in the session line in place of the path
(loading and reading instructions · 30 seconds), typing is hidden meanwhile and kept for the prompt, and the line is redrawn with the path
when the model is ready. Skipped with --resume, -p and piped input.
The built-in verify checks only run after an edit, write or shell change in the same request.
-v: 0 quiet, 1 one-line tool trace (default), 2 previews (preview_characters), 3 full tool results.
Approval prompt: yes, no, always (this exact call, kept in ~/.config/ada/approvals.json for later sessions: in every directory with
"approvals": "general" (the default), only in the directory it was given in with "approvals": "directory", or --approvals for one run;
never for writable or destructive operations). Remove a line there to be asked again.
Mode ("mode" in configuration.json, --mode for one run): strict (the default) answers a greeting or thanks briefly without
tools (a message that is only small talk, such as hi, thanks or what can you do?, ends with the answer even if the model calls a tool), takes paths only as given (a near miss is named, not read) and maps only projects; lenient leaves tools to the model, reads
the one match of a path off by its leading folders or a dropped dot (/local/share for .local/share) and maps any folder.
d shows the whole diff when the first 30 lines leave some out, then asks again. e (file changes, with VISUAL or EDITOR set)
opens the proposed file in the editor through a draft in the cache folder: saving it unchanged is a yes, a changed draft is written
instead of the proposal and the model is told to read the file again; an editor that fails asks again. Neither is kept as always.
/model lists the installed models from Ollama’s /api/tags and refuses one that is not installed (a missing tag means latest);
--model is checked the same way at start. When Ollama does not answer, /model sets it with a warning and --model is not checked.
With color on, answers are styled as they stream: headings, bold, inline code, bullets, quotes, and code blocks with keywords,
strings, numbers and comments highlighted; code lines are not wrapped. Model reasoning and color off stay plain text.
--color always indents, wraps and styles answers like a terminal even when the output is piped, for less -R; with auto or never
piped answers stay plain markdown for scripts.
| Tool | Purpose | Default policy |
|---|---|---|
| project | languages, build manifests, ranked entry points with evidence, verify names (cached) | allow |
| plan | the model’s task list for work of three or more steps: pending, active, done; the latest list is kept whole when the context is trimmed | allow |
| ask | a question to you at the prompt, with numbered suggested answers; in a run with no one to answer the model is told to choose and say what it assumed; a question asking leave for network or write is not asked, the model makes the call and its approval asks | allow |
| task | a helper with its own context and read-only tools (project, list, glob, grep, read, git, diagnostics) runs up to helper_steps steps and returns a short report; it cannot start helpers or ask anything |
allow |
| list / glob | bounded discovery; Git-aware, ignore rules, all=true to include ignored directories |
allow |
| grep | regular expression search; context, before, after lines (path-N- beside path:N: matches, -- between groups), mode files or count, type such as py,c,js beside include globs, scripts without an extension going by their first line’s interpreter; a pattern with regex characters that finds nothing, or is no valid regex, is searched again as plain text; at most 10 matches per file, said when more exist; rg on the path picks the files first when installed; a search for a plain name in code ends with the matching symbol call |
allow |
| symbol | code index: definition of a name or owner.name (similar names when none), references with the definition marked and each use’s enclosing function or class, outline of a file, map of the most used files (path narrows to a folder); Python with ast, about 15 other languages by patterns; refreshed by modification time on every call |
allow |
| read | numbered line ranges, explicit truncation with “more available, continue with start=N”, binary rejected; a file with more than one hard link asks first | allow |
| edit | file read first; one exact, unique match (a leading tabs/spaces difference is applied in the file’s own indentation), replace_all, or several edits all or none; atomic; keeps mode and CRLF; applies exactly the diff that was approved, refused if the file changed meanwhile |
allow (ask if destructive) |
| write | creates new files; replaces a file read first only after approval of its diff, refused if the file changed meanwhile | allow (replacing asks) |
| trash | moves files or folders to the trash with gio trash (recoverable); the workspace itself, protected and outside paths refused |
ask |
| git | status, diff (ref against a commit or range), log (patch with changes, path narrows), show, blame (start, lines), branch, commit with named paths; hooks, pagers and external diff disabled |
allow / commit asks / push denied |
| shell | argv, or command as one bash line with pipes and &&, in Bubblewrap without network unless network (always asks, never saved as always); workspace read-only unless write; directory and environment are kept for later calls; standard error comes in its own section; background returns a job number |
ask (command lines always ask) |
| job | new output of a background command, its exit code, or stops it; no number lists them | allow |
| verify | named validations; py_syntax and git_diff built in; a check with "network": true reaches the internet; PASS only on exit code 0 |
built-ins allow, others ask, network always asks |
| memory | list, read, save or forget a memory topic; a save shows its diff, forget moves the file to the trash | list / read allow, save / forget ask |
| diagnostics | errors and warnings from a language server for one file, run in the read-only sandbox; offered when one is installed or set in language_servers |
allow |
| image | a vision model (vision_model) describes a png, jpeg, gif, webp or bmp file; loaded only while it answers |
allow |
| fetch | a public web page as text, 20,000 characters per call, offered with "web": true |
always asks |
| search | titles, links and snippets from search_url (DuckDuckGo’s HTML page by default), offered with "web": true |
always asks |
Background commands run in their own sandbox, each with its own namespace (no network unless network), so a server started in the background cannot be
reached by a later command: start a server and its tests in one command, such as python3 -m http.server 8000 & sleep 1; python3 test_client.py. At most 4 jobs run at once, each stops after its timeout (default 1800 seconds, at most 3600),
and all of them stop when ADA exits.
Language servers found by themselves when installed: pyright-langserver, basedpyright-langserver, pylsp (Python), clangd (C, C++),
rust-analyzer, gopls, typescript-language-server (TypeScript, JavaScript) and bash-language-server. Others go in language_servers,
such as {".py,.pyi": ["pylsp"]}.
A helper starts its own context, so the main instructions are read again by the model after it reports: worth it for a search that would
otherwise fill the context with many results, not for one grep.
The instructions the model gets are built in a fixed order, so the prompt cache holds across requests: the rules
(system.md or the built-in text), the memory index, the project instructions file, then the workspace line.
Memory lives in ~/.config/ada/memory/. MEMORY.md is the index, one line per topic (- [name](name.md): description),
read at the start of every session up to memory_index_characters (default 2000, 0 reads it whole). Each topic is its own file
with a short header (name, description, kind: user, feedback, project or reference, optional keywords) and the rule
below it. The memory tool reads topics on demand and saves a topic together with its index line, so they never drift apart;
lines you wrote by hand stay where they are. Before each request ADA compares its words with every topic’s name, description and
keywords, and adds a short “Memory topics that may apply” note to the request when some match, so a rule is found even when its
index line does not mention it. The note goes on the request, never into the instructions.
/memory shows the index; /memory <topic> opens a topic in VISUAL or EDITOR, a new name starts from a template that is
kept only once changed. Changes made outside a request count from the next session or /reset. "memory": false leaves out the
index, the note and the tool.
The project instructions file (project_file, default AGENTS.md, empty turns it off) is read from the top of the workspace at
start, after /cd and on /reset, up to project_file_characters (default 4000, 0 reads it whole). A linked file is not followed.
A folder without it is read for CLAUDE.md instead. Subfolders can hold their own: the first time the model reads, edits, lists or
searches under one, its file is added to the conversation (“Instructions read: …”), outermost folder first, once per conversation.
The repository map (the most used files with their top-level symbols, from the symbol index) is added at the same times, up to
repository_map_characters (default 2000, 0 turns it off). It is built for projects (a .git folder or a build manifest such as
Makefile, pyproject.toml or package.json) in strict mode, and for any folder, the home folder too, in lenient mode. A mapping that
takes a second or more is shown as it happens (Mapping /home/user · 12000 files · 3.2 seconds) and its line stays once done.
/configuration lists every instructions source that was read.
Files (~/.config/ada/): configuration.json, system.md, permissions.json, ignore, memory/.
configuration.json and permissions.json list every setting with its built-in default as a // comment, with what it does,
its option and the values it accepts; remove the // to change one. Comments and trailing commas are accepted in both
files, in approvals.json and in the project .ada/ files. --save and trusting a directory rewrite only the changed
values and keep every comment; a value with no line yet goes under its commented default. Counts and time limits
output, shell_timeout, request_timeout and search_timeout must be at least 1.
Precedence, lowest to highest: built-in defaults, configuration.json, <workspace>/.ada/configuration.json
(only model, context, output, step_limit, tool_characters, temperature, system, verify, ignore), command line options.
Project configuration can never change roots, protected_paths, sandbox_paths or sandbox limits, and project permissions.json can only add
ask/deny rules.
Protected paths: protected_paths lists files and directories no tool may change (shell startup files, ~/.config/autostart,
~/.config/systemd, ~/.config/claude, ~/.config/ollama, ~/.gitconfig by default); ADA’s own settings and data folders are
always added. They stay readable, but edit, write and trash refuse them, and writable shell and verify commands see them read only.
Links count under both names. This keeps a trusted home folder from reaching ADA’s own permissions.json and approvals.json.
Resource caps: every sandboxed command runs in a systemd user scope with sandbox_memory_megabytes (default 4096) and sandbox_processes
(default 256); 0 turns a cap off. Without a systemd user session each process gets its own memory limit instead and there is no process cap.
Sandbox paths: commands see an empty home folder, except the folders in sandbox_paths (default ~/.local/bin, ~/.local/lib,
~/.cargo, ~/.rustup, ~/.nvm, ~/go), mounted read only at the same place when they exist. Their bin folders come first in
PATH, and for nvm the newest installed Node is added. Protected names directly inside them (such as .cargo/credentials.toml) are hidden.
Your home folder, a folder above it, ADA’s own folders and private folders such as ~/.ssh are refused. Language servers are found
in the same PATH. Commands also get an /etc/passwd and /etc/group holding only your user and nobody, so Git, ssh and build
tools find your name without warnings.
Network: a shell call with network true, or a verify check with "network": true, shares the machine’s network and reads its
name lookup and certificate files. It always asks, even with an always rule, is never saved as always, and is refused in runs
that cannot ask. "network": "deny" in permissions.json turns it off. The command can reach the internet and services on this
machine, Ollama included. Refused programs such as curl, wget and ssh stay refused.
Trusted directories: roots lists the directories ADA may work in. Starting ADA in a directory outside them asks
Add directory? [y]es / [n]o; yes adds the directory to roots in your own configuration.json and never asks again
for it or anything inside it, no exits with an error. One-shot (-p) and piped runs never ask, and /
is always refused.
System prompt precedence: system_file > non-empty system string in configuration.json > system.md > built-in.
Keys: model context output roots step_limit tool_characters system threads think host temperature keep_alive preview_characters verbosity color approvals mode system_file memory memory_index_characters project_file project_file_characters repository_map_characters shell_timeout shell_output_bytes search_timeout sandbox_mask_limit sandbox_memory_megabytes sandbox_processes sandbox_paths protected_paths prune_at prune_to request_timeout sessions_keep verify ignore.
context 0 (the default) reads num_ctx from the model file through Ollama’s /api/show at start and on /model, and uses 16384
when the model sets none or Ollama does not answer. output (default 4096) is cut to half of the context.
temperature is sent on every request, so it wins over the model file’s own temperature; top_p, top_k and the other sampling
settings still come from the model file, so plain ollama run can answer differently.
threads sends Ollama’s num_thread when above 0 (0 keeps the model’s own; a different count makes Ollama reload the model).
think is true, false or null (the model decides).
permissions.json: defaults per category, plus rules of {"action": "allow|ask|deny", "tool": "shell", "argv": ["git","status"]}
(argv prefix, exact tokens) or "path": "glob" for edit/write/read. Precedence: hard denies (code) > matching deny > ask > allow > defaults.
Example allowing the test runner without prompts:
{"action": "allow", "tool": "verify", "argv": ["python3", "-B", "-m", "unittest", "-q"]}
verify commands (configuration.json): "verify": {"unit": {"argv": ["python3","-B","-m","unittest","-q"], "write": false}}.
/statistics shows per-request and cumulative figures: passes, tool calls, prompt tokens sent (sum over passes), cached tokens
(estimated: Ollama reuses the unchanged start of the previous prompt, so each pass counts the smaller of the two prompt lengths unless
pruning happened in between), prompt tokens actually processed, latest context (measured when Ollama reports it, else labelled estimated),
generated tokens, load / prompt-eval / generation / tool / approval-wait / model-wait / total time, reading and generation rates, prompt
bytes per token, truncated results, pruning events. The session block is left out while it matches the last request. Waiting for the
model is the time outside inference, tools and approvals, mostly a request queued behind another one (Ollama runs one at a time).
After each request the Done line gives the same figures in short, dot separated, values in grey when color is on:
Done · 47.2 seconds · 10 tokens out · inference 1.3 seconds · waiting for the model 45.9 seconds · 3.1 bytes per token. The wait
shows from 1 second on.
~/.local/share/ada/sessions/<id>.json (0600, atomic writes), one per workspace run, validated against the workspace on resume.
Interrupted tool exchanges are repaired on load. Persisted: user/assistant/tool messages including tool outputs (so source snippets
the agent read are on disk), statistics. Not persisted: system prompt, model reasoning. Nothing from other sessions is injected.
Each file stays bounded by the context, since pruning trims the saved messages too. sessions_keep (default 100, 0 keeps all) caps
the count: saving a new session past it sends the oldest to the Trash through gio, never the current one, and keeps them all without gio.
sessions/index.json holds one summary per session, so /sessions and --resume latest read only files that changed since.
python3 -W ignore -m unittest discover -s source/testing # 239 tests; Bubblewrap tests skip without it
python3 benchmarks/benchmark.py offline # deterministic tools, no model
python3 benchmarks/benchmark.py live --repository /path/to/repository --cold # A-G against your Ollama
live uses only temporary fixtures except benchmark D, which is read-only and checks the repository is unchanged afterwards.
Results are written to benchmarks/results/. See resources/documentation/RESULTS.md for what was and was not run.
More: README.md, NOTICE.md, ARCHITECTURE.md, SECURITY.md, RESEARCH.md, RESULTS.md (all in resources/documentation/), CHANGELOG.md.
bash install.sh # install or upgrade
bash install.sh --dry-run # show every step first
bash install.sh --uninstall # program to the Trash, settings and sessions kept
bash install.sh --uninstall --purge # settings, sessions, logs and backups to the Trash too
Uninstalling never deletes: everything goes through gio trash and can be restored from the Trash.
Without gio it stops with an error instead.
The installer is user-level (no root). It backs up an existing install to
~/.local/share/ada/backup/<timestamp>/, installs the executable to ~/.local/bin/ada,
the library to ~/.local/share/ada/library/, the manual page to ~/.local/share/man/man1/ada.1 (man ada), installs missing configuration defaults to ~/.config/ada/,
and never overwrites existing configuration (a changed default is saved beside yours as <name>.default).
The previous library directory is moved into that backup, so removed modules never linger. Your Bash ada function, Ollama and
models are not touched.
Requirements: Python 3.10+ (Debian 12 ships 3.11), git, Bubblewrap (sudo apt install bubblewrap),
Ollama. Without Bubblewrap everything works except shell/verify of external commands, which
refuse to run (fail closed).