devkg-sparql

devkg-sparql is a skill for Claude Code, Codex 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 CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/robertoshimizu/session-graph/devkg-sparql
Any agent
npx skills add robertoshimizu/session-graph --skill devkg-sparql
Clone the repo
git clone --depth 1 https://github.com/robertoshimizu/session-graph

Made for: Claude Code, Codex.

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00068 $0.08712
Opus 5 $0.00034 $0.04356
Sonnet 5 $0.00014 $0.01742
Haiku 4.5 $0.00007 $0.00871

Measured 5d ago against content hash c6be999f049b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d 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. 5d 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 (110 stars, last pushed 1mo 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. 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 50+ 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 · 110 tokens

ontology-bootstrap

Build a trustworthy first ontology from an empty or near-empty ontology-atlas vault using only Atlas MCP evidence. Use when the user asks to analyze a codebase, bootstrap/fill its ontology, extract product meaning from a repository, or when a requested ontology task finds only starter nodes. Separate observed…

wlsdks/ontology-atlas · 129 tokens

ontology-field-trial

Measure whether Atlas actually works on a repository nobody here knows, by building a vault with a real MCP agent and then handing that vault — without the source — to a second agent who must answer questions from it alone. Use when changing the construction rules, the MCP read/write contract, the bootstrap skill, or…

wlsdks/ontology-atlas · 112 tokens

design-build

Build UI from this repository's primitives and ramps in a deterministic order, then prove the rendered result with the matching instruments and gates.

wlsdks/ontology-atlas · 29 tokens

design-audit

Audit a finished frontend change by measuring rendered rects and computed styles before using screenshots as human-checkable evidence.

wlsdks/ontology-atlas · 26 tokens