Last month, we introduced Agentic Pipelines, a new way to orchestrate AI agents to automatically, and routinely, handle the repetitive engineering chores so you can get back to solving the fun, cool problems. When we launched, Agentic Pipelines supported Atlassian’s developer AI agent, Rovo Dev.
Today, we’re opening up Agentic Pipelines to even more teams: You can now run agentic steps in your pipeline with Claude as the provider. We still support Rovo Dev as the default provider, but if your team is already using Claude Code, you can plug it directly into your Bitbucket Pipelines without any extra infrastructure or integration glue.
Agentic Automation with Claude
Agentic Pipelines evolves Bitbucket Pipelines from automating CI/CD tasks, to automating all kinds of automate all kinds of workflows using AI agents, with Bitbucket acting as the central orchestration platform.
This is perfect for all the tasks before and after code creation that are low-value, high-effort, and highly repetitive. Think tasks like updating READMEs, triaging security reports, cleaning up feature flags, generating PR descriptions; before Agentic Pipelines, most of these tasks were manual, tedious, and difficult to automate, but with Agentic Pipelines, dev teams can automate these types of tasks with AI agents just by embedding them into their pipelines as a step in a repository’s pipeline configuration.
And now, for your teams using Claude, they can do the same just by including the provider keyword in your bitbucket-pipelines.yml, like this:
definitions:
agents:
my-agent:
prompt: "Explain this repository"
provider: claude
pipelines:
default:
- step:
script:
- agent: my-agent
If you don’t include provider: claude, Bitbucket will automatically default to using rovodev.
Using Claude Code with Agentic Pipelines falls under our Third-Party Product agreement. Your source code, prompts and logs will be sent to Claude Code and Atlassian is not responsible for the privacy, security or costs involved.
Deep dive: fixing flaky tests automatically
One of these repetitive chores that’s easy to defer is fixing flaky tests. Every team runs into them; nobody wants to deal with them. After all, since the test fails intermittently and for often unknown reasons, it’s easier to just re-run the test until it passes.
Then, you move on. The flakiness never actually gets fixed, CI trust erodes, and eventually people start ignoring red builds entirely.
With Agentic Pipelines, you can change that. We’ve included a flaky test remediation agent that lets you point at a flaky test, have it reason through the likely cause, apply a fix, and open a draft PR. All without having to dig in.
How it works
Once you’ve enabled Agentic Pipelines for your workspace, navigate to the Tests tab in the left sidebar of your repository. Any bitbucket-pipelines.yml defined using the trigger “fix-flaky-test” (how to set up) will automatically show a “Fix flaky test” button next to it, if Bitbucket has identified it as flaky. Click the button, and Bitbucket kicks off your configured fix-flaky-test pipeline.
The agent then:
- Gathers information about the flaky test: its full execution history, failure patterns, and surrounding code context.
- Executes the test to observe the failure firsthand.
- Hypothesizes the likely root cause: timing issues, shared state, environment dependencies, test ordering, and more.
- Proposes a plan and makes targeted changes to fix the issue.
- Runs the test again to verify the fix holds.
- Opens a draft pull request and tags the person who triggered the fix as a reviewer.
You review the PR, verify the fix makes sense, and merge.
Setting it up
To use the default flaky test fixer agent, simply add a fix-flaky-test trigger to your bitbucket-pipelines.yml and point it at a pipeline step that runs the agent. We recommend starting with the built-in default agent, as it’s optimised by the Bitbucket Pipelines team and continuously improved with CI/CD-specific tooling:
triggers:
fix-flaky-test:
- condition: "<custom-condition>"
pipelines:
- fix-flaky-test-pipeline
pipelines:
custom:
fix-flaky-test-pipeline:
- step:
auth:
system:
scopes:
- read:repository:bitbucket
- write:repository:bitbucket
- read:pipeline:bitbucket
- read:pullrequest:bitbucket
- write:pullrequest:bitbucket
script:
- agent: bitbucket-default-fix-flaky-test-agent
provider: claude //want to use Claude? Add this line here. That's it!
Want to customise your own flaky test agent, or use Claude Code? Define a custom agent under definitions.agents and plug it into the same trigger. When the pipeline runs, Bitbucket automatically provides context variables your agent can use:
- $BITBUCKET_TRIGGER_TEST_CASE_UUID — the unique ID of the flaky test
- $BITBUCKET_TRIGGER_TEST_CASE_FQDN — the fully qualified name of the test
- $TRIGGER_METADATA_PR_SOURCE_BRANCH — the source branch to raise the fix PR from
- $BITBUCKET_TRIGGER_FIX_FLAKY_TEST_TARGET_BRANCH — the target branch for the fix PR
What’s next
Agentic Pipelines is still in open beta, and we’re shipping fast. Claude Code is just the first of other third-party CLIs we plan to support; stay tuned for more news on that front soon!
If you haven’t tried Agentic Pipelines yet, all you need is a Bitbucket Cloud repo—you don’t have to be a current user of Bitbucket Pipelines. Just pick a manual, repetitive task your team keeps delaying, and embed an agent to handle it for you.
Try it now → bitbucket.org
Learn about all the ins and outs in our documentation here, with more details on setting up Claude Code as your [insert docs link: third-party agent provider].
We’ve been so excited to see the ways you’re using Agentic Pipelines, and looking forward to even more use cases as more teams use Agentic Pipelines with Claude.
See you in the open beta!
