This A24-produced haunted house movie hails from a familiar tradition, but hits all the right scary notes.

Before it becomes an ultra-creepy haunted house movie, “Hereditary” is an almost-unbearable study of the grieving process. A family copes with traumatizing loss, screaming, crying, and growing apart as the scariest aspect of their lives becomes the actual hardships of each passing day. Then something far more terrifying happens. Despite some occasional clichéd jump scares, “Hereditary” excels at permeating a convincing environment of despair with first-rate horror.

Writer-director Ari Aster’s first feature culls from a tradition of slick, elegant genre filmmaking, making up what it lacks in originality with an impressive volume of atmospheric dread. At its center, Annie (a terrifically unhinged Toni Collette) copes with her mother’s death by throwing herself into building a series of intricate miniatures in her large, creaky home. Her distracted husband (Gabriel Byrne) mostly keeps to himself, while her teenage son Peter (Alex Wolff) sulks on the sidelines, and his spooky younger sister Charlie (Milly Shaprio, who won a Tony for “Matilda” on Broadway) lurks around saying little. Just when it seems like “Hereditary” is entering traditional creepy-kid territory with Charlie giving off serious “The Omen” vibes, the movie takes an abrupt, violent twist that further the complicates the family’s dark moment.

The house becomes an ominous focal point for their despair. As Peter’s tensions with his mother grow more extreme, he suffers from shocking nightmares and shadowy visions in the dead of night, while Annie’s tendency to sleepwalk adds another unpredictable variable to the growing impression of hidden forces overseeing their lives. Aster’s smooth camerawork drifts through the cavernous household with a Kubrickian eye for open spaces and unknown threats, with a haunting score by Colin Stetson leading to a heightened, disorienting ambiguity about the nature of the threat.

“Hereditary” takes a peculiar turn when Annie attempts to find solace in grief therapy, where she connects with a benevolent older woman named Joan (“The Handmaiden” villain Ann Dowd, who seems to have forged a career in tough maternal figures with uncertain motives). At first, Joan’s merely a sounding board for Annie’s sadness, but then she reveals a most unexpected source of catharsis — the possibility of communing with the dead. Confident and more than a touch manic about the prospects of communing with her dead family members, Annie gathers her clan for a kitchen seance that goes horribly wrong. And then, a whole lot of other things do.

The supernatural twist of “Hereditary” borders on the ridiculous, so when objects start moving on their own and abrupt jump scares take hold, the movie threatens to become a trite variation on things going bump in the night. More often, it’s an immersive variation. Collette’s paranoid, bipolar performance boldly swings for extreme emotions as the full conspiracy behind the haunting comes into view, while Wolff gives his brooding teen character a terrific blend of anger and sensitivity.

Using minimal resources to his advantage, Aster transforms the setting into a claustrophobic maze of long hallways, creaky attics, and strange figures creeping in the background. Annie’s miniature models become a wondrous allegory for the sense that the fragile human emotions in play are toys of an indifferent universe that adheres to its own agenda.

The movie occasionally falters when it veers into a few outlandish twists, and risks shrill extremes as Annie continues to freak out over new revelations. But it’s always sharply attuned to the genre traditions fueling every scene, and occasionally rises above them with sinister developments. Its closing moments arrive with a relentless pileup of macabre circumstances, announcing the arrival of a new horror filmmaker willing to accept the time-honored credo of the genre that no good deeds go unpunished, and pure evil always steals the show.

Grade: B+

“Hereditary” premiered in the Midnight section of the 2018 Sundance Film Festival. A24 will release it later this year.

Sign Up: Stay on top of the latest breaking film and TV news! Sign up for our Email Newsletters here.