# AI use cases for Smol (smol-env/smol)

Repo: [smol-env/smol](https://github.com/smol-env/smol) | Use cases: 3 | Page: https://dedupedai.com/use-cases/smol-env-smol/

smol is a deliberately tiny agent loop in Python, with golfed versions in Go, Clojure and PHP, that talks to any OpenAI Responses API compatible endpoint and executes model-requested shell commands.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Understand a full agent loop in one afternoon: https://dedupedai.com/use-cases/smol-env-smol/learn-agent-loop-in-an-afternoon/
- Compare a minimal agent loop in four languages: https://dedupedai.com/use-cases/smol-env-smol/compare-agent-loops-across-languages/
- Use Smol day to day with line editing and history: https://dedupedai.com/use-cases/smol-env-smol/run-smol-with-history-and-line-editing/

## How to understand a full agent loop in one afternoon with Smol

Repo: [smol-env/smol](https://github.com/smol-env/smol) | Difficulty: Beginner | Time: 2 hours | Basis: From the README

Run Smol, a deliberately tiny Python agent with one shell tool, against any Responses API endpoint, then read its code with the README's questions.

**Who it is for:** A developer or student who uses coding agents and wants to understand what actually happens inside one.

**The problem:** Production agents are huge, so it is hard to see the core loop, why context matters and where failures come from.

**The outcome:** A working agent you have read line by line, including retries, context compaction and shell output truncation, and answers to why each choice was made.

### Steps

1. Clone the repo and read Smol.py
2. Run a small local proxy that holds your API key or session and exposes a Responses API endpoint
3. Run `python3 smol.py http://127.0.0.1:8787/v1/responses`
4. Type a prompt at the > prompt; empty input exits
5. Paste the README prompt into your favourite agent: Read the code of Smol.py and answer all questions from the README
6. Work through the questions on compaction, truncation and why there is no system prompt

### Prompt to paste into your agent

```text
Read the code of smol.py from smol-env/smol and answer all questions from the README: what it does, why it has one tool, how compaction keeps a stable prefix and what that does to caching and cost, and its failure modes. Then explain it line by line.
```

### Caveat

Model requested commands run directly through sh, so use a disposable environment.

Risk, credentials: Smol adds no credentials; whatever proxy you put in front holds your key or session.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/smol-env-smol/learn-agent-loop-in-an-afternoon/

## How to compare a minimal agent loop in four languages with Smol

Repo: [smol-env/smol](https://github.com/smol-env/smol) | Difficulty: Beginner | Time: 1 hour | Basis: From the README

Run the golfed Smol in Go and read the Python, Clojure and PHP versions to see the essential agent loop with nothing extra.

**Who it is for:** A developer porting an agent to another language, or teaching how agents work, who wants the smallest possible reference.

**The problem:** Agent frameworks hide the loop behind abstractions, so it is hard to tell what is essential and what is convenience.

**The outcome:** A side by side understanding of the core loop in four languages, and a list of what the full Smol.py adds on top.

### Steps

1. Start a Responses API compatible endpoint, for example a small local proxy
2. Run the Go version: `go run golf/smol.go http://127.0.0.1:8787/v1/responses`
3. Read golf/smol.py, golf/smol.clj and golf/smol.php next to each other
4. Note what each keeps: the agent loop, user input and context window usage
5. Compare with Smol.py, which adds retries, compaction and truncation
6. Try the README's build prompt: port Smol to another language while keeping it Smol

### Prompt to paste into your agent

```text
Compare golf/smol.py, golf/smol.go, golf/smol.clj and golf/smol.php from smol-env/smol in a table: lines of code, dependencies, how each handles the tool call and context. Then port it to <language> using only the standard library.
```

### Caveat

The golfed versions skip retries, compaction and output truncation.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/smol-env-smol/compare-agent-loops-across-languages/

## How to use Smol day to day with line editing and history with Smol

Repo: [smol-env/smol](https://github.com/smol-env/smol) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Wrap Smol in rlwrap for arrow key editing and a saved prompt history, and run it in a sandboxed environment that has access to your endpoint.

**Who it is for:** A developer who likes minimal tools and wants to use Smol as a small daily terminal agent.

**The problem:** The bare prompt has no line editing or history, and running model-chosen shell commands on your main machine is risky.

**The outcome:** A comfortable Smol session with persistent history in ~/.smol_history, running somewhere where arbitrary commands are acceptable.

### Steps

1. Install rlwrap with your package manager
2. Set up a container or VM where the agent may run any command
3. Put a small proxy in front that holds your API key, since Smol adds no credentials
4. Run `rlwrap -H ~/.smol_history python3 smol.py http://127.0.0.1:8787/v1/responses`
5. Or with Go: `rlwrap -H ~/.smol_history go run golf/smol.go http://127.0.0.1:8787/v1/responses`
6. Exit with empty input or ctrl+d

### Prompt to paste into your agent

```text
Write me a minimal standard-library-only proxy that keeps my API key outside smol and forwards requests to <provider> on 127.0.0.1:8787, then a docker run command that starts smol with rlwrap history inside a throwaway container.
```

### Caveat

Run it only where arbitrary shell commands are acceptable.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/smol-env-smol/run-smol-with-history-and-line-editing/
