Build new agent features inside a guarded Docker sandbox
A Claude-based agent updated its own code in Docker, with every edit checked, committed, or undone automatically.
- What they did
- Miguel ran a Claude agent built with Agno inside Docker. The full project stayed mounted read-only, while only the agent’s own code folder could be changed. A host process captured the git state, fed the agent its files and the next capability to add, then inspected the result with AST, JSON schema, and import checks before deciding whether to commit or revert.
- How it went
- It made it through all 10 starter capabilities, then created its own checklist and expanded to 21+ capabilities. A later cleanup pass cut the codebase size by 10% and reduced the system prompt length by 63%. Even after that, it still sometimes made poor choices.
- Tips
- Keep the writable surface small and verify every edit before saving it. Watch context use closely, because reading six or more of its own files can leave the agent out of room before it writes anything.
Try it yourself with Claude Code
Help me create a Docker setup for [repo path] where an agent can improve its own source code. Leave the main project mounted read-only, and allow writes only in [writable code directory]. Give the agent its current files and a single new capability to implement, such as [first capability]. After each change, run AST checks, JSON schema checks, and import checks; if they succeed, commit the change, and if they fail, restore the previous version. Show the commit hash and test output, and pause for my approval before any step that would send data, delete files, make payments, or modify anything outside the sandbox.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Have agents co-build a reference system with role splits
A solo founder divided an AI-assisted build into roles and shipped a 120-model mental-models framework with an MCP server.
Use parallel agents to build a compiler
Coordinate many coding agents in containers and back them with tests and an oracle while they work on one compiler repo.
Use spare AI quota to draft reviewable PRs
A founder pointed an agent at goals and task lists so it could turn leftover Claude and Codex quota into pull requests for review.
Use Claude as an async coding partner
They paired with Claude and Jules while coding locally, then copied changes back and forth instead of sharing a live editor.
Draft a minimal Windows VNC viewer from a brief
They asked Claude to build a tiny Windows 10 VNC client from an email spec, but after a week it still did not work.
Use Scout to lint, fix, commit, and push from the terminal
A developer used Microsoft Scout in a local terminal to fix a syntax issue, review changes, and push a new branch after approval steps.