{"id":50470333,"url":"https://github.com/pnegahdar/nano","last_synced_at":"2026-06-01T10:01:48.604Z","repository":{"id":358474316,"uuid":"1229107163","full_name":"pnegahdar/nano","owner":"pnegahdar","description":"One file. Under 200 lines. Zero dependencies. It's a coding agent.","archived":false,"fork":false,"pushed_at":"2026-05-17T16:19:34.000Z","size":835,"stargazers_count":59,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-17T16:42:29.016Z","etag":null,"topics":["ai","automation","cli","coding-agent","developer-tools","gpt","llm","openai","python","shell"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pnegahdar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-04T17:52:55.000Z","updated_at":"2026-05-17T16:39:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pnegahdar/nano","commit_stats":null,"previous_names":["pnegahdar/nano"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pnegahdar/nano","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnegahdar%2Fnano","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnegahdar%2Fnano/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnegahdar%2Fnano/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnegahdar%2Fnano/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pnegahdar","download_url":"https://codeload.github.com/pnegahdar/nano/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnegahdar%2Fnano/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33769492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","automation","cli","coding-agent","developer-tools","gpt","llm","openai","python","shell"],"created_at":"2026-06-01T10:01:47.415Z","updated_at":"2026-06-01T10:01:48.594Z","avatar_url":"https://github.com/pnegahdar.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# nano.py\n\n**The models got good enough that the harness doesn't matter anymore.**\n**So we made the smallest one that proves it. One file. under 200 lines. Zero dependencies.**\n\n```sh\npython3 \u003c(curl -s https://raw.githubusercontent.com/pnegahdar/nano/main/nano.py)\n```\n\nThat's the whole thing. No, really.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"demo.gif\" alt=\"nano.py finding, running, and fixing tests in one session\" width=\"720\" /\u003e\n\u003c/p\u003e\n\n---\n\n### Everything below ships in under 200 lines. We counted.\n\n\u003e 📂 **Reads CLAUDE.md, AGENT.md, AGENTS.md, README.md** — automatic repo context, same files the real agents use\n\u003e\n\u003e 🧩 **Discovers skill files** — finds SKILL.md from `.claude/skills`, `~/.claude/skills`, `~/.codex/skills`, `~/.codex/plugins`\n\u003e\n\u003e 🛡️ **Human-in-the-loop approvals** — every command shows what and why before it runs\n\u003e\n\u003e 🔁 **200-step agentic loop** — keeps going until the job is done, not until it gets bored\n\u003e\n\u003e 💬 **Interactive REPL** — multi-turn sessions with persistent memory across turns\n\u003e\n\u003e ⚡ **Non-interactive CLI** — `./nano.py \"fix the tests\"` and walk away\n\u003e\n\u003e 🔄 **Session resume** — `./nano.py -c` picks up where you left off, zero local state (OpenAI stores the conversation)\n\nPlus: interactive REPL · one-shot mode · session resume (`-c`) · session picker (`-s`) · GPT-5.5 by default · any model via env var · multi-step tool chaining · approve-one / approve-all / deny · auto-approve mode · per-command cwd, timeout, and env · platform-aware system prompt · output capped at 12KB · forced 5-10 word command descriptions · session reset · zero dependencies · pure stdlib Python · one file you can read in 5 minutes\n\n---\n\nMost coding agents are built on top of serious infrastructure — frameworks,\nruntimes, graph orchestrators, thousands of lines of glue.\n\nIt turns out you can get surprisingly far with a while loop, one shell tool,\nand a model that's good enough.\n\n`nano.py` is that loop. It sends context to GPT-5.5, lets it run shell commands,\nshows you what it wants to do, waits for your approval, and repeats until the job\nis done. Pure Python stdlib. Copy it into any repo and go.\n\n## Quick Start\n\n```sh\n# Run it straight from GitHub — no install, no clone, drops into a REPL\npython3 \u003c(curl -s https://raw.githubusercontent.com/pnegahdar/nano/main/nano.py)\n\n# Or grab it\ncurl -O https://raw.githubusercontent.com/pnegahdar/nano/main/nano.py \u0026\u0026 chmod +x nano.py\n\n# One-shot\nOPENAI_API_KEY=sk-... ./nano.py \"find the bug in auth.py and fix it\"\n\n# Interactive REPL\nOPENAI_API_KEY=sk-... ./nano.py\n\n# Continue last session in this directory\nOPENAI_API_KEY=sk-... ./nano.py -c\n\n# Pick from recent sessions\nOPENAI_API_KEY=sk-... ./nano.py -s\n\n# YOLO mode (auto-approve everything, godspeed)\nNANO_APPROVE=all OPENAI_API_KEY=sk-... ./nano.py \"run the tests and fix whatever breaks\"\n```\n\n## What It Doesn't Do\n\n- Install packages\n- Require a config file\n- Need a Docker container\n- Have a plugin system\n\n## The Architecture\n\n```\nwhile not done:\n    response = ask_model(context)\n    if response.wants_to_run_command:\n        if human_approves(command):\n            result = subprocess.run(command)\n            context.append(result)\n    else:\n        print(response)\n        done = True\n```\n\nThat's the architecture diagram.\n\n## Safety\n\nThis gives a language model a shell on your computer.\n\n- **Approval is on by default.** Every command shows you what it wants to run and why.\n- **You can approve one at a time**, or press `a` to approve all for the session.\n- **`NANO_APPROVE=all` skips all prompts.** Only use this when you trust the workspace and the task.\n- **Output is capped at 12KB per command** so the model can't filibuster itself.\n\nRead the command before you press `y`. It's under 200 lines — you can audit the whole thing over lunch.\n\n## Configuration\n\n| Variable | Default | What it does |\n|---|---|---|\n| `OPENAI_API_KEY` | — | Required. |\n| `OPENAI_MODEL` | `gpt-5.5` | Any model the Responses API supports. |\n| `NANO_MAX_STEPS` | `200` | Max tool calls per task before it stops. |\n| `NANO_APPROVE` | — | Set to `all` to auto-approve commands. |\n\n## The SWE-bench Question\n\nNo score is claimed here. But the shape is right. Same loop every agent runs:\nread repo, form hypothesis, run command, observe, repeat.\n\nWrap it in a harness, give it a budget, collect patches, and find out.\n\n## FAQ\n\n**Is this a joke?**\u003cbr\u003e\nIt works. So no. But also a little bit yes.\n\n**Should I use this in production?**\u003cbr\u003e\nYes. Why not?\n\n**Why so small?**\u003cbr\u003e\nThe models got good enough that the harness just doesn't need to be big anymore.\n\n**Can I swap in Claude / Gemini / etc?**\u003cbr\u003e\nThe Responses API is OpenAI-specific, but the pattern is universal. Port it in an afternoon.\n\n**Why not just use Claude Code / Codex?**\u003cbr\u003e\nYou should. They're great. This is for the mass of developers who want to understand\nwhat's actually happening inside the black box — and for anyone who looked at a\nlarge agent framework and thought *there has to be a simpler way*.\n\nThere was.\n\n## License\n\nMIT. Copy it, fork it, vendor it into your monorepo.\n\n---\n\n\u003cp align=\"center\"\u003e\u003csub\u003eWritten by agents, for agents, with agents. The humans just pressed approve.\u003c/sub\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnegahdar%2Fnano","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpnegahdar%2Fnano","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnegahdar%2Fnano/lists"}