A Dream Within a Dream: Episodes 38-40 Recap
**SPOILER ALERT**
Table of Contents
TL;DR (Quick Overview)
Nan Heng’s disbanded family finds each other again after the reset, but episode 38 brings a second, more brutal death toll, Song Yude and Yinzhu killed, Chu Guihong’s descent turning genuinely horrifying once he unmasks Song Yimeng as not who she claims to be. Nan Heng and Chu Guihong die simultaneously, and Song Yimeng takes her own life right after.
Episode 39 raises the stakes again, Chu Guihong gaining the same foreknowledge through dรฉjร vu turns this into a real cat-and-mouse rematch rather than an easy win. Song Yiting’s impromptu wartime wedding is a lovely bright spot, and Song Yimeng finally deciding she’s her own hero rather than waiting to be saved feels like the emotional culmination of her whole arc.
Episode 40 delivers one of the most satisfying endings, the final battle resolves with real sacrifice and mercy, and the show dedicates real time afterward to every character’s happy ending rather than rushing the credits. The scriptwriter’s redemption and that final meta twist close things out perfectly.
A Dream Within a Dream Recap:ย Episode 38
The Reset
Song Yimeng wakes at 9am to find the day has restarted entirely, and races to find Nan Heng alive, clinging to him in a genuinely sweet, desperate reunion. Shang Guanhe’s arrival lands just as warmly, thrilled to see him breathing after the carnage of the day before. She tells them both everything, the poisoning, the framing, Chu Guihong’s plan to seize the throne on the city tower, and Nan Heng, unlike a sceptical Shang Guanhe, believes her outright, fully accepting the reality of their scripted world.
She theorizes her death is what triggers the reset, meaning she could deliberately die again if things go wrong. Nan Heng flatly refuses to let her treat her own life as a fail-safe, worried about unpredictable variables in the reincarnation itself.
Their plan: keep her off the city tower entirely to prevent the “either-or” scene from ever triggering. Fu Gui is to guard her at the mansion while Shang Guanhe heads out to protect Song Yiting and her mother, and Nan Heng handles the palace himself.
Preventing the Poisoning
This time, Nan Heng intercepts the Emperor before he can eat the poisoned tangerines, tracing the plot back to the vendor bribed by Rong Hua, timed specifically around the Empress’s death anniversary tradition. The Emperor orders the tangerines tested, troops recalled, and security tightened, successfully heading off the assassination attempt that killed him the day before.
Chu Guihong’s Contingency
Realizing his poisoning scheme has been exposed and the vendor captured, Chu Guihong doesn’t hesitate, immediately ordering Rong Hua to move against the Song family instead. Shang Guanhe and his men, tracking Song Yiting’s trail of deliberately scattered hairpins to a cave, walk straight into an explosive ambush, leaving him among the badly injured.
Song Yiting’s Ordeal
Held captive, Song Yiting refuses to break, openly declaring her hatred for Chu Guihong even as he taunts her with exactly the pain he’s inflicting, watching someone she loves suffer and being powerless to stop it. When she still won’t cooperate, he cuts off one of her fingers and sends her mother to deliver the message: Song Yimeng must come alone.
A Dream Within a Dream Song Family Death
Against Fu Gui’s objections, Song Yimeng goes anyway, determined to save her family, arranging for backup to follow at a distance. Inside, Chu Guihong reveals he knows she isn’t the real Song Yimeng, unmasking her as Song Xiaoyu in front of everyone.
When Yinzhu bravely defends the family’s loyalty, Chu Guihong kills her without hesitation, and the horror only escalates from there. Song Yude refuses to betray Nan Heng even to save his own life, and when he lunges at Chu Guihong in a desperate, doomed attack, he’s killed too.
Devastated and blaming herself for everything that’s happened since her arrival, Song Yimeng reaches for a weapon, ready to end it and reset the cycle again, only for Nan Heng to arrive just in time to stop her.
He confronts Chu Guihong directly, and this time it’s Nan Heng who falls, fatally stabbed. Song Yimeng, calling him a fool through her grief, takes her own life beside him without hesitation.
And the story starts over, again.

