loop_

Terminal coding agent.Bring your own model.

$ curl -fsSL https://raw.githubusercontent.com/notshekhar/loop/main/install.sh | bash

Prebuilt binaries, no Node required. Then loop login and loop. Full walkthrough in the docs.

── Sessions are trees

/treefold · filter · search · bookmark
refactor auth to use sessions
├─ Read src/auth/session.ts
├─ Edit src/auth/session.ts
├─ Bash bun test 712 pass
├─ fork "what if we move to postgres?"
│ ├─ Edit src/db/schema.ts
│ └─ abandoned · 12 messages summarized back into context
└─ fork "keep sqlite, add WAL" ← leaf
├─ Edit src/db/sqlite.ts
└─ Bash bun test 712 pass

Every entry has a parent, so a session is a tree rather than a transcript. Branch from any earlier message and keep both paths — when you leave a branch, loop offers to summarize it back so its context survives the switch.

── Background tasks

A background task is tied to a directory and runs headless, detached from your session. /background is the manager: add, edit, run now, or hand it to the scheduler.

/backgroundon demand · once · cron
/background + add background task…
├─ on demand no schedule — run it when you say so
├─ once 10m · 18:30 · 2026-06-15 09:00
└─ cron 0 9 * * 1-5 (weekdays at 9:00)

Scheduled tasks run on an OS timer — launchd, systemd, or Task Scheduler — so they fire even when loop is closed. From scripts, loop background (alias loop goals) does the same.

── Goal mode

Different thing: /goal drives the current session autonomously until an adversarial verifier agrees the objective is actually met.

/goalplan → continue → verify
/goal ship the auth refactor
├─ planner writes a frozen plan — no plan, no goal
├─ turn objective runs with the goal rules injected
├─ continue unchecked plan boxes → next directive
└─ verifier read-only audit of the workspace
└─ clean verdict → done · refuted → gaps feed the next turn

Esc pauses; pick it back up with /goal resume. Step caps and stalls auto-pause instead of burning tokens forever.

── Agents & subagents

built-ins
default with the full toolset, plan as a read-only investigator, and data-analyst for SQL-first work via /datasource. Tab on an empty prompt cycles them.
your own
Build one with /agents — custom system prompt, tool allowlist, optional pinned model. It registers as /<name> for one-shot use.
plans ship
The plan agent treats a plan as a deliverable. When it's final the agent calls the plan tool, which ends the turn and renders the plan as markdown. Then you either hand it to an agent to implement, or keep refining it.
subagents
The task tool forks the current agent into a fresh context window. Activity streams live in the task box; only the final report enters your context.

── What else

models
One TUI, many models. Switch with /model, pin per-agent models with /scoped-models, tune reasoning with /thinking.
hooks
Your existing ~/.claude hooks and plugins load as-is. Claude Code-compatible lifecycle hooks, so switching costs you nothing.
extend
MCP servers over stdio and http/sse with OAuth included, plus a JS extension system for custom tools, providers, and middleware.
scripting
One-shot with loop run "...", pipe from stdin, cap work with --max-steps, or drive it over JSON-RPC.
context
/compact summarizes, /context shows what's loaded, /memory keeps durable facts, and queued messages run after the current turn.

── Commands

loop helpcli
loop interactive TUI
loop run "explain this repo" one-shot
loop login [provider] auth
loop sessions list sessions in cwd
loop background <cmd> list, add, rm, run, daemon
loop mcp <cmd> add, list, remove, login
loop models list the catalog
loop cost audit verify the cost ledger
loop upgrade self-update
loop rpc [--socket] JSON-RPC
sessions
/new /resume /session /name /export /share /compact /context
tree
/tree /fork /clone
models
/model /provider /thinking /scoped-models
automation
/background /goal /daemon /reminder /timer /recap
setup
/login /settings /mcp /extensions /hooks /bashdeny /doctor

── Providers

  • xAI · Grok
  • Anthropic
  • OpenAI
  • Google Gemini
  • OpenRouter
  • Vercel AI Gateway
  • GitHub Copilot
  • AWS Bedrock
  • DeepSeek
  • Mistral
  • GLM
  • Z.AI
  • Groq
  • Cerebras
  • ZenMux
  • Ollama · local
  • Any OpenAI/Anthropic/Google-compatible gateway

Bring your own key, sign in with OAuth, or point loop at a custom gateway like Bifrost or LiteLLM. Six auth methods: API key, bearer token, OAuth/SSO, environment variable, key-helper command, or headers only. Bedrock and Ollama are auto-detected.

subscriptions
Already pay for SuperGrok? Sign in with it. loop login xai runs an OAuth flow straight into your xAI plan — no API key to paste, no per-token bill. Grok is the default model (xai/grok-build-0.1).
copilot
A GitHub Copilot subscription works the same way — loop login github-copilot uses the device flow and bills against your existing plan.
local
Or pay nothing: loop auto-detects a running Ollama daemon and uses your local models.

── Coming from Gemini CLI

Gemini CLI stopped serving individual accounts on 18 June 2026, and its replacement is closed source.

loop is open source, installs in one command, and still runs Gemini models with your own API key — alongside Grok, Claude, GPT-5, local Ollama models, and anything else you already pay for.

Install it in one line.

Prebuilt binaries for darwin-x64, darwin-arm64, linux-x64, linux-arm64, and windows-x64. No Node, no build step.

$ curl -fsSL https://raw.githubusercontent.com/notshekhar/loop/main/install.sh | bash

MIT licensed. Built on top of pi — the TUI renderer is an in-repo fork of pi-mono's pi-tui, and the message renderers, theme engine, session tree, and skills loader are ports of pi-mono's components.

docs · github.com/notshekhar/loop