What it captures
For each AI assistant message in your OpenCode session, the plugin records:| Data | Description |
|---|---|
| Model and provider | Which LLM model and provider was used (e.g., Claude Sonnet 4 via Anthropic) |
| Token usage | Input tokens, output tokens, reasoning tokens, cache reads, and cache writes |
| Cost | Dollar cost of the interaction |
| Git context | Repository URL, branch name, and current commit SHA |
| Commit detection | When a git commit or git merge happens during a session, the plugin captures the commit SHA |
| Session metadata | Session ID, title, agent type, whether it is a sub-agent |
Installation
Authenticate
The first time you use OpenCode with the plugin installed, it will prompt you to authenticate:
- A browser window opens for you to sign in (same account as the Periscope dashboard)
- After signing in, you are redirected back automatically
- The plugin stores your credentials and refreshes them as needed
How it works
The plugin runs in the background during your OpenCode session. It does not interfere with the assistant or slow down your workflow.- After each assistant message, the plugin extracts model, provider, token counts, cost, and git context, then sends an analytics event to Periscope asynchronously.
- When a git commit or merge happens, the plugin detects the commit SHA and associates it with your session. This is how Periscope connects AI-assisted coding to specific commits — enabling traceability from “AI wrote this code” to “this commit was deployed.”
Privacy and security
- The plugin does not send code content, file contents, or conversation messages to Periscope
- Only metadata (model, tokens, cost, git refs) is captured
- Authentication uses industry-standard OAuth 2.0
- All data is transmitted over HTTPS
Troubleshooting
Authentication prompt does not appear
Authentication prompt does not appear
Ensure the plugin is correctly listed in your
opencode.json. Check that port 14550 is not in use by another process.Events not appearing in the dashboard
Events not appearing in the dashboard
Verify your
~/.config/opencode/analytics.json has the correct endpoint URL. Check that you have completed the authentication flow at least once. Events are sent asynchronously — there may be a short delay.Authentication errors after inactivity
Authentication errors after inactivity
If you see authentication errors after a period of inactivity, restart OpenCode. The plugin will prompt you to sign in again.
Git context missing
Git context missing
Make sure you are running OpenCode from within a git repository. If the repo URL, branch, or SHA fields are empty in the dashboard, the plugin could not detect a git repository in your working directory.
Analytics dashboard
View your AI coding analytics in the Periscope dashboard.