neo4j-query-tuning-skill

neo4j-query-tuning-skill is a skill for Claude Code from neo4j-contrib/neo4j-skills. It costs 202 tokens per session (2,823 once invoked), scanned A, original, MIT.

A guide for finding why Neo4j graph-database queries written in Cypher are slow and choosing targeted fixes.

In plain words
What is it for?
Use it to compare EXPLAIN and PROFILE output, identify scans or inefficient joins, assess indexes and hints, choose runtimes, and monitor active queries.
Why use it?
It makes execution plans and performance measurements easier to interpret, so bottlenecks are addressed instead of guessed at.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the neo4j-skills plugin — 29 skills, 1 command shipped together

not rated 109repo +2 5d ago A scan Socket: passSnyk: passSkillSpector: warn 202 tokens original MIT

Good fit Use it to compare EXPLAIN and PROFILE output, identify scans or inefficient joins, assess indexes and hints, choose runtimes, and monitor active queries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/neo4j-contrib/neo4j-skills/neo4j-query-tuning-skill
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.

Any agent
npx skills add neo4j-contrib/neo4j-skills --skill neo4j-query-tuning-skill
Clone the repo
git clone --depth 1 https://github.com/neo4j-contrib/neo4j-skills

Made for: Claude Code.

Or install neo4j-skills, the plugin that ships this one along with the rest of its 29 skills, 1 command.

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 neo4j-query-tuning-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/neo4j-contrib/neo4j-skills/neo4j-query-tuning-skill/github.svg)](https://agentmods.dev/skills/neo4j-contrib/neo4j-skills/neo4j-query-tuning-skill)
Your own site
<a href="https://agentmods.dev/skills/neo4j-contrib/neo4j-skills/neo4j-query-tuning-skill"><img src="https://agentmods.dev/badge/skills/neo4j-contrib/neo4j-skills/neo4j-query-tuning-skill/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 neo4j-query-tuning-skill

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

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 →

  • medium Data Exfiltration · line 52
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
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.00202 $0.02823
Opus 5 $0.00101 $0.01411
Sonnet 5 $0.00040 $0.00565
Haiku 4.5 $0.00020 $0.00282

Measured 12d ago against content hash 120da31415e2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

neo4j-query-tuning-skill scanned grade A with 1 finding 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 12d 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.

Makes network callslowCapability

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

curl -X POST https://<host>/db/<db>/query/v2 \
neo4j-query-tuning-skill/SKILL.md · 277 lines

How it starts

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

When to Use

  • Query takes unexpectedly long; need root-cause analysis
  • EXPLAIN/PROFILE output in hand — needs interpretation
  • Identifying which index is missing or unused
  • Deciding between slotted / pipelined / parallel runtimes
  • Monitoring live queries: SHOW QUERIES, SHOW TRANSACTIONS
  • Cardinality estimates wrong (plan replanning needed)

When NOT to Use

  • Writing Cypher from scratchneo4j-cypher-skill
  • GDS algorithm performanceneo4j-gds-skill
  • Schema design / data modellingneo4j-modeling-skill

EXPLAIN vs PROFILE

EXPLAIN PROFILE
Executes query? No Yes
Returns data? No Yes
Shows rows (actual) No Yes
Shows dbHits (actual) No Yes
Shows estimatedRows Yes Yes
Cost Zero Full query cost

Run PROFILE twice — first run warms page cache; second gives representative metrics.

EXPLAIN MATCH (p:Person {email: $email}) RETURN p.name
PROFILE MATCH (p:Person {email: $email}) RETURN p.name

Query API alternative (no driver):

curl -X POST https://<host>/db/<db>/query/v2 \
  -u <user>:<pass> -H "Content-Type: application/json" \
  -d '{"statement": "EXPLAIN MATCH (p:Person {email: $email}) RETURN p.name", "parameters": {"email": "[email protected]"}}'

Key Plan Metrics

Metric Good Investigate if
dbHits Low; drops after index added High relative to rows
rows Shrinks early in plan Large until final operator
estimatedRows Close to rows >10× divergence from actual
pageCacheHitRatio >0.99 <0.90 (disk I/O bottleneck)
pageCacheHits High
pageCacheMisses Near 0 Rising (page cache too small)

Read plans bottom-up — leaf operators at bottom initiate data retrieval.


Operator Reference

Operator Good/Bad Meaning Fix
NodeIndexSeek Exact match via RANGE/LOOKUP index
NodeUniqueIndexSeek Unique constraint index hit
NodeIndexContainsScan TEXT index CONTAINS / STARTS WITH
NodeIndexScan ~ Full index scan (no predicate) Add WHERE predicate or composite index
NodeByLabelScan Scans all nodes of label Add RANGE index on lookup property
AllNodesScan ✗✗ Scans entire node store Add label + index to MATCH
Expand(All) ~ Traverse relationships from node Normal; limit with LIMIT or WHERE
Expand(Into) ~ Find rels between two matched nodes Normal for known-endpoint joins
Filter ~ Predicate applied after scan Move predicate into WHERE with index
CartesianProduct No join predicate between two MATCH Add WHERE join or use WITH between MATCHes
NodeHashJoin ~ Hash join on node IDs Normal; planner chose hash join
ValueHashJoin ~ Hash join on values Normal; watch memory for large inputs
EagerAggregation ~ Full aggregation (ORDER BY, count(*)) Normal for aggregates
Aggregation Streaming aggregation
Eager Read/write conflict; materialises all rows See Eager fix strategies below
Sort ~ Full sort — O(n log n) Add LIMIT before Sort; push LIMIT earlier
Top Sort+Limit combined — O(n log k) Preferred over Sort+Limit
Limit Truncates rows early Push as early as possible
Skip ~ Offset pagination Use keyset pagination on large graphs
ProduceResults Final output operator Root of tree
UndirectedRelationshipByIdSeekPipe ~ Lookup by relationship ID Avoid id(r) — use elementId(r)

Read the full file on GitHub · 277 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 277 lines · 202 tokens per session scan A 120da31415e2

Subscribe to this mod's changes

neo4j-query-tuning-skill is a skill published in the GitHub repository neo4j-contrib/neo4j-skills (109 stars, last pushed 5d ago), licensed MIT. It adds 202 tokens to every session and 2,823 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 1 finding (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

bullmq-specialist

BullMQ expert for Redis-backed job queues, background processing, and reliable async execution in Node.js/TypeScript applications. Use when: bullmq, bull queue, redis queue, background job, job queue.

agent-skills-hub/agent-skills-hub · 47 tokens

results-storage

SQLite-based persistent storage and reporting system for penetration testing results. Use this skill when user needs to store scan results, query vulnerabilities, generate reports, or manage pentest data across sessions.

crazyMarky/pentest-skills · 40 tokens

exploit-sqli

SQL injection detection and exploitation using sqlmap, manual techniques, and custom payloads. Use this skill when user needs to test for SQL injection vulnerabilities, extract database information, or exploit SQLi in parameters, headers, or cookies.

crazyMarky/pentest-skills · 51 tokens

backend-patterns

Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.

agent-skills-hub/agent-skills-hub · 31 tokens

clickhouse-io

ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

agent-skills-hub/agent-skills-hub · 26 tokens

chembl-database

Query ChEMBL bioactive molecules and drug discovery data. Search compounds by structure/properties, retrieve bioactivity data (IC50, Ki), find inhibitors, perform SAR studies, for medicinal chemistry.

agent-skills-hub/agent-skills-hub · 45 tokens