diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,5 +1,9 @@
 # Changelog for polysemy-plugin
 
+## 0.2.5.2 (2020-11-01)
+
+- Fixed crashes stemming from unused optimization passes
+  ([#382](https://github.com/polysemy-research/polysemy/pull/382))
 
 ## 0.2.5.1 (2020-09-15)
 
diff --git a/polysemy-plugin.cabal b/polysemy-plugin.cabal
--- a/polysemy-plugin.cabal
+++ b/polysemy-plugin.cabal
@@ -1,98 +1,104 @@
-cabal-version: 1.24
-
--- This file has been generated from package.yaml by hpack version 0.33.0.
---
--- see: https://github.com/sol/hpack
---
--- hash: 0f4635d86ee9b6424b575257afd4fc1a42b0ddbbf2270bdcb1a71b8e54f0226d
+cabal-version:      2.0
+name:               polysemy-plugin
+version:            0.2.5.2
+license:            BSD3
+license-file:       LICENSE
+copyright:          2019 Sandy Maguire
+maintainer:         sandy@sandymaguire.me
+author:             Sandy Maguire
+homepage:           https://github.com/isovector/polysemy#readme
+bug-reports:        https://github.com/isovector/polysemy/issues
+synopsis:           Disambiguate obvious uses of effects.
+description:
+    Please see the README on GitHub at <https://github.com/isovector/polysemy/tree/master/polysemy-plugin#readme>
 
-name:           polysemy-plugin
-version:        0.2.5.1
-synopsis:       Disambiguate obvious uses of effects.
-description:    Please see the README on GitHub at <https://github.com/isovector/polysemy/tree/master/polysemy-plugin#readme>
-category:       Polysemy
-homepage:       https://github.com/isovector/polysemy#readme
-bug-reports:    https://github.com/isovector/polysemy/issues
-author:         Sandy Maguire
-maintainer:     sandy@sandymaguire.me
-copyright:      2019 Sandy Maguire
-license:        BSD3
-license-file:   LICENSE
-build-type:     Custom
+category:           Polysemy
+build-type:         Custom
 extra-source-files:
     README.md
     ChangeLog.md
 
 source-repository head
-  type: git
-  location: https://github.com/isovector/polysemy
+    type:     git
+    location: https://github.com/isovector/polysemy
 
 custom-setup
-  setup-depends:
-      Cabal
-    , base >=4.9 && <5
-    , cabal-doctest >=1.0.6 && <1.1
+    setup-depends:
+        Cabal >=3.0.1.0 && <3.1,
+        base >=4.9 && <5,
+        cabal-doctest >=1.0.6 && <1.1
 
 flag corelint
-  description: Perform the corelint tests
-  manual: True
-  default: False
+    description: Perform the corelint tests
+    default:     False
+    manual:      True
 
 library
-  exposed-modules:
-      Polysemy.Plugin
-      Polysemy.Plugin.Fundep
-      Polysemy.Plugin.Fundep.Stuff
-      Polysemy.Plugin.Fundep.Unification
-      Polysemy.Plugin.Fundep.Utils
-      Polysemy.Plugin.Phases
-  other-modules:
-      Paths_polysemy_plugin
-  hs-source-dirs:
-      src
-  default-extensions: DataKinds DeriveFunctor FlexibleContexts GADTs LambdaCase PolyKinds RankNTypes ScopedTypeVariables StandaloneDeriving TypeApplications TypeOperators TypeFamilies UnicodeSyntax
-  build-depends:
-      base >=4.9 && <5
-    , containers >=0.5 && <0.7
-    , ghc >=8.4.4 && <9
-    , ghc-tcplugins-extra >=0.3 && <0.5
-    , polysemy >=1.3
-    , syb >=0.7 && <0.8
-    , transformers >=0.5.2.0 && <0.6
-  default-language: Haskell2010
+    exposed-modules:
+        Polysemy.Plugin
+        Polysemy.Plugin.Fundep
+        Polysemy.Plugin.Fundep.Stuff
+        Polysemy.Plugin.Fundep.Unification
+        Polysemy.Plugin.Fundep.Utils
 
+    hs-source-dirs:     src
+    other-modules:      Paths_polysemy_plugin
+    autogen-modules:    Paths_polysemy_plugin
+    default-language:   Haskell2010
+    default-extensions:
+        DataKinds DeriveFunctor FlexibleContexts GADTs LambdaCase PolyKinds
+        RankNTypes ScopedTypeVariables StandaloneDeriving TypeApplications
+        TypeOperators TypeFamilies UnicodeSyntax
+
+    build-depends:
+        base >=4.9 && <5,
+        containers >=0.5 && <0.7,
+        ghc >=8.4.4 && <9,
+        ghc-tcplugins-extra >=0.3 && <0.5,
+        polysemy >=1.3 && <1.5,
+        syb ==0.7.*,
+        transformers >=0.5.2.0 && <0.6
+
 test-suite polysemy-plugin-test
-  type: exitcode-stdio-1.0
-  main-is: Main.hs
-  other-modules:
-      BadSpec
-      DoctestSpec
-      ExampleSpec
-      LegitimateTypeErrorSpec
-      MultipleVarsSpec
-      PluginSpec
-      TypeErrors
-      VDQSpec
-      Paths_polysemy_plugin
-  hs-source-dirs:
-      test
-  default-extensions: DataKinds DeriveFunctor FlexibleContexts GADTs LambdaCase PolyKinds RankNTypes ScopedTypeVariables StandaloneDeriving TypeApplications TypeOperators TypeFamilies UnicodeSyntax
-  ghc-options: -threaded -rtsopts -with-rtsopts=-N -fplugin=Polysemy.Plugin
-  build-tool-depends:
-      hspec-discover:hspec-discover
-  build-depends:
-      base >=4.9 && <5
-    , containers >=0.5 && <0.7
-    , doctest >=0.16.0.1 && <0.17
-    , ghc >=8.4.4 && <9
-    , ghc-tcplugins-extra >=0.3 && <0.5
-    , hspec >=2.6.0 && <3
-    , inspection-testing >=0.4.2 && <0.5
-    , polysemy >=1.3.0.0
-    , polysemy-plugin
-    , should-not-typecheck >=2.1.0 && <3
-    , syb >=0.7 && <0.8
-    , transformers >=0.5.2.0 && <0.6
-  if flag(corelint)
-    ghc-options: -dcore-lint -dsuppress-all
-  default-language: Haskell2010
+    type:               exitcode-stdio-1.0
+    main-is:            Main.hs
+    build-tool-depends: hspec-discover:hspec-discover -any
+    hs-source-dirs:     test
+    other-modules:
+        BadSpec
+        DoctestSpec
+        ExampleSpec
+        LegitimateTypeErrorSpec
+        MultipleVarsSpec
+        PluginSpec
+        TypeErrors
+        VDQSpec
+        Paths_polysemy_plugin
+        Build_doctests
+
+    autogen-modules:    Build_doctests
+    default-language:   Haskell2010
+    default-extensions:
+        DataKinds DeriveFunctor FlexibleContexts GADTs LambdaCase PolyKinds
+        RankNTypes ScopedTypeVariables StandaloneDeriving TypeApplications
+        TypeOperators TypeFamilies UnicodeSyntax
+
+    ghc-options:
+        -threaded -rtsopts -with-rtsopts=-N -fplugin=Polysemy.Plugin
+
+    build-depends:
+        base >=4.9 && <5,
+        containers >=0.5 && <0.7,
+        doctest >=0.16.0.1 && <0.17,
+        ghc >=8.4.4 && <9,
+        ghc-tcplugins-extra >=0.3 && <0.5,
+        hspec >=2.6.0 && <3,
+        inspection-testing >=0.4.2 && <0.5,
+        polysemy >=1.3.0.0 && <1.5,
+        polysemy-plugin -any,
+        should-not-typecheck >=2.1.0 && <3,
+        syb ==0.7.*,
+        transformers >=0.5.2.0 && <0.6
+
+    if flag(corelint)
+        ghc-options: -dcore-lint -dsuppress-all
diff --git a/src/Polysemy/Plugin.hs b/src/Polysemy/Plugin.hs
--- a/src/Polysemy/Plugin.hs
+++ b/src/Polysemy/Plugin.hs
@@ -62,43 +62,14 @@
   ) where
 
 import Polysemy.Plugin.Fundep
-#if __GLASGOW_HASKELL__ >= 810
-import Polysemy.Plugin.Phases
-import Data.Bool (bool)
-#endif
 
 import GhcPlugins
 
-
 ------------------------------------------------------------------------------
 plugin :: Plugin
 plugin = defaultPlugin
     { tcPlugin = const $ Just fundepPlugin
-    , installCoreToDos = const installTodos
 #if __GLASGOW_HASKELL__ >= 806
     , pluginRecompile  = purePlugin
 #endif
     }
-
-------------------------------------------------------------------------------
-#if __GLASGOW_HASKELL__ >= 810
-polysemyInternal :: ModuleName
-polysemyInternal = mkModuleName "Polysemy.Internal"
-#endif
-
-------------------------------------------------------------------------------
-installTodos :: [CoreToDo] -> CoreM [CoreToDo]
-installTodos todos = do
-  dflags <- getDynFlags
-
-  case optLevel dflags of
-    0 -> pure todos
-    _ -> do
-#if __GLASGOW_HASKELL__ >= 810
-      mods <- moduleSetElts <$> getVisibleOrphanMods
-      pure $ todos ++ bool []
-                           (extraPhases dflags)
-                           (any ((== polysemyInternal) . moduleName) mods)
-#else
-      pure todos
-#endif
diff --git a/src/Polysemy/Plugin/Phases.hs b/src/Polysemy/Plugin/Phases.hs
deleted file mode 100644
--- a/src/Polysemy/Plugin/Phases.hs
+++ /dev/null
@@ -1,63 +0,0 @@
-{-# LANGUAGE CPP #-}
-
-module Polysemy.Plugin.Phases
-  ( extraPhases
-  ) where
-
-import BasicTypes
-import CoreMonad
-import DynFlags
-
-extraPhases :: DynFlags -> [CoreToDo]
-extraPhases dflags =
-    [ CoreDoSpecialising
-    , simpl_phase 0 ["post-late-spec"] max_iter
-    , simpl_gently
-    , CoreDoStaticArgs
-    , CoreDoSpecialising
-    -- TODO(sandy): probably don't need this one
-    , simpl_phase 0 ["post-late-spec"] max_iter
-    , simpl_phases
-    , simpl_gently
-    ]
-
-  where
-    option   = flip gopt dflags
-    max_iter = maxSimplIterations dflags
-    rules_on = option Opt_DoLambdaEtaExpansion
-    phases   = simplPhases dflags
-
-    base_mode = SimplMode
-      { sm_phase      = error "base_mode"
-      , sm_names      = []
-#if __GLASGOW_HASKELL__ >= 804
-      , sm_dflags     = dflags
-#endif
-      , sm_rules      = option Opt_EnableRewriteRules
-      , sm_eta_expand = rules_on
-      , sm_inline     = True
-      , sm_case_case  = True
-      }
-
-    simpl_phase phase names iter = CoreDoPasses
-      [ runWhen (phase `elem` strictnessBefore dflags) CoreDoStrictness
-      , CoreDoSimplify iter $
-          base_mode { sm_phase = Phase phase
-                    , sm_names = names
-                    }
-      , runMaybe (ruleCheck dflags) $ CoreDoRuleCheck $ Phase phase
-      ]
-
-    simpl_gently = CoreDoSimplify max_iter $ base_mode
-      { sm_phase = InitialPhase
-      , sm_names = ["Gentle"]
-      , sm_rules = rules_on
-      , sm_inline = True
-      , sm_case_case = False
-      }
-
-    simpl_phases = CoreDoPasses
-      [ simpl_phase phase ["main"] max_iter
-      | phase <- [phases, phases-1 .. 1]
-      ]
-
