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
The package is published on PyPI as recodeai. Install it with pip:
pip install recodeai
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:
- Read the relevant file(s)
- Reason about the change needed
- Write the updated content back to disk
- 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
recodecan 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 withgit checkout.- Never commit your
.envfile 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. Source: https://github.com/arobaseSuulei/recode-ai
Cite recode
If you use recode in your own work or writing, please cite it using the following BibTeX entry.
@Misc{recode,
title = {`recode`: a lightweight, hackable coding agent CLI built with smolagents.},
author = {Souleymane},
howpublished = {\url{https://github.com/arobaseSuulei/recode-ai}},
year = {2026}
}
License
2026 - @4ssulei on X
Metadata
Release files for recodeai 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| recodeai-0.1.1.tar.gz | 4.9 kB | Without provenance | Details for recodeai-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| recodeai-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for recodeai-0.1.1-py3-none-any.whl |
Total release size: 10.5 kB
Release files / recodeai-0.1.1.tar.gz
| Download URL | recodeai-0.1.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58c73fd70c0d3e11c135722c792d5f7cb5bc93aba57c3ac3b8a6cf77f8e70d4f
|
|
BLAKE2b-256 checksum How to use checksums |
6e19e261e17f345ddd81d6e21a20e04d657eb744ec50d4816b0a6610b8d3915f
|
| 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.1-py3-none-any.whl
| Download URL | recodeai-0.1.1-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99e07e6fd9fa71192d2ad3d4859b20a85a35b77e960abebf283c21753af45d75
|
|
BLAKE2b-256 checksum How to use checksums |
f7de918b6e3779a0a8e91411a5649cdefbb2ac93371e0337cccd61712b74d426
|
| 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.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.
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.