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 — 30 skills, 1 command shipped together

not rated 116repo changed 7d 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 30 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 20 Oct 2026
  • Snyk pass 20 Oct 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.5 $0.00081 $0.01129
Sonnet 5.5 $0.00040 $0.00565
Haiku 4.5 $0.00020 $0.00282

Measured 7d ago against content hash 6a399eddd5b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 7d 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 scratch → neo4j-cypher-skill
  • GDS algorithm performance → neo4j-gds-skill
  • Schema design / data modelling → neo4j-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. 7d ago Changed 6a399eddd5b8
  2. 1mo ago Changed e190c199db27
  3. 1mo 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 (116 stars, last pushed yesterday), licensed MIT. It adds 202 tokens to every session and 2,823 once invoked, about $0.0008 per session on Opus 5.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

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

timescaledb-hyperfunctions

Use this skill when writing analytical SQL over time-series data with the TimescaleDB Toolkit (timescaledbtoolkit extension) hyperfunctions: approximate percentiles, statistical summaries, time-weighted averages, counter/gauge rates, uptime/heartbeat tracking, state durations, OHLC candlesticks, approximate distinct…

timescale/pg-aiguide · 298 tokens

durable-objects

Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

fcakyon/claude-codex-settings · 22 tokens

mongodb-connection

Optimize MongoDB client connection configuration (pools, timeouts, patterns) for any supported driver language. Use this skill when working/updating/reviewing on functions that instantiate or configure a MongoDB client (eg, when calling connect()), configuring connection pools, troubleshooting connection errors…

fcakyon/claude-codex-settings · 122 tokens

mongodb-schema-design

MongoDB schema design patterns and anti-patterns. Use when designing data models, reviewing schemas, migrating from SQL, or troubleshooting performance issues caused by schema problems. Triggers on "design schema", "embed vs reference", "MongoDB data model", "schema review", "unbounded arrays", "one-to-many", "tree…

fcakyon/claude-codex-settings · 127 tokens