OpenCode

OpenCode usage on Mac

Track OpenCode usage on macOS from the menu bar. Data paths, permissions, and how to read tokens by model and session.

Quick answer

OpenCode stores data in `~/.local/share/opencode` on macOS, following the XDG layout rather than the Library folder. UsageAtlas runs as a menu bar app, reads that directory, and shows tokens and cost by session and model. If the folder is missing, check `XDG_DATA_HOME` and whether OpenCode has run at least once.

Where macOS keeps it

ItemPath
Data`~/.local/share/opencode`
Config`~/.config/opencode`
Custom data`$XDG_DATA_HOME/opencode`
App`/Applications/UsageAtlas.app`
ls -la ~/.local/share/opencode
echo $XDG_DATA_HOME

Set up the menu bar view

  1. Download the .dmg from UsageAtlas and install it.
  2. Launch and allow access to your home folder.
  3. Confirm OpenCode is detected.
  4. Open History for the daily trend.

macOS may hide dotfolders in Finder. Use the app's folder picker or press Cmd+Shift+G to go to the path directly.

What to expect

  • Local token and cost history for OpenCode sessions.
  • No provider balance, because that is not in the local data.
  • No cloud aggregation unless you enable sync.
  • Cost accuracy depends on provider-reported pricing.

OpenCode on macOS: where to look

On macOS the database lives under your home directory in a hidden application-data folder, which Finder hides. The CLI reads it directly; for a manual check, Terminal and any SQLite viewer will do.

  1. List the application data folder and find the OpenCode directory.
  2. Confirm the database file exists and changes after a session.
  3. Back it up before upgrading a major version.
  4. Point UsageAtlas at the path if auto-detection fails.

The database location guide lists the exact folder names, and the Linux guide covers the equivalent path.

Questions, answered

Where does OpenCode store data on Mac?

In ~/.local/share/opencode by default, or under XDG_DATA_HOME if set.

Does UsageAtlas support Apple silicon?

Yes. The macOS build is signed, notarized, and runs natively.

Why can I not find the OpenCode folder in Finder?

It is a hidden dotfolder. Use Go to Folder with the full path, or let the tracker detect it.

Browse by topic