Back to browse
Agent from Scratch – Bootstrap an agent from a copy-paste, no framework

Agent from Scratch – Bootstrap an agent from a copy-paste, no framework

by brotchie·Mar 3, 2026·3 points·0 comments

AI Analysis

●●SolidBig BrainWizardryRabbit Hole

Agent self-bootstraps with no frameworks, but novelty wears fast without real problem solved.

Strengths
  • Genuine self-constraint: agent rewrites its own REPL, adds tools, connects to Telegram—forces real agentic iteration
  • Model-agnostic (Gemini, Claude, GPT variants): snippet adapts to whatever model's API you choose
  • Challenges (code golf, speed runs) create playful engagement and lower barrier to experimentation
Weaknesses
  • No practical problem solved—it's an intellectual exercise, not a tool for production work
  • Will break frequently (authors admit 'models don't always generate working REPL on first try')—frustrating for real use
Target Audience

Developers curious about agent mechanics, agentic LLM loop fundamentals, or OS/infrastructure builders.

Similar To

LangChain tutorials · AutoGen minimal examples · Agent loop playground projects

Post Description

I wanted to see if I could self-build a working OpenClaw-like agent starting with nothing but a fresh Linux VM.

The result is a model-specific REPL "genesis snippet." It's a short bash script that prompts for your API key, asks the model to generate a REPL with an agentic tool-use loop, and then drops you straight into that running REPL.

The self-imposed rules:

1. No copy-pasting code after the initial snippet. 2. No manual editing—the agent has to write and fix everything for you. 3. Zero agent frameworks or libraries.

From there, the goal is to ask the agent to rewrite its own REPL, add quality-of-life improvements, and eventually figure out how to connect itself to Telegram.

I put the snippets up on a site along with some open challenges like code golf and speed runs:

https://agentfromscratch.com

To try it, you just need your own API key and a Linux VM or Docker container. If you want to see how it actually behaves before running it, here is the raw terminal output of my first successful run:

https://agentfromscratch.com/polis/afs-genesis/

Similar Projects