A Dream Within a Dream Recap:ย Episode 39
A Third Chance
Song Yimeng wakes even earlier in the timeline this time, immediately rushing to Nan Heng and pleading for guards to protect her family before anything can go wrong. To convince him fast, she predicts Shang Guanhe’s exact words the moment he walks through the door, proof enough that she’s telling the truth about having died twice already.
She lays out a new plan, insisting that some iconic scenes still need to happen for her to eventually get home and secure Nan Heng a real future.
Chu Guihong Strikes First
The scriptwriter pushes Chu Guihong to stick to the plan, but this time, when the moth appears, Chu Guihong experiences dรฉjร vu of his own. He comes to the realisation that this has happened before.
He realizes that Song Yimeng likely retains memories across the resets, meaning she already knows his every move. Rather than risk that advantage, he decides to strike pre-emptively.
The Poisoning, Reversed
The tangerine scene replays, but this time it’s Chu Guihong who rushes in to “save” the Emperor, cleverly repeating Nan Heng’s own reasoning from the last loop and turning it around to accuse Nan Heng of treason instead.
Using the accusation as cover, he places the Emperor under house arrest, surrounding him with Qianyu troops and forcing an edict authorizing an attack on Nan Heng. Nan Heng and Song Yimeng arrive too late to stop it, realizing Chu Guihong has somehow gained the same foreknowledge she has.
The Scriptwriter Loses Control
Chu Guihong turns on the scriptwriter too, done playing along with the plot, refusing to finish the remaining iconic scenes and threatening to trap him permanently in the Cold Palace instead. Nan Heng manages to rescue the scriptwriter, intending to use him strategically as a stand-in for Lord Qianyu.
The Full Plan
With the truth now shared with Nan Rui and the Song family, Nan Heng mobilizes Gao’s old private army alongside the Waning River Crescent Guild and Song Yimeng’s own recruiting efforts among officials and citizens. The strategy splits three ways plus Fu Gui leading Nan Rui with 300 soldiers to rescue the Emperor directly.
Song Yude, Song Yiting, and even a hesitant Zhou Xueyi all commit to the fight once the truth about the script world is laid bare. In a lovely, unexpected detour, Song Yiting refuses to wait until after the battle to marry Shang Guanhe, considering it bad luck, and insists on modern vows instead of traditional ones, “I do”s and all, sealed with a kiss.
Song Yimeng dressing Nan Heng in his armour beforehand is a quiet, powerful moment too, both of them recognizing that tonight, everyone is the author of their own fate, not just the two leads. She lets go of the old hope for someone else to be her hero, finally seeing herself as one instead.

