Free forever, no credit card.Get Started for Free →
← All posts
November 27, 2026 · 5 min read

Does AWS CodeBuild Remember Between Runs? A Cache Carries Your Dependencies. The Next Build Starts in a Fresh Container.

Does AWS CodeBuild Remember Between Runs? A Cache Carries Your Dependencies. The Next Build Starts in a Fresh Container. A CodeBuild project that runs every morning can look like it remembers. The dependencies restore in seconds, the environment variables are already set, and the build history lists every previous run in order. It feels like one continuous worker. Underneath, each build runs in a fresh, isolated container that is torn down when the build ends, and nothing from that container ca

Does AWS CodeBuild Remember Between Runs? A Cache Carries Your Dependencies. The Next Build Starts in a Fresh Container.

A CodeBuild project that runs every morning can look like it remembers. The dependencies restore in seconds, the environment variables are already set, and the build history lists every previous run in order. It feels like one continuous worker. Underneath, each build runs in a fresh, isolated container that is torn down when the build ends, and nothing from that container carries into the next build unless it was deliberately placed in a cache, an artifact, or a configuration store.

That distinction matters once a build does judgment work. A scheduled AI step that reviews a failure, updates a release note, or triages a queue needs the reasoning from the last run, not just its downloaded dependencies. CodeBuild keeps the second kind of thing well. The first kind needs a different home.

The container forgets everything, by design

CodeBuild is a fully managed build service: it provisions compute, pulls the source, runs the phases in the buildspec, uploads the artifacts, and terminates the environment. Every build starts in a clean container with no residual state from previous builds. Files written outside the declared outputs, tools installed during the build, and processes left running all disappear with that container.

Inside one build, continuity is real. Phases run in order, the working directory persists across them, and a variable set in an early phase can be read later in the same build. The buildspec can also declare exported variables for use across phases. That reach ends at the build boundary. The next invocation gets a new container, a fresh checkout, and only the inputs it is handed.

The cache: built for dependencies, not conclusions

CodeBuild offers two cache types, and the project picks one. An Amazon S3 cache stores the directories listed under cache.paths in the buildspec, such as a Maven repository or an npm folder, in a bucket you control. A later build downloads that cache before it runs and uploads an updated copy afterwards. It is durable, shared across builds, and exactly as smart as the paths you list: it restores files, byte for byte.

A local cache stays on the build host instead. AWS describes it as available to that host only, for a limited time, and maintained at best effort, so a later build may or may not land on a host that still holds it. Local caching has three modes: source cache, which keeps Git metadata so later builds pull only the change between commits; Docker layer cache, which keeps existing image layers; and custom cache, which keeps directories named in the buildspec.

Both cache types answer the same question: how does the next build avoid redoing expensive file work? Neither cache records why a build made a decision, which warnings were judged harmless, 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 and reports: outputs for people and pipelines

At the end of a build, CodeBuild uploads the artifacts declared in the buildspec, usually to S3, where a pipeline stage or a person can pick them up. Test and coverage results can be published as reports, and logs go to CloudWatch or S3. Build history in the console shows status, duration, and source version for each run.

All of that is a record of what a build produced. None of it is fed back into the next build as working context. A later build does not read yesterday's report, notice that the same test failed three nights in a row, or pick up the explanation an earlier run wrote for it. If a buildspec wants that information, a step has to fetch the file, parse it, and turn it back into prompt context by hand, every single run.

Environment variables: configuration handed in, not memory earned

Variables in CodeBuild come from configuration, not from experience. A project defines environment variables as plain text, as values pulled from AWS Systems Manager Parameter Store, or as secrets resolved from AWS Secrets Manager. The buildspec has its own env section with variables, parameter-store, and secrets-manager blocks, and a start-build call can override variables for that one build.

That system is good at handing a build the same settings every time. It cannot hold what a build learned, because nothing writes back into it during a run. A variable says what someone configured in advance. It never says what the last build discovered, decided, or left unfinished.

Where the reasoning should live instead

Consider a nightly CodeBuild project with an AI step that reviews new failures and updates a tracker. With only CodeBuild's own stores, run forty-one starts knowing the dependencies, the settings, and the source. It does not know that run forty already classified two of the failures as flaky, that a third failure was traced to a dependency bump, or that the tracker update was promised in a particular format. The step re-derives all of it, or misses it.

Vilix AI is the memory layer that sits outside the build and survives it. It is cloud-hosted, so there is zero infrastructure to run or maintain: no bucket layout to design for context, no cache invalidation to manage, no retrieval code to write into the buildspec. The build's AI step connects over MCP, reads the shared memory at the start of the run, and writes its conclusions back at the end.

Because that memory lives outside any one tool, the same memory is available everywhere: the nightly build, a second project, and the chat tools used to investigate between builds all read and write one shared store over MCP. And Vilix AI keeps full conversation history, not just extracted facts, so the next run gets the reasoning in context, including the dead ends, rather than a compressed summary that drops exactly the detail that mattered.

Getting started is deliberately light. Vilix AI has a free plan that stays free forever, and Pro comes with a 7-day free trial with no card required. Your memory stays yours: you can export it or delete it at any time.

The short answer

Does AWS CodeBuild remember between runs? It remembers exactly what it was designed to remember: cached dependency folders, uploaded artifacts, published reports, and the configuration handed to each build. The container, and everything learned inside it, is gone when the build ends. Give the build's AI step a memory that lives outside the container, and run forty-one can start where run forty actually finished.

Get Started for Free

Persistent memory across ChatGPT, Claude, and the AI tools you already use in Vilix AI.

Get Started for Free

Free forever, no credit card.

Keep reading
Does GoCD Remember Between Runs? An Artifact Carries the Binary Forward. The Next Pipeline Instance Starts With Only Its Materials.

Does GoCD Remember Between Runs? An Artifact Carries the Binary Forward. The Next Pipeline Instance Starts With Only Its Materials. GoCD remembers a great deal about delivery, and almost nothing about reasoning. Every pipeline instance is recorded, every artifact a job publishes is stored, and a downstream pipeline can fetch exactly the artifact its ancestor produced. What no instance inherits is the working context behind the last run: why a stage was retried, what an operator noticed in the l

What Are the Alternatives to Google InMemory Sessions for the Anthropic SDK?

What Are the Alternatives to Google InMemory Sessions for the Anthropic SDK? The alternatives to Google InMemory sessions for the Anthropic SDK are a database-backed session store you run yourself, a managed session service from a cloud platform, or a hosted memory layer your agent connects to over MCP. InMemory sessions keep state in process memory only, so every restart, redeploy, or scale-out wipes what your agent knew. Any of the three alternatives fixes that by writing session state and co

Does Spinnaker Remember Between Runs? An Artifact Can Carry Over From the Prior Execution. The Next Execution Starts With Only Its Trigger.

Does Spinnaker Remember Between Runs? An Artifact Can Carry Over From the Prior Execution. The Next Execution Starts With Only Its Trigger. A Spinnaker pipeline that deploys the same service every day can look like it knows the service by heart. The right image arrives, the right manifest renders, and the execution list shows every earlier deployment in order. Underneath, each execution is its own record with its own context, built from its trigger and its stages. What one execution learned sta