session-graph: Skill for Claude Code

.claude/skills/devkg-sparql/SKILL.md

devkg-sparql is a skill for Claude Code from robertoshimizu/session-graph. It costs 68 tokens per session (8,712 once invoked), scanned B, original, Apache-2.0.

A query tool for a developer knowledge graph, a database of technologies, relationships, and information from past coding sessions. It uses SPARQL, a language for asking structured questions about linked data.

In plain words
What is it for?
It is for finding where a topic was discussed, checking known relationships between tools, and retrieving small, source-linked pieces of development history.
Why use it?
It helps locate relevant past discussions and technology relationships without searching through large raw session files.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents; positional $N argument.

This is robertoshimizu/session-graph's own configuration. It tells Claude Code how to work on session-graph itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything session-graph configures →

Reuse

Borrowing it

Nothing to install: this file belongs to robertoshimizu/session-graph. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/robertoshimizu/session-graph/main/.claude/skills/devkg-sparql/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/robertoshimizu/session-graph

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for devkg-sparql

README.md
[![agentmods](https://agentmods.dev/badge/skills/robertoshimizu/session-graph/devkg-sparql/github.svg)](https://agentmods.dev/skills/robertoshimizu/session-graph/devkg-sparql)
Your own site
<a href="https://agentmods.dev/skills/robertoshimizu/session-graph/devkg-sparql"><img src="https://agentmods.dev/badge/skills/robertoshimizu/session-graph/devkg-sparql/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for devkg-sparql

Your own site · 80×15
<a href="https://agentmods.dev/skills/robertoshimizu/session-graph/devkg-sparql"><img src="https://agentmods.dev/badge/skills/robertoshimizu/session-graph/devkg-sparql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,712 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Agent Snooping · line 68
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00068 $0.08712
Opus 5.5 $0.00027 $0.03485
Sonnet 5.5 $0.00014 $0.01742
Haiku 4.5 $0.00007 $0.00871

Measured 1mo ago against content hash c6be999f049b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

devkg-sparql scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

grep -rli "keyword" ~/.claude/projects ~/.pi/agent/sessions ~/.cursor/projects 2>/dev/null | head -20

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Bash(curl:*)
.claude/skills/devkg-sparql/SKILL.md · 782 lines

How it starts

The opening of the file, as written. The whole thing — 782 lines — stays where its author put it; the contents beside it link to each section on GitHub.

DevKG SPARQL Query Skill

CRITICAL CONTEXT-SAFETY RULE

NEVER READ LARGE SPARQL RESULTS, SESSION FILES, JSONL, LOGS, OR GENERATED ARTIFACTS ALL AT ONCE. Always add LIMIT, select only needed variables, inspect counts first, and summarize. Never dump huge result sets, ID lists, raw JSON, or transcript content into chat.

Query the developer knowledge graph at http://localhost:3030/devkg/sparql via SPARQL. This graph contains extracted knowledge triples, entities, Wikidata links, and session metadata from Claude Code, pi, Codex, Cursor, ChatGPT, DeepSeek, Grok, and Warp sessions.

Content limit: sioc:content on messages is capped at ~2000 characters at ingest. SPARQL is enough to locate sessions and reason lightly from triples + snippets. For full quotes or deep thread reconstruction, normalize hasSourceFile and read the JSONL only when needed.

Retrieval Strategy (read this first)

User intent Do this first Do NOT start with
"Where / which sessions discussed X?" Template 5 (topic + intent + provenance) Label-only Template 6, or grep
"What do we know about technology X?" Template 1 (entity + provenance) Grep
"How does X relate to Y?" Template 2 Grep
"Find the exact message wording" Template 5 or 9 → then JSONL only if snippet truncated Grepping all projects

Default for session-discovery questions: multi-signal filter (topic and intent terms) on both triple labels and sioc:content, always joining extractedFrom / extractedInSession, ordered by DESC(?created), with LIMIT.

When Fuseki returns provenance hits, do not fall back to grep. Grep only if Fuseki is down or returns 0 rows after a provenance query.

Execution Pattern

Always use this pattern (POST, URL-encoded query, JSON output). Include Fuseki auth when required:

curl -s -X POST 'http://localhost:3030/devkg/sparql' \
  -u admin:admin \
  -H 'Accept: application/sparql-results+json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode "query=YOUR_SPARQL_HERE" \
  | jq -r '.results.bindings[] | [.var1.value, .var2.value] | @tsv'

Read the full file on GitHub · 782 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 782 lines · 68 tokens per session scan B c6be999f049b

Subscribe to this mod's changes

devkg-sparql is a skill published in the GitHub repository robertoshimizu/session-graph (115 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 68 tokens to every session and 8,712 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 2 findings (reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

graph-mutation-plan

Cookbook for composing an applygraphmutations plan — stable entitykey patterns, the canonical label/edge vocabulary, evidence/invalidation/confidence discipline, and a worked example. Load this when building a non-trivial mutation plan.

potpie-ai/potpie · 51 tokens

open-ontologies

AI-native ontology engineering using 110 MCP tools backed by an in-memory Oxigraph triple store. Build, validate, query, and govern RDF/OWL ontologies with a generate-validate-iterate loop. Use when building ontologies, knowledge graphs, RDF data, SPARQL queries, BORO/4D modeling, SHACL validation, clinical…

fabio-rovai/open-ontologies · 109 tokens

ontology-engineering

Build, validate, and govern RDF/OWL ontologies using the Open Ontologies MCP server. Use when the user asks to create, modify, query, or manage ontologies, knowledge graphs, or RDF data.

fabio-rovai/open-ontologies · 47 tokens

mykg

Run mykg knowledge-graph commands inside Claude Code from one slash command /mykg. The user describes intent in natural language (extract, append, sync, resume, approve, walkthrough, parse-docs, fetch-web, query); the skill parses intent, builds the right mykg CLI command from the live --help output, confirms, runs…

SenolIsci/mykg · 175 tokens

atlas-absorb

A document-reading skill that finds concepts in meeting notes, plans, or pull-request descriptions and connects them to an existing knowledge graph. A knowledge graph stores concepts and their relationships.

wlsdks/ontology-atlas · 76 tokens

atlas-grow

A Korean-language planning procedure for deciding what knowledge or structure should be added to a vault. A vault here is a managed collection of linked concepts, evidence, and project information.

wlsdks/ontology-atlas · 79 tokens