Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I built a coding agent from scratch to see what's inside

Описание и применение

Автор создал 565‑строчный Python‑агент, чтобы понять внутренний цикл кодирующих агентов. Он показал, что модель лишь запрашивает инструменты, а локальная машина их выполняет, пока модель не даст прямой ответ.

Задача

The author could not explain what coding agents do between the prompt and the file edit, so they built one to understand the internal loop.

Результат

The author discovered that coding agents operate by sending the conversation to a model, executing tools requested by the model, and looping until the model provides a direct answer. The model never edits files; the local machine performs all file operations.

Рабочий процесс

  • 1. Define tools (Read, Write, Bash) and give them to the model.
  • 2. Run the agent loop: send conversation to model, execute requested tools, return results, repeat until model answers directly.
  • 3. Validate tool calls with Pydantic.
  • 4. Implement skills, slash commands, and arguments.
  • 5. Create Skill tool and subagents with their own conversations.
  • 6. Test each stage with tagged commits and a command that proves it works (e.g., just stage 4 cd .stages/04 just run "How many carrots does the rabbit eat per day, according to rabbit.py?").

Доказательства

Claude Code, Cursor and Codex all run the same loop: send the conversation to a model, run the tools it asks for, send back the results, repeat until the model just answers.

Источник

The model never touches your files. It only asks, and your machine does the work.

Источник

petite is that loop, written from scratch in 565 lines of Python.

Источник

Every stage is a tagged commit that runs on its own. The site gives you a task for each one, keeps the solution folded until you want it, and has a command that proves it works:

Источник

  • Дата записи: 2026-10-04T23:56:02.440Z