"Dreamscaperers"

The kids and Soos travel through Grunkle Stan's mind to defeat an ancient demon named Bill Cipher, summoned by Gideon to retrieve the code to Stan's safe in a ploy to get the Mystery Shack.

Note: This is the first of a two-part season finale.