The system, plainly
The government department for the invisible
A retelling, not a citation. What follows is the story as the most widely circulated popular accounts tell it — folklore encyclopedias, translations, and the versions that have travelled furthest. It is synthesized rather than keyed line by line to the dated primary texts, and popular versions drift from what those texts actually say. The cited, source-by-source record begins further down this page, and where the two disagree, the record wins.
Japan's monsters had a civil service.
Not a metaphorical one. An actual bureau, in the actual government, with a founding statute, a budget, an examination system, career grades, and a seventeen-hundred-year employment history.
Onmyōdō — the "way of yin and yang" — was institutionalized by the Taihō Code in 701 as the Onmyōryō, the Bureau of Onmyō.
What the bureau actually did
Its duties were a strange mixture by modern lights, and completely coherent by its own.
Calendars. Someone has to determine when the year starts and which days are which. That was them.
Astronomical observation. Recording what the sky did, and reporting anything anomalous, because anomalies in the sky were state business.
Timekeeping for the court.
And: protective magic against disasters and disease.
All four of those were the same job. If you believe the cosmos is a system whose state can be read and whose adverse conditions can be mitigated, then the astronomer and the exorcist are the same official with the same training.
They were who you called
Everything in this collection that happened to the court has this bureau's fingerprints on it.
A black cloud with a voice in it settles over the palace and the emperor sickens — the diviners identify it, and an archer is dispatched.
The emperor's favourite consort is beautiful, brilliant, and somehow killing him — an onmyōji named Yasuchika runs the divination and names her as a fox.
Plagues, droughts, comets, fires, and the string of imperial deaths that got blamed on an exiled scholar's ghost.
Those aren't folk tales that happened to involve the government. They are the bureau's paperwork, retold.
The compliance regime
This is the part that's hard to believe until you look at the diaries.
Katatagae — "direction-changing."
The system held that on certain days, travel in certain directions was inauspicious. And the Heian aristocracy complied, seriously, with real logistical cost.
If you needed to go somewhere in a forbidden direction, you didn't go. You went somewhere else first, slept there overnight, and set out again the next day — because you were now departing from a different point, so the bearing was different, so the taboo was satisfied.
People did this constantly. Court diaries are full of it. Appointments got moved. Visits were rerouted. Nights were spent in other people's houses purely to reset a compass bearing.
The Heian elite lived inside a regulatory regime administered by ghost- bureaucrats, and they experienced the supernatural much less as terror than as paperwork.
It got built into the cities
The northeast is the kimon — the demon gate, the unlucky quarter.
And this is katatagae frozen into urban planning.
Enryaku-ji on Mount Hiei guards Kyoto's northeast. Kan'ei-ji was built to guard Edo Castle's. The wall of the Kyoto Imperial Palace is notched at that corner — the corner is simply removed, so there's no northeast angle for anything to come in through.
You can go and look at that notch. It is a piece of defensive architecture aimed at a direction.
And it became Japanese
Onmyōdō arrived as Chinese cosmology. From about the ninth century it began interacting with Shinto, and with the goryō cult — the practice of pacifying wrathful spirits by enshrining them — and became a system that exists nowhere else.
Which means the great ghost-settlements were partly bureau productions. When a dead courtier's spirit was answered with restored titles, a struck record, and a national shrine, there were officials advising on that, with training and a rank.
The employment history
Here's the thing I find most remarkable.
701 — founded, by statute.
Then centuries of operation, with the Abe family — Seimei's line — dominant, and their descendants the Tsuchimikado holding a hereditary monopoly on the practice for generations.
1870 — abolished. The Meiji government, modernizing and rationalizing, prohibited onmyōdō outright.
1954 — refounded, as Tensha Tsuchimikado Shintō, once postwar religious freedom made it possible again.
Founded 701. Abolished 1870. Back in 1954.
An eleven-hundred-and-seventy-year run, one formal abolition, and a return.
Whatever else the yokai were, they had professional opposite numbers with a pension scheme — and those opposite numbers outlasted the imperial court, the shogunate, and the government that fired them.
Field guide
At a glance
- Behavior
- Not a spirit but the state's spirit-facing bureaucracy: the Way of Yin and Yang, an imperial ministry of divination, calendar-keeping, directional taboo, and exorcism that ran for over a millennium.
- Powers
- Its officers read omens, timed everything from coronations to haircuts, neutralized curses, and bound shikigami — spirit-servants on administrative leash.
- Weaknesses
- Politics and modernity: rivalries in life, then formal abolition by Meiji decree in 1870 — the only entry here terminated by legislation.
- Oddities
- Directional taboo (katatagae) meant aristocrats routinely spent the night at a friend's house to avoid traveling an unlucky bearing — the commute as ritual chess.
- Its star practitioner, Abe no Seimei, so outgrew the ministry that the office became his legend's supporting cast; the hereditary Tsuchimikado line ran the calendar into the nineteenth century.
Overview
The tradition's monsters had a government agency. Onmyōdō — the "way of yin-yang," Chinese cosmology institutionalized by the Taihō Code in 701 as the Onmyōryō bureau — staffed the court with professional diviners whose duties ran from calendars and star records to protective magic against disasters and disease [wikipedia-onmyodo]. When the palace saw a nue or a possessed consort, the onmyōji were who you called: the tradition's case files (Seimei's fox-huntings, Yasuchika's Tamamo divination, the exorcism-scroll trade of the hyakki-yagyo nights) are this bureau's paperwork.
The record
- Japanization: from the 9th century it "interacted with Shinto and Goryō worship... and developed into a system unique to Japan" [wikipedia-onmyodo] — the goryō settlements (michizane) were partly onmyōdō productions.
- Katatagae: the directional-taboo system — nobles routing journeys around unlucky bearings, sleeping elsewhere to reset a direction [wikipedia-onmyodo]; the kimon architecture (oni) is katatagae frozen into city planning. Heian aristocrats lived inside a compliance regime administered by ghost-bureaucrats — the tradition's world was, for its elites, regulatory.
- Seimei's afterlife: Emperor Ichijō raised his shrine [wikipedia-onmyodo]; seimei entry's 1007 date.
- The end and echo: the Tsuchimikado (Abe-descendant) monopoly carried it to the 1870 Meiji prohibition; postwar religious freedom allowed the 1954 revival as Tensha Tsuchimikado Shintō [wikipedia-onmyodo]. The office of the invisible: founded 701, abolished 1870, refounded 1954 — an 1,170-year employment history for the yokai's opposite numbers.
Two-track labeling
The image

Citations
The record
- [wikipedia-onmyodo]"Onmyōdō," Wikipedia (retrieved 2026-07-25), Tier C.modern reference English Wikipedia's article on this subject, as retrieved in 2026 — an aggregate starting point, not a primary source.All-source record
Where the evidence thins
Open questions
- Shikigami (the servant spirits) — thin in this fetch; own entry.
- Katatagae mechanics detail.
- The Tsuchimikado history (Fukui's onmyōdō village).