OpenCode

OpenCode usage on Windows

Track OpenCode usage on Windows: local tokens, requests, models, and sessions in UsageAtlas, the same app that runs on macOS and Linux.

Quick answer

On Windows, OpenCode stores its data under `%APPDATA%\opencode`, with older versions using a `storage` folder and newer ones a SQLite database. UsageAtlas runs on Windows 10 and 11, reads that folder, and shows tokens, cost, and sessions. If you run OpenCode in WSL, the data lives in the Linux home directory instead.

Find the folder

echo %APPDATA%
dir "%APPDATA%\opencode"
dir "%LOCALAPPDATA%\opencode"
InstallLikely path
Native Windows`%APPDATA%\opencode`
Older build`%APPDATA%\opencode\storage`
WSL`\\wsl$\<distro>\home\<user>\.local\share\opencode`
Custom XDG`%XDG_DATA_HOME%\opencode`

Read it in a desktop app

  1. Install UsageAtlas for Windows.
  2. Let it detect OpenCode, or paste the folder path.
  3. Open History and pick 30 days.
  4. Pin the app to the tray if you want it always available.

When nothing appears

  • The session may still be open; some fields are written at the end.
  • A WSL install writes to a different filesystem.
  • A version change may have moved from JSON files to SQLite.
  • File permissions can block a second user account.

The OpenCode usage not showing guide has the full diagnostic order.

OpenCode on Windows: paths and pitfalls

OpenCode runs on Windows, but two setups cause most missing-data reports: running it inside WSL while looking for files on the Windows side, and installing through a package manager that keeps the data in a different profile.

  1. Confirm where you launch the CLI: PowerShell or a WSL shell.
  2. Check the data directory from inside that environment.
  3. Point the tracker at the matching path.
  4. Run SQLite reads on a copy if the database is locked.

UsageAtlas runs natively on Windows 10 and 11. The usage tracker guide covers detection, and usage not showing covers the failure cases.

Questions, answered

Where is the OpenCode data folder on Windows?

Usually %APPDATA%\opencode. Check %LOCALAPPDATA% and a custom XDG_DATA_HOME if it is not there.

Does OpenCode work in WSL?

Yes, and its data stays inside the Linux filesystem. Point the tracker at the WSL path.

Can I move OpenCode data to another drive?

Yes, by setting XDG_DATA_HOME or a supported data directory variable, then pointing the tracker at the new location.

Browse by topic