LinuxmacOSWindows

Where Does Haskell Stack Store Data and Snapshots?

Stack keeps snapshots, programs and global config in ~/.stack, with per project work inside each project folder.

Last updated

Stack centralizes the heavy files in ~/.stack: downloaded compilers, dependency snapshots and the global config. Individual projects add a .stack-work directory with their own build outputs.

That split tells you what to delete. Project folders clean with stack purge, while the global root needs explicit pruning. The global config sets the default resolver for new projects.

Where Haskell Stack stores this, by platform

Linux
~/.stack

Snapshots under snapshots/, compilers under programs/, global config at config.yaml. Per project builds live in .stack-work beside stack.yaml. List snapshot disk use with stack path before pruning.

macOS
~/.stack

Same layout on Mac. Old snapshots from retired resolvers are the usual disk hogs. Remove them by snapshot directory once no project references that resolver.

Windows
%APPDATA%\stack

Windows root for the same tree. Long paths bite here: deep snapshot trees plus project paths can exceed limits, so keep projects shallow.

Frequently asked questions

how do i free disk space used by stack

Run stack purge inside projects to clear .stack-work, then delete stale snapshot directories under ~/.stack/snapshots for resolvers you no longer use. Check what remains with stack path.

where is the stack global config file

At ~/.stack/config.yaml on Unix and %APPDATA%\stack\config.yaml on Windows. It sets defaults like the resolver for new projects outside any existing stack.yaml.

Notice an outdated path? Let us know.