Automatic time tracking plugin for OpenCode. Tracks session duration and tool usage, writing entries to a CSV file compatible with Jira worklog sync.
Add to your opencode.json:
{
"plugin": ["@techdivision/opencode-time-tracking"]
}Add the time_tracking section to your .opencode/opencode-project.json:
{
"$schema": "https://raw.githubusercontent.com/techdivision/opencode-plugins/main/schemas/opencode-project.json",
"time_tracking": {
"csv_file": "~/time_tracking/time-tracking.csv",
"default_account_key": "YOUR_ACCOUNT_KEY"
}
}Set your user email via the OPENCODE_USER_EMAIL environment variable.
Add to your .env file (recommended):
OPENCODE_USER_EMAIL=your@email.comOr export in your shell:
export OPENCODE_USER_EMAIL=your@email.comIf not set, the system username is used as fallback.
- Tracks tool executions during each session turn
- Extracts JIRA ticket from git branch name (e.g.,
feature/PROJ-123-description) - Writes CSV entry when session becomes idle (after each complete response)
- Shows toast notification with tracked time
id,start_date,end_date,user,ticket_name,issue_key,account_key,start_time,end_time,duration_seconds,tokens_used,tokens_remaining,story_points,description,notes
| Event | When triggered |
|---|---|
session.idle |
After each complete AI response (including all tool calls) |