Claude Code prompt: find out why ~/Library/Keyboard/VulgarWordUsage.db is missing on your Mac and make macOS create it A developer documented a Claude Code prompt that walks through diagnosing why macOS's ~/Library/Keyboard/VulgarWordUsage.db — the per-app SQLite store AppleSpell uses to learn which profanity a user will type — is missing, and how to make the OS itself create it. The prompt traces the file to TextInputCore's TI::VulgarWordUsageDatabaseWrapper, which initializes only when AppleSpell lazily spins up a TIKeyboardInputManager for a language in response to real inline-prediction requests, and notes the common cause is a missing ~/Library/Keyboard parent directory, since SQLite creates files but not directories. The procedure verifies the state via the unified log and dyld shared cache, creates the folder, restarts AppleSpell, drives real keystrokes through TextEdit, and confirms creation from the log rather than writing the database directly. I read https://helgesver.re/articles/macos-vulgar-word-flags https://helgesver.re/articles/macos-vulgar-word-flags about ~/Library/Keyboard/VulgarWordUsage.db, the per-app, per-recipient SQLite store macOS autocorrect uses to learn which swear words I am willing to type. The file does not exist on my Mac and I want to understand why and make macOS create it, without faking it: the OS must write the file, not you. What is already known, so you do not have to rediscover it: - AppleSpell the autocorrect XPC service at /System/Library/Services/AppleSpell.service hosts the iOS keyboard engine for inline predictive text. The database is created by TextInputCore's TI::VulgarWordUsageDatabaseWrapper the moment AppleSpell lazily initializes a TIKeyboardInputManager for a language. That happens once per AppleSpell process per language, and only when a real text view asks for inline predictions. Calling NSSpellChecker from a command-line tool does not reach that path. - The usual reason the file is missing is that ~/Library/Keyboard itself does not exist. SQLite creates missing files but never a missing parent directory, so the open fails with ENOENT and AppleSpell carries on with a NULL handle. The failure is visible in the unified log as a com.apple.libsqlite3 error naming the path. Do this, reading before concluding at every step: 1. Confirm the state on this machine: whether ~/Library/Keyboard and the .db exist, and whether the unified log holds a failed open of that path by AppleSpell. Use /usr/bin/log explicitly log is a zsh builtin . A log query over 30 days can take minutes; run it in the background rather than shrinking the window. 2. Confirm the code is present on this macOS version by searching the dyld shared cache under /System/Volumes/Preboot/Cryptexes/OS/System/Library/dyld/ for the string VulgarWordUsage, and the Lexicon private framework's exports for LXVulgarWordUsageDatabaseCreate. If it is absent, stop and report that instead of continuing. 3. If the folder is missing, create ~/Library/Keyboard, then restart AppleSpell with kill -9 on its pid it is relaunched on demand; a plain kill is ignored . 4. Start a background log stream for AppleSpell filtered to the com.apple.TextInput, com.apple.libsqlite3 and com.apple.Lexicon subsystems. Then drive real keystrokes into a new, unsaved TextEdit document with osascript and System Events, a sentence or two containing common profanity, and close that document without saving. Stop the stream afterwards. 5. Read the result: list ~/Library/Keyboard, dump the schema and all rows of VulgarWordUsage.db and AutocorrectionRejections.db with sqlite3 -readonly, and quote the TIKeyboardInputManagerLoader initialization line from the stream. Done means either the .db exists with a properties table holding version 2 and you have shown the log line proving AppleSpell created it, or you have shown exactly which step failed and what the log said. Do not create the database yourself with sqlite3 or by calling the Lexicon API; the point is to observe the OS do it. Expect vword usage to be empty afterwards: rows are only written when autocorrect proposes replacing a vulgar word and the user keeps the original, which rarely happens for correctly spelled words. You may create the folder, restart AppleSpell, run TextEdit through System Events and write scratch files in a fresh mktemp -d directory without asking. Do not change System Settings, do not touch any other file under ~/Library, and do not delete anything except files you created. Pause only if a step would need something other than that. Report in plain prose: what existed before, what the log showed, what you did, what exists now with the schema and row counts, and the one-line reason the file was missing on this Mac.