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_modelwalks 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) andreview(independent verification) as tools — one coherent thread, specialists when they earn their keep. - Session isolation.
/isolateruns the session in its own git worktree;/reviewshows the diff,/mergeor/discardends it. Auto-checkpoints before every edit;/undorestores. - 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./goodand/badtrain it. - Cost you can see. Every response closes with that turn's tokens
and dollar cost (
freeon free tiers)./costhas session totals. - MCP out of the box. Connect Linear, Sentry, Postgres,
Playwright, or any MCP server;
/mcplists what's live. - Goal mode.
/goal make all tests passkeeps 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-proandnemotron-super-49bhold 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):defaultasks for writes and shell;accept-editsauto-approves in-project edits;planis read-only;yoloapproves everything except your deny rules. - Rules live in
.loom/settings.toml— glob-basedallow/ask/denyper tool (e.g.deny = ["edit(*.env)"]). Deny always wins, even in yolo. - Sandbox:
--sandboxruns 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file loom_code-0.3.3.tar.gz.
File metadata
- Download URL: loom_code-0.3.3.tar.gz
- Upload date:
- Size: 363.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f1f8c75ac6a563719d2cfa6136f76f5a0b8280f091f3e82cff165b92712a759
|
|
| MD5 |
1a21f10d9429e722d7d906cbfc15955c
|
|
| BLAKE2b-256 |
d8116478382ea772354440124a09cba34e86f245fe0fc250d3af974fd4b3ec88
|
Provenance
The following attestation bundles were made for loom_code-0.3.3.tar.gz:
Publisher:
release.yml on Anurich/loomflow-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loom_code-0.3.3.tar.gz -
Subject digest:
3f1f8c75ac6a563719d2cfa6136f76f5a0b8280f091f3e82cff165b92712a759 - Sigstore transparency entry: 2082505338
- Sigstore integration time:
-
Permalink:
Anurich/loomflow-cli@13ea2b7dbe6fd393eb2d4fe4d01f9317163d8344 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/Anurich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@13ea2b7dbe6fd393eb2d4fe4d01f9317163d8344 -
Trigger Event:
push
-
Statement type:
File details
Details for the file loom_code-0.3.3-py3-none-any.whl.
File metadata
- Download URL: loom_code-0.3.3-py3-none-any.whl
- Upload date:
- Size: 315.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
665abbf12d53ae77cbdf940575fde91735a7de3e2a4130304ad46f387418c7db
|
|
| MD5 |
33c170f5efdfc3781e371efd9216f444
|
|
| BLAKE2b-256 |
9b5f1f68ff04ed7703839132a7c1257cec78856f601ab39648aa29920464d280
|
Provenance
The following attestation bundles were made for loom_code-0.3.3-py3-none-any.whl:
Publisher:
release.yml on Anurich/loomflow-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
loom_code-0.3.3-py3-none-any.whl -
Subject digest:
665abbf12d53ae77cbdf940575fde91735a7de3e2a4130304ad46f387418c7db - Sigstore transparency entry: 2082505356
- Sigstore integration time:
-
Permalink:
Anurich/loomflow-cli@13ea2b7dbe6fd393eb2d4fe4d01f9317163d8344 -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/Anurich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@13ea2b7dbe6fd393eb2d4fe4d01f9317163d8344 -
Trigger Event:
push
-
Statement type: