agent7
The simplest coding agent. ~1500 lines of Python, four tools, one loop.
No orchestration: no plan mode, no subagents, no parallel tasks, no background jobs. You give it one sentence; it reads files, edits files, runs commands, then stops. Built for people who work on one thing at a time — you hold one task in your head, and so does it.
agent7/ 1482 lines
__main__.py 434 CLI + REPL + @path completion + session wiring
agent.py 398 tools + agent loop + compaction
commands.py 236 slash commands + model switching
providers.py 161 API key auth
store.py 149 atomic JSON session snapshots
session.py 101 session state
__init__.py 3 version
Install
pip install agent7
# or: uv tool install agent7
# or from source: uv sync && uv run agent7
Auth
Paste an API key; there is no OAuth. Keys are stored in ~/.config/agent7/auth.json.
export DEEPSEEK_API_KEY=sk-...
# export KIMI_API_KEY=...
# export MOONSHOT_API_KEY=sk-...
# export AGENT7_MODEL=deepseek-flash
You can also log in from inside the REPL:
/login deepseek
/login kimi # optional: /login kimi global
/login moonshot
/model # list models for every logged-in provider
/model deepseek-flash
Usage
uv run agent7 "create hello.py that prints hi" # one-shot
uv run agent7 # new REPL session
uv run agent7 -r # resume latest session in this cwd
uv run agent7 -r <session-id> # resume a specific session
uv run agent7 session -l # list this cwd's sessions
uv run agent7 session "fix authentication" # new named REPL session
Sessions are saved automatically after tasks, commands, interruptions, and exit.
agent7 session -l prints tab-separated ID, NAME, and PATH columns and needs no login.
Snapshots contain resumable model context, not a separate full transcript; compaction is reflected
in the saved context. Files live in ${XDG_STATE_HOME:-~/.local/state}/agent7/sessions/ and do not
store API keys. Hard process kills can lose the in-progress turn.
REPL commands: /help /model /status /login /logout /compact.
Exit with an empty line or Ctrl-D.
Type @ in the REPL to recursively complete files and directories from the cwd:
fix @agent7/agent.py.
Tab accepts, directories keep going (@agent7/ → @agent7/session.py), and spaces
are escaped (@my\ file.txt), so the path the model sees is the path it can read.
--cwd sets the working directory, --max-turns caps the loop (default 30 turns;
when it runs out you get # (stopped after N turns)). A run that ends with no visible
text never ends silently: you get either # (stopped after N turns),
# no text in the reply … or # … hit the output token limit ….
Tools
| Tool | What it does | Output budget |
|---|---|---|
read |
Read a file with line numbers | 200 lines per call by default; page with offset= |
write |
Create or overwrite a whole file | +N -M diff stats |
edit |
Precise replacements; one call may include multiple edits[] against the original file (no overlaps) |
+N -M diff stats |
bash |
Host shell in the cwd (bash / PowerShell / cmd) | ~12k chars |
That's it. No grep, no list_dir, no todo, no task.
Need more capability? Let the agent use bash.
On startup agent7 picks a shell from sys.platform: Git Bash → PowerShell → cmd on
Windows, bash elsewhere. The choice is written into the system prompt so the model
matches the host. Override with AGENT7_SHELL=bash|powershell|cmd|/path/to/shell.
Tools run serially, one after another — so the log always reads in order and you never get three outputs interleaved. Edits are applied without a confirmation prompt; you just get a one-line diff stat.
Context
At 75% context usage, old tool/assistant text is compacted automatically: the last
3 user turns are kept, or for one-shot tasks the last 4 tool results. /compact
triggers the same compaction manually.
AGENT7_CONTEXT_LIMIT overrides the context limit.
What it is not
- Not an orchestrator: no branching, no subagents
- Not a parallel framework: single-threaded, one thing at a time
- Not a background service: a foreground process, stopped with Ctrl-C
- No sandbox: tools run as you, and
bashcan do anything your account can do
If that kind of "small" is exactly what you want, this is enough. If it's missing the abstraction you had in mind, that omission is probably the point — not an oversight.
Metadata
Release files for agent7 0.1.2
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 |
|---|---|---|---|---|
| agent7-0.1.2.tar.gz | 22.5 kB | With provenance | Details for agent7-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent7-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for agent7-0.1.2-py3-none-any.whl |
Total release size: 48.9 kB
Release files / agent7-0.1.2.tar.gz
| Download URL | agent7-0.1.2.tar.gz |
|---|---|
| Size | 22.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d5ace3f3611e00a4d7f474336904856efd11ce35c5f99438fee8e07ca1c8fa65
|
|
BLAKE2b-256 checksum How to use checksums |
aa22b7f2d69a38c6a246ada722ef05a4994d116b5e32615ecd0ff31dc44a0d6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 3, 2026.
Transparency logRelease files / agent7-0.1.2-py3-none-any.whl
| Download URL | agent7-0.1.2-py3-none-any.whl |
|---|---|
| Size | 26.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d51b12f1a8b5d0e806e8ef78a611c88c4ea38f38b31eab1d8e6c13a2e33a0c27
|
|
BLAKE2b-256 checksum How to use checksums |
ad90d3d7796dd13ca9f35cae9e243eadb030b91b566acfd7ed422ef461761105
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 3, 2026.
Transparency logSecurity for agent7 0.1.2
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for agent7-0.1.2.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 Nov 3, 2026.
Transparency logA 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.