Skip to main content

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.

Steer while it works — the input box stays live during a turn. Type guidance and press Enter and it's injected into the running turn before the model's next step (tagged steering ↳ in the conversation). Press Esc to interrupt the turn entirely; context is kept, so you can redirect.

Paste or drop images — Ctrl-V grabs an image straight off your clipboard (screenshots!), and drag-and-drop works too: drop an image file onto the terminal and its path is auto-attached. Either way an [image-N] placeholder lands in the box and the image rides along to the model with your next message (vision-capable models: Claude, GPT-4.1, …).

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.

Metadata

Release files for loom-code 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loom-code 0.4.3
File Size Uploaded Provenance
loom_code-0.4.3.tar.gz 373.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for loom-code 0.4.3
File Interpreter ABI Platform
loom_code-0.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 695.2 kB

Release files / loom_code-0.4.3.tar.gz

Download URL loom_code-0.4.3.tar.gz
Size 373.3 kB
Tags Source
SHA-256 checksum
How to use checksums
798bb2d639296d4170e65ff01088f698f2ed2a829bf5b9cd23030868c612cf81
BLAKE2b-256 checksum
How to use checksums
074f8e0be803f9f9505fcb314f5b0cf71a82082a91e7a9b155c6e13a55fff845
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

Release files / loom_code-0.4.3-py3-none-any.whl

Download URL loom_code-0.4.3-py3-none-any.whl
Size 321.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
800f42a3e30528b02e8bc24e2ed6d5c8dfbde2407d51b4bd51751b085eec2f08
BLAKE2b-256 checksum
How to use checksums
819a92de749c48b5f20fe77509acb24312d453a7e0b57980754aac88bd14e63d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

Security for loom-code 0.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for loom_code-0.4.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page