Skip to main content

recode

recode is a lightweight, open-source coding agent you run from your terminal. It reads and edits files in your current project directory, using an LLM (via smolagents) to reason about the task and act through a small set of tools.

Think of it as a minimal, hackable alternative to tools like Cursor's agent mode — built to be understood, not just used.

Features

  • Read & write files in your project directly from natural language instructions
  • Persistent memory — the agent can remember facts across a session
  • Sandboxed by design — the agent can only read/write inside the directory you run it from, never outside of it
  • Runs anywhere — install once, use it in any project folder
  • Built on smolagents' CodeAgent, meaning the LLM reasons by writing and executing real Python code, not by producing brittle JSON blobs

Installation

recode is distributed via GitHub and installed with pipx, which keeps it isolated while making it available as a global command.

# install pipx if you don't have it
brew install pipx
pipx ensurepath

# install recode
pipx install git+https://github.com/arobaseSuulei/recode-ai.git

Once installed, the recode command is available in any terminal, from any directory.

Configuration

recode needs an OpenAI API key to function. It reads it from the OPENAI_API_KEY environment variable — your key is never stored, bundled, or transmitted anywhere by this project.

export OPENAI_API_KEY=your_key_here

Add this line to your shell profile (~/.zshrc, ~/.bashrc, etc.) to avoid retyping it every session.

Usage

Navigate to the project you want the agent to work on, then run:

cd ~/my-project
recode

You'll get an interactive prompt:

-- Recode.ai, What are we going to build chief --
> add docstrings to every function in utils.py

The agent will:

  1. Read the relevant file(s)
  2. Reason about the change needed
  3. Write the updated content back to disk
  4. Report back what it did

Type exit or quit to leave the session.

Example

> create a function that subtracts two numbers and save it in math_utils.py
> read main.py and add a comment on every line

How it works

recode follows the ReAct pattern (Reasoning + Acting), the same loop used by most modern coding agents:

Thought → Action → Observation → Thought → Action → ... → Final Answer

Instead of asking the LLM to produce JSON instructions, recode uses smolagents' Code Agent approach: the model writes real, executable Python code to call tools, which tends to be more reliable and expressive than JSON-based tool calling.

Available tools

Tool Description
read_file Reads the content of a file in the current workspace
writing_code Writes or overwrites a file in the current workspace
remember Stores a fact for later recall during the session

All file operations are restricted to the directory you launched recode from — the agent cannot read or write anywhere else on your system.

Project structure

recode-ai/
├── src/
│   └── recode/
│       ├── agent.py     # model + tools + agent assembly
│       ├── cli.py       # command-line entry point
│       └── tools/
│           ├── files.py   # read_file, writing_code
│           └── memory.py  # remember
├── pyproject.toml
└── README.md

Safety notes

  • recode can overwrite files without asking for confirmation. Use it inside a git repository, and commit your work before running the agent on real code, so you can always roll back with git checkout.
  • Never commit your .env file or API keys to version control.

Contributing

This project is open source and meant to be a learning resource as much as a tool — issues, questions, and pull requests are welcome.

License

MIT

Metadata

Release files for recodeai 0.1.0

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

Source distribution (sdist)

Source distribution for recodeai 0.1.0
File Size Uploaded Provenance Actions
recodeai-0.1.0.tar.gz 4.8 kB Without provenance Details for recodeai-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 10.4 kB

Release files / recodeai-0.1.0.tar.gz

Download URL recodeai-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6a8db1814c9d987f4f2d308f71c4dde01f9386181ec4b506fba686179b80b824
BLAKE2b-256 checksum
How to use checksums
d44dd4b0a17c9e500c8f3ff161a4c9949a97446539bfb044c4eea7abaf21928d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / recodeai-0.1.0-py3-none-any.whl

Download URL recodeai-0.1.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a0af998b25365ef844d2cbd8ab10b058afd9f4a56af24a5cf92d8cb88819186
BLAKE2b-256 checksum
How to use checksums
104d96a89b8530c0744e3f1367aeb486ce4c48f2b85a6fc63cf7ed314849c6c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for recodeai 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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