Skip to content

Conversation

@stbenjam
Copy link
Member

@stbenjam stbenjam commented Oct 17, 2025

Mock-up for collecting anonymous usage metrics on AI helper commands. Backend API isn't implemented yet.

Installs a UserPromptSubmit hook to look for slash commands, and sends them to our anonymous metrics usage tracking service.

The user has to opt-in to the plugin to make this work, though.

Example of what's sent:

[2025-10-21T14:33:53+00:00Z] Sending metrics: {"type": "slash_command", "name": "ci:ask-sippy", "engine": "claude", "version": "1.0", "timestamp": "2025-10-21T14:33:53+00:00Z", "session_id": "abbba331-eeff-41d1-89d5-b57f206defb5", "os": "darwin", "mac": "9ff1f8981086488424e994a57a50789e23a996b03294ec44bb5a18b428dce144", "prompt_length": 25}

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 17, 2025
@openshift-ci openshift-ci bot requested a review from bentito October 17, 2025 15:41
@openshift-ci
Copy link

openshift-ci bot commented Oct 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: stbenjam

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot requested a review from bryan-cox October 17, 2025 15:41
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 17, 2025
@enxebre
Copy link
Contributor

enxebre commented Oct 20, 2025

thanks, this is great! dropped some feedback.

@stbenjam stbenjam force-pushed the metrics branch 2 times, most recently from 9febe2e to 6b9f2e7 Compare October 21, 2025 14:40
@stbenjam
Copy link
Member Author

The hooks approach works, but requires the user to install the plugin.

Installs a `UserPromptSubmit` hook to look for slash commands, and sends
them to our anonymous metrics usage tracking service.

Example of what's sent:
```
[2025-10-21T14:33:53+00:00Z] Sending metrics: {"type": "slash_command", "name": "ci:ask-sippy", "engine": "claude", "version": "1.0", "timestamp": "2025-10-21T14:33:53+00:00Z", "session_id": "abbba331-eeff-41d1-89d5-b57f206defb5", "os": "darwin", "mac": "9ff1f8981086488424e994a57a50789e23a996b03294ec44bb5a18b428dce144", "prompt_length": 25}
```
@theobarberbany
Copy link
Contributor

The hooks approach works, but requires the user to install the plugin.
Hmm - could we use team plugins?

To set up team plugins:
Add marketplace and plugin configuration to your repository’s .claude/settings.json
Team members trust the repository folder
Plugins install automatically for all team members

@stbenjam
Copy link
Member Author

The hooks approach works, but requires the user to install the plugin.
Hmm - could we use team plugins?

To set up team plugins:
Add marketplace and plugin configuration to your repository’s .claude/settings.json
Team members trust the repository folder
Plugins install automatically for all team members

This sounds like more work than just installing the metrics plugin (more or less a one-liner), as teams would have to clone ai-helpers vs. consuming it from github, setup trust, etc right?

@theobarberbany
Copy link
Contributor

Ah - that wasn't how I was thinking it could be used.

I'm not sure team members would have to clone the ai-helpers repo (I've also not tested this :) ).

I think you can specify plugins e.g in team owned repos, so one person PRs these changes to.claude-plugin/marketplace.json and sections in .claude/settings.json that specify we want to have the metrics tracking plugin?

This way, If I'm reading the docs right you can opt in a repository vs per user?

I'm skimming https://skywork.ai/blog/claude-code-plugin-standardization-team-guide/

but something like

cat .claude/settings.json
{
  "extraKnownMarketplaces": [
    {
      "name": "org-standard",
      "url": "https://raw.githubusercontent.com/openshift-eng/ai-helpers/main/.claude-plugin/marketplace.json",
      "trusted": true
    }
  ],
  "enabledPlugins": [
    "[email protected]",
  ],
  "requireRepoTrust": true,
  "notes": "Pin plugin versions to ensure reproducible behavior across contributors."
}
cat .claude-plugin/marketplace.json
{
  "name": "ai-helpers",
  "description": "Curated, approved Claude Code plugins for org-wide use.",
  "plugins": [
    {
      "id": "ai-helpers.metrcs",
      "version": "1.2.3",
      "source": {
        "type": "git",
        "url": "https://github.com/openshift-eng/main/plugins/metrics",
        "ref": "v1.2.3"
      }
    }
  ]
}

@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants