npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

closed-loop-cli

v1.1.1

Published

Self-Developing Multi-Agent CLI Coding Assistant

Readme

closed-loop-cli

A self-developing, multi-agent CLI coding assistant. It runs an agentic read → act → verify loop over your codebase using file, search, and shell tools, and works with any Anthropic-compatible endpoint — Anthropic itself, or a gateway/proxy serving another model (OpenRouter, LiteLLM, MiMo Token Plan, a local proxy, …).

Status: early/alpha. The core loop, tooling, permission system, and multi-model support work; expect rough edges.

Features

  • Agentic loop with file read/write/edit, directory listing, grep, a local AST code index, web search, and sandboxed shell execution.
  • Read-before-edit safety — a file must be read before it can be edited, and edits are rejected if the file changed on disk since it was read.
  • Permission systemdefault / acceptEdits / plan / yolo modes with per-session "always allow" choices, on top of hard safety rules (RuleZ).
  • Parallel tools — independent read-only tool calls run concurrently.
  • Subagents — delegate self-contained sub-tasks to a fresh context.
  • Automatic context compaction — long histories are summarized to stay in budget.
  • Adaptive output budget and retry with backoff on transient API errors.
  • Model-agnostic — works with any Anthropic-compatible model/endpoint via standard Claude Code environment variables; not tied to any single provider.
  • Polished interactive REPL — clean banner, Markdown-rendered answers, concise progress (no wall of logs), multi-line paste, in-line cursor editing (←/→/Home/End/Delete), and ↑/↓ command history.
  • Runs in your project folder — like claude, it operates in the directory you launch it from and creates files there.

Install

npm install -g closed-loop-cli

Or run without installing:

npx closed-loop-cli

Quick start

Set credentials (the CLI also prompts for and saves a key to ~/.closed-loop.json if none is found):

export ANTHROPIC_API_KEY="sk-ant-..."
closed-loop

With no model configured it defaults to claude-haiku-4-5, so a standard Anthropic key works out of the box. The CLI operates in your current working directorycd into a project (or an empty folder) and run closed-loop there. Type your task at the prompt; paste multi-line prompts freely (they submit only on Enter); ↑/↓ recall history; type help, clear, or exit.

Configuration (environment variables)

Model selection follows the same conventions as Claude Code, so an existing Claude Code shell setup works unchanged.

| Variable | Purpose | | --- | --- | | ANTHROPIC_API_KEY / ANTHROPIC_AUTH_TOKEN | Credentials | | ANTHROPIC_BASE_URL | Point at any Anthropic-compatible endpoint | | ANTHROPIC_MODEL | Main model (also falls back to ANTHROPIC_DEFAULT_OPUS_MODEL, then ANTHROPIC_DEFAULT_SONNET_MODEL) | | CLAUDE_CODE_SUBAGENT_MODEL | Subagent model (also falls back to ANTHROPIC_DEFAULT_HAIKU_MODEL) | | ANTHROPIC_MAX_TOKENS | Override output token budget | | CLAUDE_CODE_EFFORT_LEVEL | max / ultracode raises step + token budget | | CLOSED_LOOP_PERMISSION_MODE | default / acceptEdits / plan / yolo | | CONTEXT_COMPACT_THRESHOLD_TOKENS | When to summarize history (default 120000) | | CONTEXT_KEEP_RECENT_MESSAGES | Recent messages kept verbatim on compaction |

Works with any model

The CLI talks to whatever ANTHROPIC_BASE_URL + model you configure — Anthropic directly, or any Anthropic-compatible gateway (OpenRouter, LiteLLM, a local proxy, MiMo Token Plan, …). To use Anthropic, just set ANTHROPIC_API_KEY. To use any other provider, point ANTHROPIC_BASE_URL at its compatible endpoint and set the model id. No code changes required.

Example: a non-Claude provider (MiMo Token Plan)

# Anthropic-compatibility endpoint + token
$env:ANTHROPIC_BASE_URL   = "https://token-plan-sgp.xiaomimimo.com/anthropic"
$env:ANTHROPIC_AUTH_TOKEN = "tp-...your-token..."

# Main model. mimo-v2.5-pro has a 1M context window natively.
$env:ANTHROPIC_MODEL              = "mimo-v2.5-pro"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = "mimo-v2.5-pro"

# Cheaper model for subagents (mimo-v2.5 is a deep-thinking, lower-cost model)
$env:CLAUDE_CODE_SUBAGENT_MODEL    = "mimo-v2.5"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "mimo-v2.5"

$env:CLAUDE_CODE_EFFORT_LEVEL = "max"

closed-loop

Note on the [1m] suffix: Claude Code uses a model[1m] notation to opt into a 1M-context beta. That suffix is not part of the model id a raw API accepts, so the CLI strips any trailing [...] automatically — a pasted Claude Code config like mimo-v2.5-pro[1m] works, and resolves to mimo-v2.5-pro.

CLI flags

| Flag | Effect | | --- | --- | | --plan | Read-only; no edits or commands | | --accept-edits | Auto-approve file edits (commands still prompt) | | --yolo | Auto-approve everything (RuleZ hard rules still apply) | | -e, --effort <standard\|ultracode\|max> | Reasoning/step budget | | --codeact / --openhands | CodeAct-style coder profile | | --dashboard | Launch the monitoring dashboard server | | --telegram | Run the Telegram ChatOps bot |

Equivalent npm scripts when running from source: npm start, npm run dashboard, npm run telegram, npm run dgm.

Permission modes

  • default — read-only tools run automatically; file edits and shell commands ask for confirmation (with an "always allow" option for the session).
  • acceptEdits — file edits auto-run; shell commands still ask.
  • plan — read-only only; mutating tools are denied.
  • yolo — everything auto-runs. Use with care.

In a non-interactive session, actions that would prompt are denied unless the mode auto-approves them (acceptEdits / yolo).

Build from source

git clone <repo>
cd closed-loop
npm install
npm run build
npm start

Requires Node.js 18+ and a TypeScript toolchain (installed via devDependencies).

License

See repository.