Where Does Stack Store Snapshots and Config?
Stack root directory with snapshots, programs and configs, and the STACK_ROOT override.
Last updated
Stack centers on a .stack directory in your home holding snapshots, downloaded GHC versions, global project state and your personal config.yaml. Project builds reuse these snapshots across repositories, which is why the first build downloads gigabytes and later ones feel instant.
The STACK_ROOT variable relocates the whole tree, the documented fix for cramped home partitions or ephemeral CI disks. Inside projects, stack.yaml pins the resolver for everyone while your global config stays personal. Deleting snapshots reclaims space at the cost of rebuild time, never correctness.
Where Stack stores this, by platform
~/.stack
Key children include snapshots, programs and config.yaml. Set STACK_ROOT in your shell rc before running stack to relocate permanently. Project level stack.yaml files stay inside each repo, far from this tree.
~/.stack
Same layout as Linux. Xcode command line tools supply the C toolchain Stack shells out to, but all Haskell state stays inside this directory regardless of where GHC itself came from.
Frequently asked questions
how do i move the stack directory
Set STACK_ROOT to the new path, then move the .stack directory there. Snapshots, installed GHC versions and configs all resolve from that variable, so one move migrates the toolchain. Point it at fast local disk, since builds hammer it.
stack.yaml versus config.yaml, which is which
The project level stack.yaml pins resolver and packages for collaborators, while config.yaml in the stack root holds your personal defaults like jobs count and color settings. Version the first, keep the second in dotfiles.
Notice an outdated path? Let us know.