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.
curl -O https://raw.githubusercontent.com/jiten-singh-shahi/salesforce-claude-code/main/.cursor/skills/sf-apex-cursor/SKILL.mdgit clone --depth 1 https://github.com/jiten-singh-shahi/salesforce-claude-codeWrote 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.
[](https://agentmods.dev/skills/jiten-singh-shahi/salesforce-claude-code/sf-apex-cursor)<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.
<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>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.
| Model | Per session | Once 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 |
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); 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
@AuraEnabledmethods 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();
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.
- 10d ago First seen · 337 lines · 55 tokens per session scan A 8e41aff80cfb
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.
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.
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.
dev-supabase
Backend development with Supabase. Trigger when the user wants to configure auth, the database, or Supabase storage.
ccc-pro-saas
Multi-tenant SaaS scaffolds: row-level security, billing, invitations · Pro tier only.
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"…
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…