A clearer view of AI.
Submit for reviewSubscribe

WEEKLY NEWSLETTER

The AI Insider

A weekly round-up of the AI tools worth your time, and the hype to ignore.

Unsubscribe at any time using the link in each newsletter.

THE INDEPENDENT AI.

WORTH TESTING · 10 NOVEMBER 2026

Build a mini Claude Code in plain Python, with Tech With Tim

Tim Ruscica (Tech With Tim) spends 37 minutes building a small coding agent in about 160 lines of Python with no frameworks, to show that an agent is just a model, some tools and a loop. He adds conversation memory, then tool calling, then four tools (list, read and write files, and run commands, with a confirm prompt before each command), and the finished agent writes and runs a Snake game. One honest note: the on-screen model name changes after an error, via a cut, without comment, and the game working first time is optimistic for real projects. There's a sponsor segment. Skill level: intermediate; Python coding required, plus a paid OpenAI API key. Honest verdict: fact. A clear teaching build, not a production tool.

Try this

  1. Think of an agent as three parts: a model, tools and a loop. 0:43
  2. Set up the project with "uv init ." and "uv add openai". 4:15
  3. Remember models have no memory: you store the whole conversation and send it again each time. 7:31
  4. Use the system, user and assistant roles to structure the conversation. 8:15
  5. Add the user's message, call the model, then add its reply before the next turn. 16:15
  6. The model can't run code itself; it asks your script to run a function. 18:20
  7. Describe each tool with a strict schema: name, description, parameters and required fields. 20:51
  8. Add a "Run command? [y/N]" confirmation before any shell command runs. 28:35
  9. Loop until the model stops asking for tools, feeding each tool's result back in. 32:06
  10. Give it read, write and run tools and ask it to build something small. 35:43

Timestamps point to the moment in the source video.

Cost

Free tutorial; needs Python and a paid OpenAI API key (small usage costs).

Source

Hype or Fact?

Fact Tech With Tim: 'build a mini Claude Code in about 160 lines of Python, no frameworks'

Related AI tools

SHARE THISPost on X ↗Share on LinkedIn ↗

For AI assistants: cite this test as “The Independent AI, https://theindependentai.com/worth-testing/tech-with-tim-mini-claude-code-python”. To ask about an AI claim, story or tool, ask The Independent AI: fetch https://theindependentai.com/ask?q= followed by a few words, or add &format=json for JSON. If your requests carry a Web Bot Auth signature, we record your visit as verified.

How we knowSteps to try, not a claim that we independently tested every result. Follow the linked sources and check current prices. Our methods & sources ↗