.cursor/skills/save-session/SKILL.md
Use when saving current Salesforce development session state. Persist org context, Apex progress, and pending work to a dated file for future session resumption.
npx skillsauth add jiten-singh-shahi/salesforce-claude-code save-sessionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Capture everything that happened in this session — what was built, what worked, what failed, what's left — and write it to a dated file so the next session can pick up exactly where this one left off.
Before writing the file, collect:
mkdir -p ~/.claude/sessions
Create ~/.claude/sessions/YYYY-MM-DD-<short-id>-session.md, using today's actual date and a short-id:
a-z, digits 0-9, hyphens -Full valid filename example: 2026-03-18-apex-trig-session.md
The short-id should include the project name to enable cross-project isolation (e.g., myapp-apex-trig instead of just apex-trig). This prevents session file collisions when working across multiple Salesforce projects that share the same ~/.claude/sessions/ directory.
Keep session files under ~500 lines. Focus on decisions, blockers, and next steps — not full code dumps. If you need to reference large code blocks, point to file paths instead.
Write every section honestly. Do not skip sections — write "Nothing yet" or "N/A" if a section genuinely has no content.
After writing, display the full contents and ask:
Session saved to [actual resolved path to the session file]
Does this look accurate? Anything to correct or add before we close?
Wait for confirmation. Make edits if requested.
# Session: YYYY-MM-DD
**Started:** [approximate time if known]
**Last Updated:** [current time]
**Project:** [project name or path]
**Topic:** [one-line summary of what this session was about]
---
## What We Are Building
[1-3 paragraphs describing the feature, bug fix, or task. Include enough
context that someone with zero memory of this session can understand the goal.
Include: what it does, why it's needed, how it fits into the Salesforce org.]
---
## What WORKED (with evidence)
[List only things that are confirmed working. For each item include WHY you
know it works — test passed, deployment succeeded, scratch org validated, etc.
Without evidence, move it to "Not Tried Yet" instead.]
- **[thing that works]** — confirmed by: [specific evidence]
If nothing is confirmed working yet: "Nothing confirmed working yet."
---
## What Did NOT Work (and why)
[This is the most important section. List every approach tried that failed.
For each failure write the EXACT reason so the next session doesn't retry it.
Be specific: "threw X error because Y" is useful. "didn't work" is not.]
- **[approach tried]** — failed because: [exact reason / error message]
If nothing failed: "No failed approaches yet."
---
## What Has NOT Been Tried Yet
[Approaches that seem promising but haven't been attempted.]
- [approach / idea]
If nothing is queued: "No specific untried approaches identified."
---
## Current State of Files
[Every file touched this session. Be precise about what state each file is in.]
| File | Status | Notes |
| ----------------- | -------------- | -------------------------- |
| `path/to/file.cls` | Complete | [what it does] |
| `path/to/file.cls` | In Progress | [what's done, what's left] |
| `path/to/file.js` | Broken | [what's wrong] |
If no files were touched: "No files modified this session."
---
## Decisions Made
[Architecture choices, tradeoffs accepted, approaches chosen and why.]
- **[decision]** — reason: [why this was chosen over alternatives]
If no significant decisions: "No major decisions made this session."
---
## Blockers & Open Questions
[Anything unresolved that the next session needs to address.]
- [blocker / open question]
If none: "No active blockers."
---
## Exact Next Step
[The single most important thing to do when resuming.]
---
## Environment & Setup Notes
[Only fill if relevant — scratch org alias, connected org, SF CLI version, etc.]
~/.claude/sessions//save-session
/save-session Save progress on the AccountManagement feature refactor
/save-session Checkpoint before switching to the hotfix branch
development
Update Salesforce platform reference docs with latest release features and deprecation announcements. Use when SessionStart hook warns docs are outdated or a new Salesforce release has shipped. Do NOT use for Apex or LWC development.
development
Use when syncing documentation after Salesforce Apex code changes. Update README, API docs, and deploy metadata references to match the current org codebase.
development
Use when managing context during long Salesforce Apex development sessions. Suggests manual compaction at logical intervals to preserve deploy and org context across phases.
tools
Visualforce development — pages, controllers, extensions, ViewState, JS Remoting, LWC migration. Use when maintaining VF pages, building PDFs, or planning VF-to-LWC migration. Do NOT use for LWC, Aura, or Flow.