A Dream Within a Dream Recap:ย Episode 40 – Finale
The Fight Splits Three Ways
The retaliation kicks off across three entry points into the capital. Yunlong’s group ambushes the Qianyu Army in the northwest, Duan Shanhu and the Waning River Crescent Guild hold off another wave in the South City with help from the Axe Gang.
Song Yiting and her new husband Shang Guanhe run a clever empty-fort diversion on Nansheng Street to lure troops into a trap. The final front is Chu Guihong himself, facing down Nan Heng and the full Waning River Crescent Guild.
Rescuing the Emperor
Inside the palace, Rong Hua threatens the Emperor at sword point until Jixiang steps in to block him, getting wounded in the process. Nan Rui, refusing to watch history repeat itself, finally kills Rong Hua himself, earning a genuine flicker of respect from his father.
A Dream Within a Dream Final Battle
At Anhe Pier, Chu Guihong’s confidence collapses fast, his hidden reinforcements ambushed and poisoned before they can arrive. The scriptwriter, disguised as Lord Qianyu, tries to turn the Qianyu troops against Chu Guihong, but Chu Guihong exposes the impostor immediately.
What actually shifts the tide is the people themselves, ordinary citizens rallying behind Song Yimeng. An elderly veteran calls out the soldiers for turning on their own, and Nan Heng offering mercy to anyone willing to abandon Chu Guihong’s cause.
Enough soldiers switch sides that Chu Guihong charges Nan Heng alone. Nan Heng wins, deliberately sparing his life for the Emperor’s judgment, but Chu Guihong, bitter to the end, takes his own life instead, mocking heaven’s unfairness with his last breath. Nan Heng watches with real regret, remembering a much younger version of the man who once dreamed of protecting the kingdom alongside him.
The Scriptwriter’s Change of Heart
Afterward, the scriptwriter admits to Song Yimeng that he was wrong to ever think he had the right to dictate anyone’s fate, having finally accepted that every character became a real, living person somewhere along the way.
He explains the mechanism itself has collapsed, Nan Heng effectively broke the script’s rules by using them against Chu Guihong, and once the “iconic scenes” happened even with rewritten outcomes, the backlash tied to defying fate stopped applying altogether. No one is bound by the script anymore.
A Dream Within a Dream Happy Ending
Rather than end abruptly at the battle’s resolution, the show spends half of the last episode showing us what everyone is doing a few months after the rebellion. Nan Rui falls for a maid while planting rice, Jixiang survives, Zhixia takes over running Vicious Moonlight with brisk efficiency, Shang Guanhe and Song Yiting settle into married bliss with baby plans already underway, Fu Gui becomes a general, and even the mothers, Noble Consort and Madam Song, become close friends with doting husbands of their own. Nan Heng and Song Yimeng ascend the throne together as the Emperor formally abdicates.
Three Months Later
Song Yimeng goes away for three months. Upon her return, Nan Heng, feigning illness for sympathy, admits how much he missed her, sparking a playful bit of jealousy over a fictional co-star. She’s already busy reshaping the world around her, introducing the concept of shared carriages and a recruitment agency to help women find work, while he not-so-subtly hints at wanting to move their relationship forward physically.
A Final Twist
The episode closes on the scriptwriter finishing his manuscript, revealing it isn’t the original story at all, it’s authored by a different writer entirely, a woman named Zhong, who poses a final unsettling question: what if their whole world changing fate is itself just another layer of fiction. What if โA Dream from the Pastโ was actually โA Dream Within a Dream?โ Nan Heng’s answer closes the series out perfectly: then they’ll keep changing their fate until the day they die.

A Dream Within a Dream Episodes 38-40 Recap: My Thoughts
Episode 38 was โsit on the edge of my seatโ suff. I’d already been through one devastating death with these two, so watching them die a second time, this time with Song Yude and Yinzhu killed in front of Song Yimeng, was so sad.
Episode 39 is where the show truly clicked into place for me though. The idea that Chu Guihong could also gain foreknowledge through dรฉjร vu was such a clever twist, it stopped this from being a simple “she knows everything now so they win easily” reset and turned it into a genuine cat-and-mouse game again.
Song Yiting’s impromptu wedding before the battle was so good. Refusing to wait, choosing her own vows, that’s such a lovely, quietly defiant moment of joy dropped right before chaos.
Song Yimeng finally deciding she doesn’t want to be the passive lead anymore, that she’s her own hero, felt like the emotional culmination of basically her entire arc, and I was fully cheering for her by the time she was dressing Nan Heng in his armour.
And then episode 40. I have to talk about the ending structure specifically, because it was so awesome. In most period dramas, the finale is usually quite rushed, even with a happy ending. It always leaves me unsatisfied that I didn’t get to relish in the joy of the end.
But this drama was different. It not only gave a happy ending for the main leads, the story panned out over 3 episodes. It dedicated half of the finale to also show us the wonderful fates of the other characters that we had grown to love. This has to be one of the most satisfying endings I have encountered in the cdrama world.
I won’t spoil it for you but I hope you watched the surprise epilogue at the end of the credits! If not, go watch it now!
Thank you A Dream Within A Dream. Truly one of the best endings ever! What a ride!
Thanks for reading! Would absolutely love to hear your thoughts on this episode. Comment below.
A Dream within a Dream: All Episode Recaps and Full Reviews