bertil-agents

Bertil Agent — AI skill for Claude Code

AI community

Bertil Agents are autonomous AI agents that each run in their own container, powered by the Claude Code CLI.

How to install Bertil Agent

This entry records only its repository, not the path inside it, so there is no exact command to give. Open bertil-agents/bertil-agent and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Bertil Agent does

Bertil Agents are autonomous AI agents that each run in their own container, powered by the Claude Code CLI. Start one with a task and its setup commands, then send it prompts and read its answers over HTTP.

Alternatives in AI

  • OpenSwarm — OpenSwarm — Autonomous AI dev team orchestrator powered by Claude Code CLI 589 ★
  • Pi Agent Desktop — Pi — A cross-platform AI coding agent, bringing the Claude Code experience to your desktop 289 ★
  • Gary AI Link — AI link(原名借脑):把团队里 AI 用得最好的那个人的 AI,借给每个人 92 ★

README

Bertil Agent

Bertil Agent turns the [Claude Code](https://claude.com/claude-code) CLI into an autonomous AI agent that other systems can talk to over HTTP. A Bertil Agent is one agent in its own container: it uses Claude Code as its engine, has a description, a model and one ongoing conversation, and exposes a small HTTP API so the rest of Bertil can give it work and read the results.

It is built for containerization (Docker or any other container platform) and for ephemeral agents: a container is started for one task or one purpose, set up by its startup commands, does its work and is thrown away. Many agents can run side by side, each in its own container, each with its own configuration.

Bertil Agent runs the Claude Code CLI itself (`claude --print`), not the Claude Agent SDK.

**Status:** a working proof of concept, still in development. The API and configuration may change.

How it works

At startup the agent prepares its container, checks that Claude Code works, and then waits for prompts. Every prompt continues the same conversation, and only one prompt runs at a time.

  1. Startup commands. The commands in BERTIL_AGENT_STARTUP_COMMAND_1 to _50 run once, in number order, through sh. They do the per-container setup: installing a tool, cloning repositories, logging in to a CLI. A failed command is logged and the next one still runs.
  2. Claude check. Claude Code is started once on the configured model and effort. With BERTIL_AGENT_INITIAL_PROMPT set, that prompt becomes the first message of the conversation; without it, a tiny health check runs instead.
  3. Prompts. A client sends a prompt with method=input, polls method=status until the agent is idle again, and reads the answers with method=output.

The agent reports where it is through its status:

Status Meaning