salesforce-claude-code: Skill for Claude Code

.cursor/skills/sf-apex-cursor/SKILL.md

sf-apex-cursor is a skill for Claude Code, Cursor from jiten-singh-shahi/salesforce-claude-code. It costs 55 tokens per session (2,373 once invoked), scanned A, original, MIT.

A guide to Salesforce's Apex Cursor API, which paginates SOQL query results by fetching large result sets in smaller pages.

In plain words
What is it for?
Building large Salesforce reports, Queueable processing chains, or Lightning Web Component pagination, and replacing unsuitable OFFSET queries.
Why use it?
It avoids the 2,000-row limit associated with SOQL OFFSET pagination and supports datasets of up to 50 million records.

Skill for Claude CodeCursor

Written for Claude Code and Cursor: shipped in a Claude Code plugin, but also installed under .cursor/.

This is jiten-singh-shahi/salesforce-claude-code's own configuration. It tells Claude Code and Cursor how to work on salesforce-claude-code 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 salesforce-claude-code configures →

Part of the salesforce-claude-code plugin — 41 skills, 17 agents shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to jiten-singh-shahi/salesforce-claude-code. 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/jiten-singh-shahi/salesforce-claude-code/main/.cursor/skills/sf-apex-cursor/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/jiten-singh-shahi/salesforce-claude-code

Made for: Claude Code, Cursor.

Or install salesforce-claude-code, the plugin that ships this one along with the rest of its 41 skills, 17 agents.

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 sf-apex-cursor

README.md
[![agentmods](https://agentmods.dev/badge/skills/jiten-singh-shahi/salesforce-claude-code/sf-apex-cursor/github.svg)](https://agentmods.dev/skills/jiten-singh-shahi/salesforce-claude-code/sf-apex-cursor)
Your own site
<a href="https://agentmods.dev/skills/jiten-singh-shahi/salesforce-claude-code/sf-apex-cursor"><img src="https://agentmods.dev/badge/skills/jiten-singh-shahi/salesforce-claude-code/sf-apex-cursor/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 sf-apex-cursor

Your own site · 80×15
<a href="https://agentmods.dev/skills/jiten-singh-shahi/salesforce-claude-code/sf-apex-cursor"><img src="https://agentmods.dev/badge/skills/jiten-singh-shahi/salesforce-claude-code/sf-apex-cursor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,373 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.
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.00055 $0.02373
Opus 5 $0.00028 $0.01187
Sonnet 5 $0.00011 $0.00475
Haiku 4.5 $0.00006 $0.00237

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

Security

Grade A, and why

sf-apex-cursor 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 10d 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.

List<SObject> page = cursor.fetch(offset, pageSize);
.cursor/skills/sf-apex-cursor/SKILL.md · 337 lines

How it starts

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

Apex Cursor

The Cursor class (GA Spring '26) enables efficient pagination through up to 50 million SOQL rows without the 2,000-row OFFSET limit. Use it for large dataset processing that previously required chunked OFFSET patterns or raw Batch Apex.

Reference: @../_reference/APEX_CURSOR.md


When to Use

  • When implementing paginated queries over large datasets using the Apex Cursor API
  • When OFFSET-based pagination hits governor limits or performance issues on large result sets
  • When building @AuraEnabled methods with server-side cursor pagination for LWC components
  • When migrating legacy OFFSET queries to cursor-based iteration for scalability beyond 2,000 rows

Cursor vs. OFFSET vs. Batch Apex

Approach Max Records Heap Impact Best For
SOQL OFFSET 2,000 Full result set in heap Small UI pagination
Batch Apex Unlimited Per-execute governor reset Background mass processing
Cursor class 50,000,000 Per-page only Large paginated reports, async chaining, LWC infinite scroll

Performance Comparison

Record Count Best Approach Why
< 200 Standard SOQL with LIMIT Simple, no overhead
200 - 2,000 OFFSET pagination Adequate performance, simpler code
2,000 - 50,000 Cursor OFFSET degrades above 2K; Cursor maintains constant performance
50,000+ Cursor + Queueable chaining Single cursor handles up to 50M records
Batch processing Database.QueryLocator Full governor reset per execute chunk

Key insight: OFFSET forces the database to skip N rows on every request. At 10,000 OFFSET, the DB scans and discards 10K rows. Cursor maintains a server-side pointer with no scanning overhead regardless of position.


Cursor Class API

// Open a cursor — returns a server-side pointer, not the data
Database.Cursor cursor = Database.getCursor('SELECT Id, Name FROM Account ORDER BY Id');

// Fetch a page of records starting at offset
List<SObject> page = cursor.fetch(offset, pageSize);

// Total number of records the cursor can return
Integer total = cursor.getNumRecords();

// Serialize the cursor for use across transactions (Queueable chaining)
String cursorId = cursor.getId();

// Re-open a serialized cursor in a new transaction
Database.Cursor resumed = Database.getCursor(cursorId);

// Always close when done to release server-side resources
cursor.close();

Read the full file on GitHub · 337 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. 10d ago First seen · 337 lines · 55 tokens per session scan A 8e41aff80cfb

Subscribe to this mod's changes

sf-apex-cursor is a skill published in the GitHub repository jiten-singh-shahi/salesforce-claude-code (16 stars, last pushed 2mo ago), licensed MIT. It adds 55 tokens to every session and 2,373 once invoked, about $0.0003 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

compound-field-patterns

Compound fields (Name, Address, Geolocation): SOQL access rules, DML semantics, component access in Apex/LWC, reporting column behavior, formula field restrictions. NOT for creating a new custom field — use admin/custom-field-creation. NOT for formula syntax and functions — use admin/formula-fields.

PranavNagrecha/AwesomeSalesforceSkills · 67 tokens

generic-fullstack-feature-developer

Guide feature development for full-stack applications with architecture focus. Covers Next.js App Router patterns, NestJS backend services, database models, data workflows, and seamless integration. Use when adding new features, refactoring existing code, or planning major changes.

travisjneuman/.claude · 56 tokens

dev-supabase

Backend development with Supabase. Trigger when the user wants to configure auth, the database, or Supabase storage.

christopherlouet/claude-base · 28 tokens

ccc-pro-saas

Multi-tenant SaaS scaffolds: row-level security, billing, invitations · Pro tier only.

KevinZai/commander · 24 tokens

sf-schema

Scaffold custom objects, fields, validation rules, permission sets, and other schema metadata as SFDX source XML. Use when asked to create objects, custom fields, permission sets, validation rules, or generate metadata XML. Activate on mentions of "custom object", "custom field", "permission set", "validation rule"…

Clientell-Ai/salesforce-skills · 86 tokens

sf-soql

Build and optimize SOQL queries including relationship queries, aggregate functions, polymorphic TYPEOF, and selective filters. Use when asked to write queries, debug slow queries, optimize existing SOQL, or enforce query security. Activate on mentions of "SOQL", "query", "SELECT", "WHERE", "aggregate", "relationship…

Clientell-Ai/salesforce-skills · 78 tokens