For the last two years, my use of AI for programming looked the same. I open a chat, paste some code, explain the context, copy the answer back into the editor, run the tests, paste the error back into the chat, and repeat. Agent mode is not much different. I explain what I want and wait for the agent to finish. This works for small tasks, but on a real project it never felt right. I was the one moving context around, and the AI was waiting for me.
That is not how developers work in a team. Work goes through issues, branches, pull requests and code reviews. Nobody sends me a code snippet in a chat and asks me to paste it into the codebase. Someone opens a pull request, CI runs, and I review it. As I wrote in Software Developers Are Not Coders, typing code is only a small part of the job anyway.
So I tried something different on my bicycle tracker. Instead of chatting with AI, I let AI agents work as one more contributor in the repository. One agent reads the code and opens an issue. Another one picks up the issue and opens a draft pull request. My job is to review the pull request and decide if it gets merged.
The runner itself is open source and available on GitHub: agents-runner.
There are already many tools for running AI agents on a project. I use Claude Code with a Pro subscription, so I wanted a simple setup that runs Claude Code in headless mode (claude -p) on that subscription. The Anthropic API is billed separately, and I did not want a second bill. The setup should also use only tools most developers already know: Bash, cron and Docker.
The agents are defined in the whereisivan repository itself, the same way I use Claude Code there every day. Two of them work on the Kotlin backend:
I recently added a third one, android-issue-finder, which does the same as the backend finder but for the Android app.
The goal is to pick small tasks that would take me about 30 minutes, but that pile up over time. Every pull request goes through my review, so I stay in control of the project. The agents run at night from cron, or I start them by hand.
Claude Code can already run tasks on a schedule, so why build anything? Because I wanted control over three things:
Every run is one command and one fresh Docker container. When the run is finished, the container is gone and only the logs stay.
The most important rule of the whole setup is that the AI only reads and edits code. Everything else is done by two small scripts next to the agent’s config:
For example, the finder does not create the issue itself. It only answers with JSON:
{"title": "Fix 500 on POST /api/activity/stop when the activity id is unknown", "body": "## Problem ..."}
or, if it found nothing worth reporting:
{"skip": "one-sentence reason"}
Then post.sh checks the answer (not empty, title not too long, no open issue with the same title) and creates the issue. Here is the first issue created by the backend finder. When the finder has nothing new to report, the run simply ends:
model found nothing worth filing: The real defects I found are already covered by open issues...
The fixer works the same way, but it is stricter, because it changes code:
If anything fails, the issue stays agent-wip with a comment explaining why. I read the logs and relabel it agent-ready to try again.
Every run also adds one line to a CSV file with tokens, duration and tool calls, so I can see how much of my subscription each run uses.
So far the finders have opened 12 issues. The fixer has opened 5 draft pull requests, and I merged 3 of them, for example the fix for the first issue. Two issues are stuck in agent-wip because the fixer did not finish them. That is the expected outcome: the failure is recorded, and nothing broken gets pushed.
Running an agent is one command:
bin/agent whereisivan backend-issue-finder # → a new issue labelled agent-ready
bin/agent whereisivan backend-issue-fixer # → a draft PR for the oldest agent-ready issue
The instructions for each agent live in the project repository, in .claude/agents/. So the agent learns about the project from the project’s own CLAUDE.md, and I can use the same agents myself when I work on the code. The runner only needs a small config file per agent:
# agents/whereisivan/backend-issue-finder/agent.env
ALLOWED_TOOLS="Read,Grep,Glob"
MAX_TURNS=30
MODEL=sonnet
TIMEOUT_MINUTES=30
_ALLOWEDTOOLS is the important line. It lives in the runner on purpose: the agent definition in the project can ask for fewer tools, but never for more. The finder can only read files. The fixer can edit files and run the tests, and nothing else.
Before scheduling anything, I ran both agents by hand a few times and read what they produced. Once the results looked good, I added them to my crontab:
0 2 * * * $AGENTS_RUNNER/bin/agent whereisivan backend-issue-finder >> $AGENTS_RUNNER/logs/cron.log 2>&1
0 3 * * * $AGENTS_RUNNER/bin/agent whereisivan backend-issue-fixer >> $AGENTS_RUNNER/logs/cron.log 2>&1
An agent that runs at night while I sleep is not the same as a chat window, so the setup is strict:
I know a Docker container is not full isolation from the host machine. There are known ways to escape a container and get root access on the host. My next step is to run the agents inside a KVM virtual machine.
I made the runner generic, so you can use it on your own repository with your own Claude subscription. The runner itself knows only Docker and Claude Code. Everything else, including git and GitHub, lives in the agent’s own scripts. Your agent does not have to open issues: it can write a report, send a message or open a pull request.
To start, copy the example agent in agents/example/. It is a commented template that shows the whole flow: what pre.sh prints becomes the prompt, the AI answers in a JSON format you define, and post.sh checks that answer before it does anything with it.
The code is on GitHub at github.com/drndivoje/agents-runner under the MIT license.