graphql-introspection-trimmer

graphql-introspection-trimmer is a skill for Claude Code from alivirgo/Major-AI-Skills. It costs 25 tokens per session (1,226 once invoked), scanned A, original, MIT.

A method for reducing a large GraphQL schema or introspection result to the types needed for one operation. GraphQL introspection is a way to ask an API to describe its own schema.

In plain words
What is it for?
Use it when debugging or writing a query against a large GraphQL API and only need the types connected to that query.
Why use it?
It removes unrelated schema text from an agent's context, making a targeted API task easier to inspect.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument; mentions Codex.

Part of the major-ai-skills plugin — 147 skills, 8 plugins shipped together

Good fit Use it when debugging or writing a query against a large GraphQL API and only need the types connected to that query.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alivirgo/major-ai-skills/graphql-introspection-trimmer
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 alivirgo/Major-AI-Skills --skill graphql-introspection-trimmer
Clone the repo
git clone --depth 1 https://github.com/alivirgo/Major-AI-Skills

Made for: Claude Code.

Or install major-ai-skills, the plugin that ships this one along with the rest of its 147 skills, 8 plugins.

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 graphql-introspection-trimmer

README.md
[![agentmods](https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/graphql-introspection-trimmer/github.svg)](https://agentmods.dev/skills/alivirgo/major-ai-skills/graphql-introspection-trimmer)
Your own site
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/graphql-introspection-trimmer"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/graphql-introspection-trimmer/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 graphql-introspection-trimmer

Your own site · 80×15
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/graphql-introspection-trimmer"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/graphql-introspection-trimmer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,226 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00025 $0.01226
Opus 5 $0.00013 $0.00613
Sonnet 5 $0.00005 $0.00245
Haiku 4.5 $0.00003 $0.00123

Measured yesterday against content hash 6b819db0c191, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

graphql-introspection-trimmer scanned grade A with 0 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/graphql-introspection-trimmer/SKILL.md · 126 lines

How it starts

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

GraphQL Schema & Introspection Trimming Protocol

Overview

When integrating with or debugging a GraphQL API, agents often run full schema introspection queries (__schema { types { name fields { name type } } }) or ingest full 10,000-line schema.graphql SDL files.

Full schema introspection results in massive Context Overflow: a production enterprise GraphQL schema (Shopify, GitHub, Stripe) is 500KB to 3MB of raw JSON (consuming 80,000+ tokens), even if the agent only needs to query 2 fields on the User object.

The GraphQL Schema Trimming Protocol parses the schema AST and extracts strictly the targeted operation and its transitively referenced types, discarding unreferenced queries, mutations, and deprecated fields.


Full Introspection Dump vs. Targeted Subgraph SDL

┌─────────────────────────────────────────────────────────────┐
│                 GraphQL Schema Context Impact               │
│                                                             │
│  Full Introspection JSON Dump (65,000 Tokens):              │
│  • 420 Object Types (Billing, Inventory, Webhooks, Admin)   │
│  • 180 Mutations & Subscriptions                            │
│  • 1,200 Field descriptions and deprecation reasons         │
│  ↳ 65,000 tokens billed, blows context limit                │
│                                                             │
│  Targeted Subgraph SDL (240 Tokens - 99.6% Reduction!):     │
│  type Query { getUser(id: ID!): User }                      │
│  type User { id: ID!, email: String!, role: Role! }         │
│  enum Role { ADMIN, MEMBER, VIEWER }                        │
│  ↳ 240 clean tokens, exact type contracts preserved         │
└─────────────────────────────────────────────────────────────┘

The 3-Step Schema Pruning Algorithm

┌───────────────────────────────────────────────────────────────────────────┐
│ 1. IDENTIFY ROOT OPERATION: Target query (e.g. `Query.searchProducts`)     │
│ 2. RECURSIVE TYPE RESOLUTION: Follow field return types & input arguments │
│ 3. STRIP METADATA: Drop description strings, `@deprecated`, & uncalled SDL│
└───────────────────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 126 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. yesterday Changed · -13 tokens per session 6b819db0c191
  2. 7d ago First seen · 126 lines · 38 tokens per session scan A 55edc18827b0

Subscribe to this mod's changes

graphql-introspection-trimmer is a skill published in the GitHub repository alivirgo/Major-AI-Skills (1 stars, last pushed today), licensed MIT. It adds 25 tokens to every session and 1,226 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

api-design-principles-v2

API Design Principles workflow skill. Use this skill when the user needs Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers and stand the test of time and the operator should preserve the upstream workflow, copied support files, and provenance…

diegosouzapw/awesome-omni-skills · 69 tokens

api-patterns

API Patterns workflow skill. Use this skill when the user needs API design principles and decision-making. REST vs GraphQL vs tRPC selection, response formats, versioning, pagination and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills · 60 tokens

api-design-principles

API Design Principles workflow skill. Use this skill when the user needs Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers and stand the test of time and the operator should preserve the upstream workflow, copied support files, and provenance…

diegosouzapw/awesome-omni-skills · 67 tokens

pipefy-introspection

Use this skill when you need to discover GraphQL type shapes, mutation signatures, enum values, or execute arbitrary GraphQL as a fallback. This is the first fallback tier (Tier 2) when dedicated MCP tools fail or don't exist for an operation. 7 MCP tools.

pipefy/ai-toolkit · 61 tokens

azure-communication-services

Expert knowledge for Azure Communication Services development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when building ACS calling/chat apps, SMS/email senders, Teams interop…

MicrosoftDocs/Agent-Skills · 127 tokens

algolia-search-v2

Algolia Search Integration workflow skill. Use this skill when the user needs Expert patterns for Algolia search implementation, indexing and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off.

diegosouzapw/awesome-omni-skills · 50 tokens