Skip to content

Capture Claude Code Skill tool usage in Skills Graph #190

@antejavor

Description

@antejavor

Problem

Skills Graph currently captures skill usage when the runtime emits normal tool events that expose a SKILL.md read. For example, when a skill reads another skill file through the Read tool, Claude Code emits PostToolUse, agent-context-graph normalizes it, and skills-graph records the USED_SKILL relationship.

Pure skill activation can be different. Claude Code can inject the selected skill content through its Skill tool without emitting a PreToolUse / PostToolUse payload that includes the skill content or skill path. In that case the connector has no event to inspect, so skills such as caveman are not recorded even though they were used.

Observed behavior

  • Reading SKILL.md via Read tool works and records usage.
  • Skills that read multiple other SKILL.md files are captured as separate file-read events.
  • Pure Skill tool injection does not record usage because no relevant hook event is emitted.
  • This is distinct from Codex sandbox/Memgraph reachability problems: Codex appears to expose skill file reads, but hook persistence can still fail if the sandbox blocks loopback access to Memgraph.

Desired behavior

Agent Context Graph should have a reliable path to record Skill tool usage from Claude Code into Skills Graph.

Proposed paths

  1. Preferred: Claude Code emits PreToolUse / PostToolUse for Skill tool usage, including at least skill name/path and ideally injected content.
  2. Short-term workaround: add an opt-in Claude Code Stop-hook transcript scan in agent-context-graph that reads transcript_path, extracts skill invocations or injected skill content, and emits normalized Event Protocol events for skills-graph.

Notes

Keep runtime-specific transcript parsing in agent-context-graph, not skills-graph. Skills Graph should continue consuming normalized events and deciding whether those events represent Skill Usage.

Acceptance criteria

  • Claude Code activation of a pure injected skill such as caveman records a USED_SKILL relationship.
  • Multi-file skill reads continue to record each valid SKILL.md read.
  • Transcript scanning, if implemented, is opt-in and documented.
  • Tests cover Skill tool injection/transcript-derived events separately from normal Read tool SKILL.md capture.

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