Does Bitbucket Pipelines Remember Between Runs? A Cache Carries Your Dependencies. The Next Pipeline Starts in a Fresh Container.
Does Bitbucket Pipelines Remember Between Runs? A Cache Carries Your Dependencies. The Next Pipeline Starts in a Fresh Container. A Bitbucket pipeline that runs on every push can feel like a worker who knows the project. The dependencies restore in seconds, the variables are already in place, and the build list shows every earlier run in order. Underneath, each step runs in its own fresh Docker container, and nothing from that container reaches the next pipeline unless it was placed in a cache,
Does Bitbucket Pipelines Remember Between Runs? A Cache Carries Your Dependencies. The Next Pipeline Starts in a Fresh Container.
A Bitbucket pipeline that runs on every push can feel like a worker who knows the project. The dependencies restore in seconds, the variables are already in place, and the build list shows every earlier run in order. Underneath, each step runs in its own fresh Docker container, and nothing from that container reaches the next pipeline unless it was placed in a cache, declared as an artifact, or set as a variable beforehand.
That distinction matters once a pipeline does judgment work. A scheduled AI step that reviews a change or triages a failing test suite needs the reasoning from the last run, not just its downloaded packages. Bitbucket Pipelines keeps the second kind of thing well. The first kind needs a different home.
Each step starts in a fresh container
Pipelines are defined in bitbucket-pipelines.yml and run as a sequence of steps. Every step starts its own container from the image named for that step, checks out the repository, restores any caches the step lists, and runs the script. When the step ends, the container goes away, along with every file and installed tool that was not explicitly saved.
Inside one step, continuity is complete: files written early in a script are there later in the same script. That reach ends at the step boundary. The next step gets a new container and a fresh clone, and the next pipeline gets the same. Anything that crosses has to travel through one of the three channels below.
The cache: built for dependencies, not conclusions
Caches are the one mechanism designed to cross pipeline runs. A step lists caches by name, and Bitbucket restores each named directory before the script runs and saves it again after a successful step. Predefined caches cover the common package managers: node for node_modules, maven for the local Maven repository, gradle, pip, and others. Custom caches are declared under definitions: caches: in the YAML, mapping a name to any directory in the build.
A cache is created once and then reused as it stands. Atlassian clears any cache older than one week automatically, and the next successful step repopulates it. Caches are also capped at 1 GB once compressed. Cache keys refine this: a definition can name files, such as a lockfile, whose hash identifies a version of the cache, so a dependency change produces a fresh cache version instead of silently reusing a stale one.
Every part of that design answers one question: how does the next run avoid downloading and rebuilding the same files? A cache restores a directory, byte for byte. It does not record why a run made a decision, which warnings were judged harmless last time, or what an AI step concluded about the code it reviewed. A cache hit restores a folder. It does not restore a train of thought.
Artifacts: files that travel inside one pipeline
Artifacts solve a different problem. A step declares paths under artifacts: in the YAML, and the matching files from the clone directory are copied to every following step in the same pipeline. A build step can hand a compiled bundle to a test step, and the test step can hand reports to a deploy step, without each one rebuilding the output.
Artifacts are stored for 14 days after the step that produced them, so a person can download them from the pipeline result view, and a manual step later in the pipeline can still run inside that window. After 14 days they expire. Crucially, artifacts belong to the pipeline that created them: the next pipeline does not download the previous pipeline's artifacts as working state. They are outputs kept for people and for later steps, not a memory the next run reads.
Variables: configuration handed in, never written back
The third channel is variables. Workspace variables apply across repositories, repository variables apply to one repo, and deployment variables apply to a named environment. Secured variables are masked in logs. A step reads these values when it starts.
Variables are configuration set in advance. A pipeline cannot write a value during a run and hand it to the next run through this channel. If a run learns something, there is no variable it can update so tomorrow's run starts knowing it. The build list and logs complete the picture: a record of every pipeline, written for people to inspect. No step reads a previous pipeline's log as part of starting.
What an AI step actually needs between runs
Put an AI step inside this shape and the gap becomes concrete. Tonight's run reviews a pull request and decides three warnings are known noise, one test failure matches a flake seen last week, and a dependency bump needs a closer look because of a note from the run before. Tomorrow's run starts in a fresh container with restored dependency folders, the same starting variables, and none of those conclusions. It re-derives what it can, guesses at the rest, and sometimes contradicts yesterday's call.
The fix is to give scheduled and pipeline-driven agents a memory that lives outside the pipeline, in a store built to be read at the start of a run and written at the end of one. That is the role Vilix AI fills. Vilix AI is cloud-hosted, so there is zero infrastructure to run: no database to provision, no cache server to maintain, no extra service in the pipeline YAML. An agent connects over MCP, the Model Context Protocol, and reads the same shared memory from Bitbucket Pipelines, from a local coding tool, or from any other MCP-connected agent, so every run and every tool works from one memory instead of separate silos.
Vilix AI also keeps the full conversation history, not just extracted facts or summaries. An agent can return to what was actually said and decided in an earlier run, in order, rather than working from a compressed note that dropped the reasoning. For a pipeline step, that means the review conclusions, the exceptions, and the context behind them are all there at the start of the next run.
Getting started is deliberately light. Vilix AI has a free plan that stays free forever, and Pro comes with a 7-day trial that needs no card. Memory can be exported or deleted at any time, so the record an agent builds stays under the team's control.
The short answer
Does Bitbucket Pipelines remember between runs? It remembers files, on purpose and within limits: caches carry dependency directories across runs for up to a week, artifacts carry declared outputs between steps and stay downloadable for 14 days, and variables hand each run the same starting configuration. What it does not carry is reasoning. Each new pipeline starts its steps in fresh containers, blind to what the last run concluded. Give the AI steps in the pipeline a shared memory outside it, and the next run starts where the last one finished.