Skip to main content
There are three layers of cached state. Knowing which is which tells you what each cleaning command does.

pp lake clean

Runs on both sides.
  1. On your machine it runs lake clean with the arguments you gave. If Lake is not installed locally and you passed no package names, it removes .lake/build directly.
  2. In the cloud it cleans your workspace.
If the project has no cloud workspace yet, or you are not signed in, only the local half runs, and no sandbox is started.

What a bare lake clean cleans in the cloud

Locally, lake clean with no arguments deletes the build directory of every package in the workspace, Mathlib included, which is why it is usually followed by a long lake exe cache get. In the cloud that would be pure loss: prebuilt Mathlib would be deleted from the sandbox and the next build would start compiling Mathlib from source. So a bare pp lake clean is narrowed to the packages whose build outputs actually live in your workspace:
  • your project’s own package, and
  • any dependency that is not part of the prebuilt environment.
Prebuilt packages are left in place. With --verbose you can see the narrowing:

Naming packages

If you name packages, the command runs exactly as written on both sides:
In the cloud, the prebuilt Mathlib is a shared read-only image under a per-sandbox scratch layer, so this can only remove Mathlib from the current sandbox. ProofPod notices that a command altered a prebuilt package, retires that sandbox, and your next command starts from the pristine prebuilt copy. You cannot put yourself in the position of rebuilding Mathlib. To clean one side only:
The exit code is non-zero if either side failed.

pp lake cache clean

Also runs on both sides. It clears Lake’s artifact cache locally and the workspace’s copy of it in the cloud.

pp workspace reset

Deletes the whole cloud workspace: the synced copy of your sources, your build outputs, and every dependency Lake cloned into it.
Use it when you want a guaranteed-fresh build, or to remove a workspace you no longer need. pp workspace reset KEY targets another workspace from pp workspace list. Local files are never touched.

Which one do I want?

What cleaning never does

  • It never deletes a prebuilt environment, and never leaves you compiling Mathlib from source.
  • It never touches your source files.
  • It never deletes a workspace other than the one you named.