Skip to content
Hassam on Code
Go back

macOS KnowledgeC.db and What Your Mac Remembers

macOS KnowledgeC.db and What Your Mac Remembers

I saw this tweet from Peter Cooper about a macOS database I had never really looked at before:

~/Library/Application Support/Knowledge/knowledgeC.db

The idea was: ask an agent to inspect this file and see what it can figure out about your activity.

Someone in the replies also mentioned another path worth knowing about:

~/Library/Biome/

Apparently newer versions of this kind of local activity data may live there too. The files are not as straightforward as a normal SQLite database, but the general point is the same: there is more local context on a Mac than most of us think about day to day.

That made me curious because this is not some random app database. It is a local macOS database used by the system itself. And because it is local, it is easy to forget that it can still contain useful context about what you do on the machine.

What Is KnowledgeC.db?

knowledgeC.db is a SQLite database used by macOS as part of Apple’s local activity and intelligence features.

Depending on your macOS version and settings, it can include records related to app usage, interaction history, and other device activity.

macOS may keep a local timeline of activity that can reveal patterns in your workflow.

I am not saying this means the data is being uploaded somewhere. The point is smaller than that: local data is still data. If a tool can read it, it may be able to summarize more than you expected.

Why This Matters

A database like this may show things like:

One row in the database might not be interesting. A lot of rows together can be.

That was the part I found interesting. The privacy issue is not always the raw data. Sometimes it is what can be inferred from it.

If You See “Authorization Denied”

On modern macOS, you may run into an error like this when trying to open the database:

Error: unable to open database "/Users/xxxx/Library/Application Support/Knowledge/knowledgeC.db": authorization denied

This is expected on newer macOS versions. Terminal does not automatically have permission to access the Knowledge directory, even though the file is inside your own home folder.

Fix 1: Give Terminal Full Disk Access

  1. Open System Settings
  2. Go to Privacy & Security -> Full Disk Access
  3. Click +
  4. Add Terminal, or your terminal app such as iTerm2
  5. Turn the permission on
  6. Quit Terminal completely and reopen it

Then try opening the database again:

sqlite3 "$HOME/Library/Application Support/Knowledge/knowledgeC.db"

You can also test file access first:

ls -l "$HOME/Library/Application Support/Knowledge/knowledgeC.db"

Fix 2: Work From a Copy

Once Terminal has permission, I would copy the database instead of opening the live database directly:

cp "$HOME/Library/Application Support/Knowledge/knowledgeC.db" ~/Desktop/knowledgeC.db

How To Inspect It Safely

If you want to look at the database on your own Mac, inspect a copy:

cp "$HOME/Library/Application Support/Knowledge/knowledgeC.db" /tmp/knowledgeC-copy.db

Then open the copy with SQLite:

sqlite3 /tmp/knowledgeC-copy.db

Inside SQLite, you can list the tables:

.tables

And inspect the schema:

.schema

The schema may differ across macOS versions, so I would start with .tables and .schema instead of assuming table names from someone else’s machine.

Prompt

look at ~/Library/Application Support/Knowledge/knowledgeC.db and tell me some interesting facts


Share this post:

Next Post
Links to Improve LLM Experience