Skip to main content

loom-code — a loomflow-native terminal coding agent

Project description

loom-code

A terminal coding agent built on loomflow. Plans before it codes, asks before it breaks things, works with any model — including free ones.

›  add a retry decorator to the http client

● loom
Added `retry(max_attempts=3, backoff=2.0)` to http/client.py and wired it
onto get() and post(). Tests pass (14/14).
───────────────────────────────────────────── 12,431 in · 217 out · $0.0043

loom-code is a thin terminal shell — the brain is loomflow. The CLI detects your project, builds a loomflow Agent, streams the run to your terminal, and gates destructive tool calls behind an approval prompt. Everything load-bearing — the agent loop, tools, planning, memory — is loomflow.

Highlights

  • Plans before it codes. Every task gets a living plan (TodoWrite-style), visible as it progresses, hard to drift from.
  • Any model, including free ones. OpenAI, Anthropic, NVIDIA's free NIM tier, local Ollama, or anything LiteLLM routes (Groq, Together, Azure, Bedrock, Vertex…). /set_model walks you through provider → API key → model with arrow-key menus.
  • Claude-Code-style permissions. Reads are lenient, writes are strict. Every write/edit/shell command routes through an approval gate with a unified-diff preview. Allow/ask/deny rules, approval modes (default / accept-edits / plan / yolo), and an optional OS-level bash sandbox (--sandbox).
  • Specialist sub-agents on demand. The main loop can call explore (read-only investigation) and review (independent verification) as tools — one coherent thread, specialists when they earn their keep.
  • Session isolation. /isolate runs the session in its own git worktree; /review shows the diff, /merge or /discard ends it. Auto-checkpoints before every edit; /undo restores.
  • Gets sharper at your repo. A per-project notebook plus episode memory (.loom/) — notes the agent used get credited when a turn goes well, so future runs surface what worked. /good and /bad train it.
  • Cost you can see. Every response closes with that turn's tokens and dollar cost (free on free tiers). /cost has session totals.
  • MCP out of the box. Connect Linear, Sentry, Postgres, Playwright, or any MCP server; /mcp lists what's live.
  • Goal mode. /goal make all tests pass keeps working until the condition is verifiably met.

Install

pipx install loom-code

(pip install loom-code works too; pipx keeps CLI tools in their own venvs. No pipx? brew install pipx or python -m pip install --user pipx.)

Requires Python 3.11+. To update: pipx upgrade loom-code.

Quickstart

cd ~/your-project
loom-code

First run: type /set_model, pick a provider with the arrow keys, paste your API key once (it's saved for future sessions), pick a model. No paid key? Pick NVIDIA — free at build.nvidia.com.

Then just type what you want:

›  fix the failing test in tests/test_auth.py
›  add a /users endpoint with pagination
›  why is startup slow? profile it

One-shot mode (does the task, prints a summary, exits):

loom-code "add a retry decorator to the http client"
loom-code --yes "scaffold a FastAPI backend"   # skip approval prompts

Works on existing code and empty directories alike — scaffolding new projects is a first-class path.

The interface

loom-code runs a full-screen chat UI: the conversation scrolls in a pane, the input box stays pinned at the bottom, and it grows as you type. Enter sends; Alt+Enter adds a newline. Scroll the history with the mouse wheel, PageUp/PageDown, or Ctrl-Up/Down; End jumps back to live. Typing / pops the command menu.

Prefer a plain inline prompt (or on a terminal the full-screen UI doesn't suit)? loom-code --classic. Piped/non-TTY use falls back to classic automatically.

Models

model string provider env key
claude-opus-4-8, claude-sonnet-4-6, … Anthropic ANTHROPIC_API_KEY
gpt-4.1, gpt-4.1-mini, o4-mini, … OpenAI OPENAI_API_KEY
nvidia/… (Nemotron, Llama, DeepSeek) NVIDIA NIM — free tier NVIDIA_NIM_API_KEY
ollama/llama3, ollama/qwen2.5-coder, … local Ollama — free, offline
litellm/<provider>/<model> anything LiteLLM routes provider's own

Switch anytime with /model <name> or the guided /set_model. Reasoning models support /effort low|medium|high.

Tip: tool-heavy agent work needs a model with solid function calling. On the free NVIDIA tier, deepseek-v4-pro and nemotron-super-49b hold up well; tiny models fumble tool calls.

Safety & permissions

The permission layer is the boundary, not the working directory:

  • Reads anywhere are allowed; writes outside the project are only possible for files you referenced, and always show a diff prompt — in every mode, even --yes.
  • Approval modes (/mode): default asks for writes and shell; accept-edits auto-approves in-project edits; plan is read-only; yolo approves everything except your deny rules.
  • Rules live in .loom/settings.toml — glob-based allow / ask / deny per tool (e.g. deny = ["edit(*.env)"]). Deny always wins, even in yolo.
  • Sandbox: --sandbox runs bash under OS-level isolation (writes limited to the repo, network off unless --sandbox-allow-network).
  • Irreversible commands (git push --force, rm -rf, …) always get an explicit prompt.

Commands

Type / in the REPL — the menu autocompletes. Highlights:

/plan show or start the living plan
/goal <condition> work until the condition is met
/undo · /checkpoints restore / list auto-checkpoints
/isolate · /review · /merge · /discard worktree-isolated sessions
/model · /set_model · /effort · /mode model + approval setup
/set_web web search (Serper / DuckDuckGo)
/mcp list connected MCP servers
/cost · /compact · /export session accounting + history
/resume pick up the last session for this project
/good · /bad credit / debit the agent's notes

Project context

loom-code reads LOOM.md / CLAUDE.md / AGENTS.md / .loom/context.md at the project root and treats it as binding house rules. /init-loom creates a starter file.

Development

git clone https://github.com/Anurich/loomflow-cli
cd loomflow-cli
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest -q          # 465 tests
ruff check .

Architecture in one line: loom-code is deliberately thin — if a capability belongs in the agent loop, it goes in loomflow, not here. See DESIGN.md for the boundary.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loom_code-0.3.2.tar.gz (362.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loom_code-0.3.2-py3-none-any.whl (315.0 kB view details)

Uploaded Python 3

File details

Details for the file loom_code-0.3.2.tar.gz.

File metadata

  • Download URL: loom_code-0.3.2.tar.gz
  • Upload date:
  • Size: 362.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loom_code-0.3.2.tar.gz
Algorithm Hash digest
SHA256 de9e13f8b11d391db93c8dcfd3c4bb1305f7beb0c574cc5f24b0fb1ce23aa5b1
MD5 780a2eb6c514c3b26afc47fe720caaf1
BLAKE2b-256 3b63abd82b442009c86edc0d627b51382100e15403b2728d796a3e6ceaba4ce0

See more details on using hashes here.

Provenance

The following attestation bundles were made for loom_code-0.3.2.tar.gz:

Publisher: release.yml on Anurich/loomflow-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file loom_code-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: loom_code-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 315.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loom_code-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2714f520dda83589e337f9a1aaab6b83f87c05703e37310c60f98689782ec440
MD5 bd8cec1a0893f4fe1dd6c7d85c645c4c
BLAKE2b-256 287182e6d0162cdae82ff6cee64ee0fcff2a4ab70ed039e4b57cc29669f32b3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for loom_code-0.3.2-py3-none-any.whl:

Publisher: release.yml on Anurich/loomflow-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page