Turn user stories into Azure DevOps pull requests with a hosted agent

Bibhu Prasad Sahoo hosted a Claude Code agent on Azure AI Foundry that takes a story and returns a tested branch and pull request. A ten-module app took Sonnet 38 minutes and about $3.86.

Done withClaude Code· Nov 19, 2026

What they did

Sahoo packaged Claude Code, driven through the Claude Agent SDK, as a container and ran it as a hosted agent on Azure AI Foundry, with each session in its own sandbox. A request names the story, the Azure DevOps repo, the target branch and whether to open a pull request. The agent clones the repo, works on a feature branch, writes code and unit tests, runs lint and tests, pushes and opens the PR. Because Azure DevOps would not accept the agent's identity, an Azure Function acts as a token broker that hands out short-lived git tokens and creates the PR itself. Commit, push and PR creation are fixed tools the model cannot change: they set the author, refuse the default branch and never force-push. A separate run_tests tool runs Python tests on a copy of the repo as an unprivileged user.

How it went

Early runs set their own commit author, pushed to extra branches and once opened a PR against the wrong default branch, which led to the locked-down tools. On a large brief, a doctor appointment platform built module by module, the first attempt claimed all ten modules done while five had no API routes, dependencies were missing and 47 tests failed on Windows. After a rewritten brief, Haiku lumped six modules into one commit and called it done; Sonnet made one commit per module, listed what it had not checked and opened the PR in about 38.5 minutes, 73 model calls and roughly $3.86 by the CLI's estimate.

Worth knowing

A headless agent cannot answer permission prompts, so every file write failed until he set a permission mode and a tool allow-list. Long runs hit a proxy timeout until the handler streamed and the client polled, and 60 turns was too few even for small stories, so he raised it to 300. The agent works on Linux and cannot see Windows or macOS problems. The model comparison is from one pair of runs.

Try it

With Claude Code· 6 parts to fill in

You are working on the repo [repo URL] in a fresh clone. Implement this story on a new branch named [branch name], targeting [target branch]: [user story and acceptance criteria]. Use [language and database] and only packages that are actually installed. Write unit tests, run lint and the tests, and do not say tests passed unless the test run shows it. Commit and push after each module. Never push to the default branch or force-push. When finished, write a report read back from the repo listing what you built and anything you could not verify, then [open a pull request or stop after pushing].

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related