---
title: Shared package caches
description: New sandboxes stop downloading the same packages again.
order: 3
icon: hard-drive
tags: [caches, performance]
related: [parallel-agents, services, port-a-devcontainer]
---
import AgentPrompt from '../../components/AgentPrompt.astro';
import AgentPromptLink from '../../components/AgentPromptLink.astro';
## The problem
Each new container starts with an empty package cache, so every instance downloads the same dependencies again. Each name in `caches` is one directory in the config dir's `shared-volumes/`, mounted into every sandbox that lists it.
<AgentPromptLink />
## Config
```toml title="devsandboxes.toml"
[template.base]
image = "node:22"
caches = ["npm"] # one npm cache for every sandbox and instance
[sandbox.web]
extends = "base"
folder = "../web"
postCreateCommand = "npm install"
```
## Try it
```bash
devsandbox run web # npm install fills shared-volumes/npm
devsandbox run web --name fix-login # served from the cache
```
## How it works
- Valid names are `pnpm`, `cargo`, `npm`, `yarn`, `go` and `pip`. Each sets the tool's env vars to its mount.
- `rm` and `gc` leave caches alone. Delete a directory in `shared-volumes/` to start that cache over.
## Agent instructions
<AgentPrompt prompt="caches" />