Turning Claude Code Into an Autonomous Developer
DEV Community

Turning Claude Code Into an Autonomous Developer

Imagine you run a book club. You file a Jira ticket saying, “I cancelled Thursday’s meeting. It disappeared from the calendar, but everyone still got the reminder email.”

You’ve told me what happened, what you expected and where to start looking. Asking you which Git repository owns Thursday would be a bit much.

I made up the ticket, but it gets to the reason I built this. When I open Claude Code, I usually start in the right directory. I’ve already made quite an important decision on its behalf. Could it start where a developer starts on Monday morning, with a Jira issue that might need changes in several repositories?

The short version of what I learned: the interesting design decision wasn’t which model to use. It was where a model is allowed to decide anything at all. In my setup that’s two places. Everything around them is ordinary code that checks what the model did before anything else depends on it.

Making it autonomous was less about what I gave Claude Code and more about what I took away.

The idea

I figured I needed a Lambda to answer the door, Step Functions to organise the work and an ECS container to run Claude Code. So I built it.

I was more or less right about the number of moving parts. I was optimistic about how much time I would spend on permissions.

Workflow or agent?

Somewhere in between. Step Functions decides what runs next, when to retry and when to stop. Triage gets one model call to decide whether a ticket is clear enough.

The autonomy starts inside the development container. Once Claude Code picks up the ticket, it decides which files to read, which tests to run and what to try when they fail. I can draw the workflow before I run it. I have to watch the agent to find out how it solves Thursday’s reminder problem.

I drew that line on purpose. When one model checks another model’s work, a confident mistake can pass straight through. A test suite, a signature check or a conditional write gives the same answer every time, and I can read it afterwards. So each model decision is followed by something that isn’t a model.

Triage returns a list of missing details, and code decides whether that list is empty. Claude reports implemented, and the worker runs the tests again before anyone believes it.

Why build it myself instead of using a ready-made service

If my task already lived in a GitHub repository, I’d happily assign it to Copilot. Here, the person reporting a problem knows the product. They might never have seen the source code. I wanted to start from their description, give the agent working copies of the related projects and let it follow a bug across them.

Running the worker in my AWS network lets me decide which private package registries and test services it can reach. Copilot can run on a self-hosted runner too. One detail I found interesting in GitHub’s instructions is that you disable its built-in firewall and configure the network controls yourself.

I also wanted control over what starts a job, what instructions Claude loads and where the model sees my code. I considered Bedrock AgentCore, but wiring up the pieces myself sounded more fun.

GitHub’s guide to self-hosted agent runners

The step the benchmarks skip

Most coding-agent scores you’ll see come from SWE-bench or its variants. Each task gives the agent an issue and a repository, already checked out at the right commit. That’s a fair way to compare models. It also starts after the question my book club ticket asks first: which code is this about?

With thirty repositories in the catalogue, finding the right one, or the right two, is the first thing I’d have to work out myself. I wanted a system where that step is part of the job, and where I can measure it.

SWE-bench

Following one issue through the system

1. The webhook: the only door

A Jira event arrives over HTTPS at API Gateway. A Lambda verifies the HMAC signature against the raw request body, then uses a read-only credential from Parameter Store to read the issue.

Someone may have taken the ticket back while the event was on its way. It has to be in the right project and assigned to the agent. To keep the PoC simple, I only pick up issues in “To Do”. Once this first step is stable and secure, I’ll add support for the other states in the Jira workflow.

2. Triage: “do I understand what you want?”

Triage checks that the revision is still current, then gives Claude Haiku 4.5 one call to read the description, comments and up to five images. It returns a structured verdict.

A missing product decision or a missing detail that prevents useful work goes on the reporter’s list. Technical questions stay with the developer.

Triage also records security concerns, such as sensitive data in a screenshot or instructions in the ticket trying to steer the agent. I treat that as a smoke alarm, not a lock. A model asked to spot prompt injection can be fooled by the same injection, so the controls that matter come later and don’t depend on the model noticing.

Does the reporter actually owe me an answer? “Reminders are wrong” could use a follow-up. “Everyone got the reminder after I cancelled the meeting” already gives the developer somewhere to start. Whether the bug is in the calendar or the email service is our question to answer.

3. Guessing the repositories without a model

Picking where to look first costs zero extra tokens. Plain code matches clues in the ticket against a repository catalogue. The shortlist tells the worker where to install dependencies. It can still read the other projects, and an empty shortlist is a valid answer.

Here’s a shortened, fictional triage result for the book-club ticket.

{ "enoughInformation" : true , "missing" : [ ] , "securityConcerns" : [ ] , "repositoryCandidates" : [ { "name" : "club-diary" , "matched" : "calendar" } , { "name" : "club-post" , "matched" : "reminder email" } ] }

4. One developer at a time

Triage can run in parallel. Development gets one slot in DynamoDB, claimed with a conditional write. Waiting jobs check back every 30 seconds. If the workflow holding the slot dies, the next one checks the old execution, finds its Fargate task, stops it if necessary and waits for confirmation before taking over.

A timer alone can’t tell me whether the previous developer is dead or just having a difficult afternoon. Age never frees the slot. If the coordinator can’t prove the old task has stopped, it keeps waiting and tells me.

Anyone who has debugged a distributed lock without a fencing token will recognise the reasoning. Two agents editing the same working copies is not a bug I want to reproduce.

5. Preparing a clean, sanitized input

Once it has the slot, the coordinator reads Jira again. If the ticket has changed, the attempt stops. Otherwise it writes a size-limited input file to S3, strips attachment links and credential-like values, and lists attachments by type.

Triage can look at screenshots, but the development worker gets text. If the screenshot contains the whole specification, the workflow records a request for the relevant details in writing.

6. The Fargate task: four containers, four jobs

