@rachel_rotenberg/ai-contribution-tracker

Tracks AI coding sessions in OpenCode 1.x, OpenCode 2.x and OmO Native and tags git commits with Impacted by AI markers

Packages

Package details

extension

Install @rachel_rotenberg/ai-contribution-tracker from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@rachel_rotenberg/ai-contribution-tracker
Package
@rachel_rotenberg/ai-contribution-tracker
Version
1.1.0
Published
Nov 7, 2026
Downloads
192/mo · 70/wk
Author
rachel_rotenberg
License
MIT
Types
extension
Size
70.4 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./senpi.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@rachel_rotenberg/ai-contribution-tracker

Tags git commits made after AI work with an Impacted by AI (...) marker. One package for:

Host Version Entry
OpenCode 1.x 1.18.29 or newer (tested on 1.19.5) index.ts (server)
OpenCode 2.x tested on 2.2.5 index.ts (setup)
OmO Native (omo, senpi engine) tested on omo 5.1.62 senpi.ts (pi package manifest)

Install

OpenCode 1.x and 2.x (macOS and Windows)

Add the package once, under plugin, in your OpenCode config (~/.config/opencode/opencode.json; on Windows %USERPROFILE%\.config\opencode\opencode.json):

{ "plugin": ["@rachel_rotenberg/ai-contribution-tracker"] }

Both majors read the plugin key, so one entry covers both. Do not also add it under OpenCode 2's plugins key: 2.x then loads it twice (the tracker ignores the second copy, but there is no reason to have it). npx @rachel_rotenberg/ai-contribution-tracker init writes this entry and installs the git hooks for you; the VS Code extension does the same automatically.

OmO Native

omo install npm:@rachel_rotenberg/ai-contribution-tracker

The package carries a pi manifest ("pi": { "extensions": ["./senpi.ts"] }), so omo loads only the OmO extension from it. To try it for one run without installing: omo -e npm:@rachel_rotenberg/ai-contribution-tracker.

Git hooks

On first load each host installs a global core.hooksPath (~/.config/ai-contribution-tracker/git-hooks unless you already have one) with a prepare-commit-msg stamp block and a post-commit block. Hooks are #!/bin/sh scripts; on Windows they run in Git for Windows' bundled sh.exe. Repo-local hooks (.git/hooks/*, Husky, LFS) keep running through delegating stubs. npx @rachel_rotenberg/ai-contribution-tracker remove uninstalls them.

What is reported

Impacted by AI (Agent mode: opencode/build | Model: claude-sonnet-4-6 | Prompts: 2 | Sub-agents mode: explore | sub-Agent prompts: 1 | Tokens: claude-sonnet-4-6: 41k in/1k out (38k cached))
Co-authored-by: OpenCode (claude-sonnet-4-6, 2p) <noreply@opencode.dev>
Field Source
Agent mode opencode/<agent> (OpenCode 1/2), omo/main (OmO)
Model models of the main agent
Prompts user prompts of the main agent (subagent and injected prompts excluded)
Sub-agents mode / sub-Agent prompts subagent types and count of subagent tool calls (task on OpenCode 1 and OmO, subagent on OpenCode 2)
Tokens per model, main agent only: in = input + cache read, cached = cache read, +N reasoning; model: unknown tokens when the host reported no usage

The repo is picked from the paths the agent's tools touch, never from the directory the host was started in, so a session opened in a parent folder of several repos stamps the repo actually edited. A subagent that works in another repo stamps that repo with the root agent and subagent type.

Known limits

  • OpenCode 1.x older than 1.18.29 does not accept object plugin entries; use plugin 1.0.x there.
  • Two processes writing the same repo's state at the same instant can lose one update (writes are atomic, so the file is never corrupted; the loss is bounded to one event).
  • Subagent tokens are not counted (same as 1.0.x).
  • in does not include cache writes (same as 1.0.x).
  • OmO task children run in OmO's task host, apart from the parent. A child cannot see its category, so a commit whose only AI work came from a child reads Sub-agents mode: task with no prompt or token counts (the parent's turn never touched a file). When the parent also edits files, the real category and the parent's counts are reported.
  • -e/--extension loads the OmO extension in the main session only; install it (omo install) so task children load it too.
  • Work done before any tool touches a file in a repo is kept in memory only; if the host exits first it is lost.