Skip to content

pi: native skill loads are counted as assistant read calls #588

Closed

Description

@alexei-led

Pi sessions can record skill loading as assistant read calls that load a skill's SKILL.md file.

CodeBurn appears to treat those events as ordinary assistant file reads instead of Pi skill loads. That can make Pi reporting misleading: sessions that used Pi skills may show extra assistant read activity while missing the skill dimension.

This may depend on how Pi skills are configured, but the distinction seems worth tracking in the Pi provider.

Activity

  1. changed the title [-]pi: native skill loads are interpreted as assistant read calls[/-] [+]pi: native skill loads are counted as assistant read calls[/+] on Jul 1, 2026
  2. ozymandiashh commented on Jul 1, 2026

    @ozymandiashh
    Collaborator

    On it

  3. ozymandiashh commented on Jul 1, 2026

    @ozymandiashh
    Collaborator

    Opened #590 for this.

    What I found

    Pi and OMP have no dedicated skill tool, so a native skill load shows up in the session log as an ordinary read tool call whose path is the skill's SKILL.md, e.g.:

    {"type":"toolCall","name":"read","arguments":{"path":".../.pi/skills/bmad-create-story/SKILL.md"}}

    The Pi/OMP parser (src/providers/pi.ts, shared by both) mapped every read to the Read tool and never touched the skills dimension. So there were actually two symptoms, not one:

    1. Reads over-counted — every skill load inflated the Read tally.
    2. Skills & Agents panel always empty for Pi/OMP — and this one is subtle: even if you just move SKILL.md reads out of tools into skills, the panel still stays empty, because skillBreakdown is populated only from a turn's subCategory, which the classifier sets only when the turn is general, which only happens when the tool list contains a literal Skill entry. Claude works because its parser keeps Skill in the tools list.

    What I did

    A skill-load read is now surfaced as the Skill tool (not Read) with the name recorded in skills, exactly mirroring how the Claude parser represents a skill invocation. That fixes both the Read over-count and makes skill usage flow into the Skills & Agents breakdown.

    Detection (skillLoadName): a read is a skill load when its path (arguments.path, with an arguments.file_path fallback) either has basename SKILL.md (skill name = parent directory) or is a skill://<name> URI used by newer OMP builds (skill name = the URI segment). Matching is on the SKILL.md basename rather than a directory prefix, since Pi resolves skills from many roots (~/.pi/agent/skills, project .pi/skills, .agents/skills, package skills/, --skill). bash command extraction is untouched, and a mixed skill+edit turn still classifies as coding with no subCategory, identical to Claude's existing behavior.

    Tests cover SKILL.md / skill:// / file_path detection, a normal read staying a Read, and an end-to-end check that a parsed skill load reaches the classifier subCategory that feeds skillBreakdown. tsc clean; pi/omp/classifier suites pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions