Skip to main content

CodeLoop

CodeLoop

Provider-agnostic terminal coding agent — point it at a JSON file, not a vendor SDK.

PyPI Python Tests License Stars


Documentation: https://dotflow-io.github.io/pycodeloop/

Source Code: https://github.com/dotflow-io/pycodeloop


CodeLoop is a terminal coding agent, in the shape of Claude Code, Codex, or Gemini CLI — except it isn't tied to any one of them. Point it at a plain JSON config and give it a prompt: it drives a tool-use loop (read, write, edit, grep, bash, git, web fetch) against your codebase until the task is done, streaming its reasoning to your shell the whole way.

The key features are:

  • Provider-agnostic: Anthropic, OpenAI, Ollama, LM Studio, or any OpenAI-compatible endpoint — swapping models means swapping a JSON file, never touching code. GenericProvider talks HTTP directly, no vendor SDK required.
  • Fast to start: one pip install, one JSON file, one prompt. No boilerplate, no framework to learn first.
  • Safe by default: every write, edit, delete, shell command, commit, or HTTP call shows a diff or command preview and waits for your OK before running.
  • Full-screen chat: bare pycodeloop drops you into a Textual-based terminal UI; pycodeloop run stays scriptable for CI and one-shot use.
  • Skills-aware: auto-discovers SKILL.md/CLAUDE.md, .cursorrules, and AGENTS.md files already on disk and hands them to the agent.
  • MCP-ready: connect any Model Context Protocol server over stdio with one flag; its tools show up alongside the built-in ones.
  • Sessions that persist: conversations survive process restarts and can be resumed from a menu.
  • Also a library: embed the same agent loop in your own app — see the docs for the Config, Agent, and Tool APIs.
  • Editor integration: a VS Code extension (vscode-extension/) puts the same agent in a sidebar panel.

Requirements

Python 3.10+

Installation

pip install pycodeloop

Example

Set your key and point at a ready-made provider template:

export ANTHROPIC_API_KEY=sk-ant-...
pycodeloop run "list the files in this repo and summarize the project" \
  --provider templates/anthropic.json

Or drop into the full-screen chat instead of one-shot mode:

pycodeloop --provider templates/anthropic.json

Set it once as the default so you stop passing --provider every time:

export PYCODELOOP_PROVIDER=templates/anthropic.json
pycodeloop

Switch providers

Every backend is the same JSON shape — templates/ ships one per vendor:

pycodeloop run "..." --provider templates/anthropic.json   # Claude
pycodeloop run "..." --provider templates/openai.json      # GPT
pycodeloop run "..." --provider templates/ollama.json      # local, no key needed
pycodeloop run "..." --provider templates/lmstudio.json    # local, no key needed

Point it at any OpenAI-compatible HTTP endpoint by writing your own JSON — see docs/examples/provider.example.json and the JSON provider guide. No Python required to add a new backend.

More CLI flags

# Override provider/model per invocation
pycodeloop run "..." --provider templates/openai.json --model gpt-5

# Skip confirmation prompts for dangerous tools
pycodeloop run "..." --yes

# Connect an MCP server, one flag per server
pycodeloop run "list every allowed directory" \
  --mcp "npx -y @modelcontextprotocol/server-filesystem ."

# Skip skills auto-discovery
pycodeloop run "..." --no-skills

The CLI streams the model's text as it arrives, reports token usage after every turn, and caches discovered skills in ~/.pycodeloop/config.json until something changes (--skills-refresh bypasses that).

Tools

Ships with the actions an agent needs to actually change code:

Tool Purpose
read_file Read a file, optionally a line range
write_file Create or overwrite a file
edit_file Replace an exact substring in a file
delete_file Delete a file
list_dir List a directory
glob Find files matching a glob pattern
grep Regex search across files
bash Run a shell command with a timeout
web_fetch Fetch a URL and extract its text
http_request Call a JSON HTTP API — any method, headers, body
git_status Show the working tree status
git_diff Show unstaged or staged changes
git_log Show recent commit history
git_commit Stage and commit changes
env Read environment variables (secrets masked)
todo Track a checklist across turns in a session

write_file, edit_file, delete_file, bash, git_commit, http_request, and every MCP tool are marked dangerous and gated behind confirmation.

Commit Style

Icon Type Description
⚙️ FEATURE New feature
📝 PEP8 Formatting fixes following PEP8
📌 ISSUE Reference to issue
🪲 BUG Bug fix
📘 DOCS Documentation changes
📦 PyPI PyPI releases
❤️️ TEST Automated tests
⬆️ CI/CD Changes in continuous integration/delivery
⚠️ SECURITY Security improvements

License

This project is licensed under the terms of the MIT License.

Metadata

Release files for pycodeloop 0.2.1

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

Source distribution (sdist)

Source distribution for pycodeloop 0.2.1
File Size Uploaded Provenance Actions
pycodeloop-0.2.1.tar.gz 48.5 kB With provenance Details for pycodeloop-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pycodeloop 0.2.1
File Interpreter ABI Platform Actions
pycodeloop-0.2.1-py3-none-any.whl Python 3 none any Details for pycodeloop-0.2.1-py3-none-any.whl

Total release size: 118.1 kB

Release files / pycodeloop-0.2.1.tar.gz

Download URL pycodeloop-0.2.1.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
26388d2cce7796dbd4fbe1d869daf54d2b8fd7bc19ca176379215a92e5da51f9
BLAKE2b-256 checksum
How to use checksums
047c05ae91a888f688e4270b7ba78f7f9faefe770befdf6559486d7df031b5a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 13, 2026.

Transparency log

Release files / pycodeloop-0.2.1-py3-none-any.whl

Download URL pycodeloop-0.2.1-py3-none-any.whl
Size 69.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ccf764bc360e0a29901e7cfd68dd9ef42c8ded3918d87ed3b99c374f8fe7403
BLAKE2b-256 checksum
How to use checksums
7cd16f7b4d1432248f5da302ccf12a996d2f3c5f3d6adb73e38a2c65df1ff1a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 13, 2026.

Transparency log

Security for pycodeloop 0.2.1

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pycodeloop-0.2.1.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 Aug 13, 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