Count skills Codex loads by printing SKILL.md - #45
Merged
Merged
Conversation
Codex has no Skill tool; it loads a skill with a shell command such as `cat ~/.agents/skills/code-review/SKILL.md`. Extension usage only looked at Skill tool calls and SKILL.md reads through file tools, so Codex skill use never registered. Shell commands that print SKILL.md files (cat/sed/head/..., through rtk or sh -c wrappers) now count as skill reads, using the full command when the stored target is clipped. One command can load several skills, so extension_uses is keyed by (event_id, ord); the derived table is rebuilt on upgrade.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Codex has no Skill tool. It loads a skill with a shell command like
cat ~/.agents/skills/code-review/SKILL.md. Extension usage only counted Skill tool calls and SKILL.md reads through file tools, so Codex skill use never showed up (e.g. Codex session01a1056e-0eb9-7d11-8b11-0f70c7128c0dloadedcode-review,i-have-adhdandunslopin onecat; none registered).Change
SKILL.mdfiles (cat/sed/head/…, also viartk proxyorsh -c) count as skill reads. The full command comes fromdetail.commandwhen the stored target is clipped at 120 chars. Writing, listing or grepping a skill file does not count.extension_usesis keyed by(event_id, ord). The table is derived from events, so_migratedrops and recreates it;USAGE_VERSIONbump refills it.via: "read", so they still fold into a nearby Skill tool load instead of double counting.Testing
test_codex_shell_skill_reads_count_as_loads; full backend suite passes (404), ruff clean.🤖 Generated with Claude Code