diff --git a/CHANGELOG.md b/CHANGELOG.md
index 48425b206d91221461e9c4833c17bc0bfda05e8b..162ab2f2cfd75d5d427d839de3d32a40d0254c09 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@
 * Added a `:language` command to allow changing the language used to parse user input. For example `:language event_b` can be used to switch to Event-B syntax when a non-Event-B machine is loaded (or no machine at all).
 * Improved the performance of loading machines by reusing the existing instance of ProB instead of starting a new one for each machine.
 * Improved error highlighting for machines loaded from files and not from the notebook.
+* Local variables (created using `:let`) are now discarded when a new machine is loaded. Previously local variables would be remembered even across machine loads, which could lead to confusing behavior and errors.
 * Significantly refactored the logic for parsing commands and their arguments.
 	* This is an internal change and should not affect any user-visible behavior. That is, all inputs that were accepted by previous versions should still be accepted - if any previously valid inputs are no longer accepted, this is a bug.
 	* As a side effect, the inspection and code completion features now work better in a few edge cases.
diff --git a/notebooks/tests/let.ipynb b/notebooks/tests/let.ipynb
index 630ec72c1808900863bcdeabb6aa7a669a118305..968949cce2fc3bba4ef89f6924f28f164f5db407 100644
--- a/notebooks/tests/let.ipynb
+++ b/notebooks/tests/let.ipynb
@@ -308,6 +308,53 @@
    "source": [
     "m"
    ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Local variables are not persisted when a new machine is loaded."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 14,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "Loaded machine: Empty"
+      ]
+     },
+     "execution_count": 14,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "::load\n",
+    "MACHINE Empty\n",
+    "END"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "metadata": {},
+   "outputs": [
+    {
+     "ename": "CommandExecutionException",
+     "evalue": ":eval: Computation not completed: Unknown identifier \"hello\"",
+     "output_type": "error",
+     "traceback": [
+      "\u001b[1m\u001b[31m:eval: Computation not completed: Unknown identifier \"hello\"\u001b[0m"
+     ]
+    }
+   ],
+   "source": [
+    "hello"
+   ]
   }
  ],
  "metadata": {
diff --git a/src/main/java/de/prob2/jupyter/ProBKernel.java b/src/main/java/de/prob2/jupyter/ProBKernel.java
index c8ba0adea04a33338d2aa4ec66b83e4039e70272..0751bc93b82105c287b6b24ce1fc679ceb07beb6 100644
--- a/src/main/java/de/prob2/jupyter/ProBKernel.java
+++ b/src/main/java/de/prob2/jupyter/ProBKernel.java
@@ -320,6 +320,7 @@ public final class ProBKernel extends BaseKernel {
 			oldTrace.getStateSpace().kill();
 		}
 		this.setCurrentMachineDirectory(Paths.get(""));
+		this.getVariables().clear();
 	}
 	
 	private @NotNull Trace loadDefaultMachine(final @NotNull StateSpace stateSpace) {