OneLoop

A tiny coding agent.
One loop, multiple models, six tools, zero config.

core idea

One Agent Loop

Think → call tools → feed results back → repeat.
No plugins, no hooks, no middleware.

User prompt
Model thinks
Tool calls
Model thinks
Response

Loops until the model stops calling tools. All calls in a single turn run in parallel.

orchestration

Multi-Model

Route to any provider. Run consensus or debate across models. A judge synthesizes the final answer.

safety

Evidence Agent

Orchestrated providers never get direct tool access.
They ask the main agent for context. Cached, shared, deduplicated.

principles
1

Keep the core tiny

One loop. Few durable primitives.
Avoid frameworks inside the framework.

principles
2

Prefer evidence over confidence

If context is needed, gather it. Do not guess.

principles
3

The main agent owns safety

Orchestrated providers ask for evidence.
They do not get direct tool access.

principles
4

Default to readable systems

Simple files, explicit flows, minimal magic.

principles
5

Optimize for the terminal

Fast feedback, clear output, no hidden state.

principles
6

One control knob

Prefer one env var or one directive
over a matrix of settings.

principles
7

Cache and share

Gathered evidence is deduplicated and shared.
Never fetch the same thing twice.

principles
8

Graceful degradation

When something fails, return a clear error. Never panic.

tools

Six tools

read File contents
write Create or overwrite
edit Search-and-replace
bash Shell commands
web_search SearXNG search
skill Load a playbook on demand
skills

Skills

Markdown playbooks the model loads on demand.
Not in the system prompt — pulled in only when needed.

~/.oneloop/skills/code-review.md
.oneloop/skills/changelog.md
.oneloop/skills/migration.md

The model sees names + descriptions at startup.
It calls skill("name") when the task matches — no user action needed.

syntax

Directive syntax

#!directive words#! your message here

Single provider
#!openrouter#! review this code

Model override
#!openrouter model:deepseek/deepseek-v3-0324#! refactor this

Consensus
#!anthropic openai#! should we use X?

Debate + judge
#!debate anthropic openai rounds:2 judge:anthropic#! argue this

how it works

Evidence flow

Provider calls
request_evidence
Main agent
checks cache
Execute read,
search, or shell
Cache & return

Same query = cached result. Shared across all providers.
Shell commands are read-only only (find, grep, git log).

reliability

Append-only sessions

Every message, tool call, and result is appended to a JSONL file.
No mutation, no corruption.

.oneloop/sessions/2025-07-11.jsonl
.oneloop/sessions/2025-07-11-001.jsonl
reliability

Auto-compaction

When context nears the model's limit, the agent compacts:
generates a summary, rotates to a new session,
replays recent user messages verbatim.

Triggered at 85% of context window.

A second cheap call distils the summary into memory.md
durable facts that survive across sessions.

reliability

Resilience

Retry with fallbackRetries 3×, then offers alternative providers
Parallel toolsMultiple calls execute concurrently
Output truncationLarge outputs trimmed before re-entering context
Stop anywhereCtrl+C stops cleanly; session preserved
AGENTS.mdLoaded as system prompt if present
memory.mdDurable facts appended at compaction, loaded at startup
skills/Playbooks loaded on demand via the skill tool
stats

Codebase

LanguageFilesLines
Rust254,542
HTML1550
Markdown3349
Total295,441
get started

Quick start

# 1. Add credentials
./ol login openrouter

# 2. Interactive REPL
./ol

# One-shot
./ol "explain this codebase"

# Pipe into it
git diff | ./ol "summarise these changes"