Each attempt gets a fresh Fargate task on a private subnet. Four containers share the work.

  • Prepare refreshes Git mirrors on EFS using a read-only token for the Git server. It makes fresh working copies and keeps protected files out of them.
  • Dependencies installs packages in the shortlisted projects with install scripts and plugins disabled.
  • Test database gives this attempt its own database so the worker can exercise the code as it would in CI.
  • Develop runs Claude Code as a non-root user with a read-only root filesystem. It can edit the working copies. The Git token and the shared cache stay with the preparation steps.

7. Claude Code as the developer

Claude Code runs headless, with a budget and a turn limit. Its instructions ask it to work the way I’d want a new colleague to: record which tests already fail before touching anything, make the change, run the focused tests, then the full suite and static analysis, and fix only what it broke.

Without the baseline, every test that was already failing looks like the agent’s fault, and it will happily spend its budget “fixing” it.

For our ticket it could trace the cancellation from the calendar to the queued email, write a test that reproduces the unwanted reminder, and fix the code. It can run the test again and repair a failure in the same session.

Its final answer follows a schema and can say implemented, investigated, needs_input with one question, or failed. Sometimes finding where the cancellation gets lost is a useful answer in its own right.

8. Trust, but verify

Claude’s own summary is an input here, not the verdict. After Claude exits, the worker builds one patch per changed repository against its recorded base commit. It checks that each patch applies, checks syntax, runs the full test suite where dependencies are installed, and runs static analysis on the changed files it covers.

A failed check fails the attempt. A skipped suite gets a reason. That distinction matters when I’m looking at a perfectly tidy patch wondering whether anyone actually ran it.

The worker saves the patches and transcript to S3 and writes result.json last. That final file tells the coordinator the worker has finished writing. It checks the result against the attempt and the container exit codes, records the outcome and releases the slot. I get the patch to review.

The AWS architecture

Here’s the whole system on one page. The numbers match the steps above.

The shape is simple. A serverless control plane decides what runs: API Gateway, a webhook Lambda, a Step Functions workflow with two Lambdas, and DynamoDB. One Fargate task in a private subnet does the work.

Everything that stores data stays in eu-west-2, and the model calls stay in the UK and EU. The control plane costs almost nothing while it waits. The VPC doesn’t. My laptop sits outside all of it.

The dashboard reads the Step Functions executions, DynamoDB, the S3 buckets and CloudWatch Logs with read-only access. It never writes, and nothing in AWS calls it.

Built as a PoC, on purpose

Several choices are there because this is a proof of concept. Each was the quickest option that was safe enough for one person and test tickets. Each also has a production replacement I’ve already picked.

Secrets. The Jira and Git tokens are SecureString parameters in Parameter Store, standard tier, encrypted with the AWS managed key. Terraform writes them from write-only values, so they never appear in the plan or the state. For three values in one account, that’s fine. Production moves them to Secrets Manager, with a customer managed key, a resource policy on each secret, and rotation where the provider lets me automate it.

Keys. Almost everything at rest is encrypted, but with AWS managed keys. DynamoDB, EFS and Parameter Store use the service defaults, and the run bucket uses SSE-S3. Production uses customer managed KMS keys, one per kind of data: source code (the Git mirrors, patches and transcripts), prompts and replies (the Bedrock invocation logs in S3 and CloudWatch), and operational records. A key policy is a second lock that an over-broad IAM policy can’t open by itself, and every decrypt appears in CloudTrail. Reading the invocation logs, which hold ticket text and code, should need permission on their key, not just on the log group.

There’s a small bonus too. My failure-alert SNS topic is unencrypted today, because EventBridge can’t publish to a topic that uses the AWS managed SNS key. A customer managed key with the right key policy fixes that.

AWS traffic. Today the worker reaches Bedrock, ECR and CloudWatch Logs through the NAT gateway. Only S3 has a gateway endpoint. Production adds interface endpoints for each AWS service the task uses, Bedrock runtime included, so that traffic never goes near the internet path.

Bedrock interface endpoints

Internet egress. This is the change that matters most for an agent. The worker’s security group allows HTTPS to any address, because security groups filter on IP addresses and the hosts I need don’t publish stable ones. Production puts AWS Network Firewall on the NAT gateway with a default-drop policy and a domain allow-list: the Git server and the package registry, nothing else. For HTTPS it matches the server name the client sends in the TLS handshake. AWS added the NAT gateway association this month, and London is one of its Regions.

Network Firewall domain filtering · NAT Gateway association

DNS. Network Firewall doesn’t see queries sent to the VPC’s own resolver, and DNS is the classic quiet way to smuggle data out. Route 53 Resolver DNS Firewall covers that path with its own allow-list.

DNS Firewall and Network Firewall

One caveat I’d want a reviewer to push on: the client chooses the server name it sends. Code that opens its own TLS connection can name an allowed host and connect somewhere else. That’s why the firewall isn’t the whole answer. Test code, which I can’t review in advance, moves to a task with no internet route at all, as described in the security section below. The firewall then only has to police the preparation steps, which run code I wrote with install scripts switched off. TLS inspection would close the gap further, at the price of running a certificate authority.

Cost. A firewall endpoint costs about $0.40 an hour in Ireland, roughly eight times London’s NAT gateway, though AWS waives the NAT gateway charges when the two are paired. For a worker that runs one task at a time, it becomes the biggest fixed line on the bill. I’d still pay it before this listens to a real Jira project.

Network Firewall pricing

Everything else. Two Availability Zones instead of one. The worker runs one task at a time, so this is about the NAT path and the endpoints, not throughput. Terraform state in S3 with locking and its own key. Today it’s a local file, which works for exactly one person. VPC flow logs and firewall logs, so the dashboard can show wh

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.