strategic-compact
Skill15 starsChanged 7 months agoMITView on GitHub
Use when managing context during long Salesforce Apex development sessions. Suggests manual compaction at logical intervals to preserve deploy and org context across phases.
68 other projects use a version of this, 57 of them edited.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codeedited, first seen Nov 8, 2026
- XD3an/cc-plusedited, first seen Nov 7, 2026
- pankaj-mahaur/Agent-Daemonedited, first seen Nov 6, 2026
- myths-labs/musetheir own version, first seen Nov 6, 2026
- TsinHzl/claude-code-configtheir own version, first seen Nov 1, 2026
- renepf/claude-skillsedited, first seen Oct 25, 2026
Used with
Projects with it also use configure-ecc, ralphinho-rfc-pipeline and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
royaluniondesign-sysSkillconfigure-ecc
Interactive installer for Everything Claude Code — guides users through selecting and installing skills and rules to user-level or project-level directories, verifies paths, and optionally optimizes installed files.
Also in 11 projects that use this
junimnjwSkillralphinho-rfc-pipeline
RFC-driven multi-agent DAG execution pattern with quality gates, merge queues, and work unit orchestration.
Also in 11 projects that use this
InfopibeSkilleverything-claude-code
Also in 11 projects that use this
TironFoxSkillopenclaw-persona-forge
为 OpenClaw AI Agent 锻造完整的龙虾灵魂方案。根据用户偏好或随机抽卡, 输出身份定位、灵魂描述(SOUL.md)、角色化底线规则、名字和头像生图提示词。 如当前环境提供已审核的生图 skill,可自动生成统一风格头像图片。 当用户需要创建、设计或定制 OpenClaw 龙虾灵魂时使用。 不适用于:微调已有 SOUL.md、非 OpenClaw 平台的角色设计、纯工具型无性格 Agent。 触发词:龙虾灵魂、虾魂、OpenClaw 灵魂、养虾灵魂、龙虾角色、龙虾定位、 龙虾剧本杀角色、龙虾游戏角色、龙虾 NPC、龙虾性格、龙虾背景故事、 lobster soul、lobster character、抽卡、随机龙虾、龙虾 SOUL、gacha。
Also in 5 projects that use this
royaluniondesign-sysSkillcontent-hash-cache-pattern
Cache expensive file processing results using SHA-256 content hashes — path-independent, auto-invalidating, with service layer separation.
Also in 15 projects that use this
loulanyueSkillnuxt4-patterns
Nuxt 4 app patterns for hydration safety, performance, route rules, lazy loading, and SSR-safe data fetching with useFetch and useAsyncData.
Also in 9 projects that use this
Other versions68 projects use a version of this.
Word for word · 0
None found.
Edited · 57
- affaan-m/ECC★ 246k21% same
- loulanyue/awesome-claude-notes★ 27245% same
- cloudnative-co/claude-code-starter-kit★ 15316% same
- cohen-liel/hivemind★ 10847% same
- tpavanipradeep/everything-claude-code★ 10447% same
- mturac/everything-openai-codex★ 8946% same
- mit-network/everything-claude-code★ 7647% same
- GGGODLIN/gggodlin-cc-harness★ 7346% same
- Fmarzochi/EGC★ 6144% same
- ysyecust/everything-claude-code★ 4433% same
47 more not listed
Wrote their own version · 11
- xu-xiang/everything-claude-code-zh★ 1.9ksame name
- myths-labs/muse★ 38same name
- mhylle/claude-skills-collection★ 20same name
- YehudaFrankel/clankbrain★ 16same name
- peopleforrester/claude-dotfiles★ 3same name
- TeamSPWK/nova★ 2same name
- TsinHzl/claude-code-config★ 2same name
- rhfl04-dfdf/jychoi_everything-claude-code-ko★ 1same name
- MANVENDRA-github/agentry★ 0same name
- RhythmMittal19/claude-config★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository58 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- asideSkill
- checkpointSkill
- configure-sccSkill
- continuous-agent-loopSkill
- mcp-server-patternsSkill
- model-routeSkill
- prompt-optimizerSkill
- refactor-cleanSkill
- resume-sessionSkill
- save-sessionSkill
- search-firstSkill
- security-scanSkill
- sessionsSkill
- sf-2gp-security-reviewSkill
- sf-agentforce-developmentSkill
- sf-agentforce-mcp-actionsSkill
- sf-apex-async-patternsSkill
- sf-apex-best-practicesSkill
- sf-apex-constraintsSkill
- sf-apex-cursorSkill
- sf-apex-enterprise-patternsSkill
- sf-apex-testingSkill
- sf-api-designSkill
- sf-approval-processesSkill
- sf-aura-developmentSkill
- sf-build-fixSkill
- sf-cli-referenceSkill
- sf-data-modelingSkill
- sf-debuggingSkill
- sf-deployment-constraintsSkill
- sf-deploymentSkill
- sf-devops-ci-cdSkill
- sf-docs-lookupSkill
- sf-e2e-testingSkill
- sf-experience-cloudSkill
- sf-flow-developmentSkill
- sf-governor-limitsSkill
- sf-harness-auditSkill
- sf-helpSkill
- sf-integrationSkill
- sf-lwc-constraintsSkill
- sf-lwc-developmentSkill
- sf-lwc-testingSkill
- sf-metadata-managementSkill
- sf-platform-events-cdcSkill
- sf-quickstartSkill
- sf-security-constraintsSkill
- sf-securitySkill
- sf-soql-constraintsSkill
- sf-soql-optimizationSkill
- sf-tdd-workflowSkill
- sf-testing-constraintsSkill
- sf-trigger-constraintsSkill
- sf-trigger-frameworksSkill
- sf-visualforce-developmentSkill
- update-docsSkill
- update-platform-docsSkill
The file
We split this skill into the rules it gives an agent
8 rules. 2 are common, 6 are distinctive, and 0 are very specific to this project.
2
Common
Most of the 64 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
When running long Salesforce development sessions that approach context limits (200K+ tokens)
- Distinctive: line 14
When transitioning between distinct development phases (org exploration -> planning -> implementation)
- Distinctive: line 15
When switching between unrelated Salesforce domains (Apex -> LWC -> Flow configuration)
- Distinctive: line 16
After completing a major milestone (feature shipped, deployment succeeded) before starting new work
- Common: line 17
When responses slow down or become less coherent due to context pressure
- Common: line 24
No awareness of logical task boundaries
- Distinctive: line 89
Instead of loading full skill content at session start, use a trigger table that maps keywords to skill paths.
- Distinctive: line 119
Before compacting, write critical context to files so it survives:
“Common” is measured: kept by at least 6 in 10 of the 64 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Strategic Compact Skill
Suggests manual /compact at strategic points in your workflow rather than relying on arbitrary auto-compaction.
When to Use
- When running long Salesforce development sessions that approach context limits (200K+ tokens)
- When transitioning between distinct development phases (org exploration -> planning -> implementation)
- When switching between unrelated Salesforce domains (Apex -> LWC -> Flow configuration)
- After completing a major milestone (feature shipped, deployment succeeded) before starting new work
- When responses slow down or become less coherent due to context pressure
Why Strategic Compaction?
Auto-compaction triggers at arbitrary points:
- Often mid-task, losing important context about org structure or governor limits
- No awareness of logical task boundaries
- Can interrupt complex multi-step Salesforce operations (deploy pipeline, test runs)
Strategic compaction at logical boundaries:
- After org exploration, before implementation — Compact metadata/schema context, keep implementation plan
- After completing a feature — Fresh start for next feature
- Before switching domains — Clear Apex context before LWC work
How It Works
The suggest-compact.js script runs on PreToolUse (Edit/Write) and:
- Tracks tool calls — Counts tool invocations in session
- Threshold detection — Suggests at configurable threshold (default: 50 calls)
- Periodic reminders — Reminds every 25 calls after threshold
Compaction Decision Guide
| Phase Transition | Compact? | Why |
| Org exploration -> Planning | Yes | Org metadata is bulky; plan is the distilled output |
| Planning -> Apex implementation | Yes | Plan is saved to a file; free up context for code |
| Apex implementation -> LWC work | Yes | Clear Apex context for unrelated frontend work |
| Apex implementation -> Apex testing | Maybe | Keep if tests reference recent code; compact if switching focus |
| Debugging -> Next feature | Yes | Debug traces pollute context for unrelated work |
| Mid-implementation | No | Losing class names, field APIs, and partial state is costly |
| After a failed deployment | Yes | Clear the dead-end reasoning before trying a new approach |
| Trigger work -> Flow work | Yes | Different domains with different context needs |
What Survives Compaction
Understanding what persists helps you compact with confidence:
| Persists | Lost |
| CLAUDE.md instructions | Intermediate reasoning and analysis |
| Task list (if saved to a file) | File contents you previously read |
| Project-level settings and rules | Multi-step conversation context |
| Git state (commits, branches) | Tool call history and counts |
| Files on disk | Nuanced user preferences stated verbally |
| Org metadata on disk | SOQL query results from exploration |
Best Practices
- Compact after planning — Once plan is finalized and saved to a file, compact to start fresh
- Compact after debugging — Clear error-resolution context before continuing
- Don't compact mid-implementation — Preserve context for related Apex/LWC changes
- Read the suggestion — The hook tells you when, you decide if
- Write before compacting — Save important context (org structure, field APIs) to files or memory before compacting
- Use
/compactwith a summary — Add a custom message:/compact Focus on implementing trigger handler next
Salesforce-Specific Tips
- Save org metadata before compacting — Object/field lists, record type IDs, profile names
- Save governor limit findings — If you discovered limit issues, document them first
- Save deployment results — Deployment errors/warnings should be saved before compacting
- Keep test results accessible — Write failing test details to a file before compacting
Token Optimization Patterns
Trigger-Table Lazy Loading
Note: This is an aspirational optimization pattern -- SCC currently loads skills based on frontmatter triggers, not a runtime lazy-loading table.
Instead of loading full skill content at session start, use a trigger table that maps keywords to skill paths. Skills load only when triggered, reducing baseline context by 50%+:
| Trigger Keywords | Skill | Load When |
| "test", "tdd", "coverage" | sf-apex-testing | User mentions testing |
| "security", "sharing", "crud" | sf-security | Security-related work |
| "deploy", "scratch org", "ci" | sf-deployment | Deployment context |
| "soql", "query", "selectivity" | sf-soql-optimization | Query optimization |
| "trigger", "handler", "fflib" | sf-trigger-frameworks | Trigger development |
Context Composition Awareness
Monitor what consumes your context window:
- CLAUDE.md files — Always loaded, keep lean
- Loaded skills — Each skill adds 1-5K tokens; SCC has 58 skills
- Conversation history — Grows with each exchange
- Tool results — File reads, SOQL results, test output add bulk
- Rules — Always-on guidelines consume baseline context
Duplicate Instruction Detection
Common sources of duplicate context in SCC projects:
- Skills that repeat CLAUDE.md instructions
- Multiple skills covering overlapping domains (e.g., security guidance in both
sf-securityandsf-governor-limitsskills) - Agent descriptions that duplicate skill content
Save-Before-Compact Examples
Before compacting, write critical context to files so it survives:
Save Org Metadata
# Save field list for target object
sf sobject describe --sobject Account --json > .claude/org-context/account-fields.json
# Save record type IDs
sf data query --query "SELECT Id, Name, DeveloperName FROM RecordType WHERE SobjectType = 'Account'" --json > .claude/org-context/record-types.jsonSave Investigation Findings
<!-- .claude/session-notes.md — write before compacting -->
## Governor Limit Findings (2026-03-24)
- AccountTriggerHandler.cls line 45: SOQL in loop (CRITICAL)
- OrderService.cls: 3 DML statements could be combined (MEDIUM)
- Coverage: AccountService 82%, OrderService 61% (needs work)
## Deployment Blockers
- Missing field: Account.Risk_Category__c not in target org
- Flow "Auto Case Assignment" references deleted queueSave Test Results
<!-- .claude/test-results.md -->
## Last Test Run
- 142/145 passing
- Failed: OrderServiceTest.shouldHandleBulkUpdate (NPE at line 89)
- Failed: CaseTriggerTest.shouldEscalateHighPriority (assertion at line 34)
- Failed: IntegrationTest.shouldCallExternalAPI (callout not mocked)
- Coverage: 78% org-wideMulti-Session Continuity
For work spanning multiple sessions, use compact + session commands:
Session 1: Plan feature
+-- /save-session -> saves plan, org context, findings
+-- /compact -> clean slate
Session 2: Implement Apex
+-- /resume-session -> restores plan context
+-- [implement Apex classes]
+-- /save-session -> saves implementation state
+-- /compact
Session 3: Implement LWC + Deploy
+-- /resume-session -> restores implementation context
+-- [build LWC, deploy, verify]Large Project Handling
For projects with 100K+ lines of code:
- Don't read entire codebase — Use Grep/Glob to find specific files
- Use codemaps —
deep-researcheragent creates navigable index without loading full files - Compact aggressively between features — Each feature is a fresh context
- Save architecture notes to files — Don't rely on conversation memory for class relationships
- Use agents for parallel investigation — Subagents have their own context windows
Approximate Token Costs (as of the current API version per @../_reference/API_VERSIONS.md — may vary with model and encoding)
| Content Type | Approximate Tokens | Notes |
| CLAUDE.md | 2-5K | Always loaded |
| Each rule file | 500-2K | All active rules loaded |
| Each loaded skill | 1-5K | Loaded on demand |
| Apex class (500 lines) | 3-5K | When Read tool is used |
| LWC component (3 files) | 2-4K | HTML + JS + CSS |
| SOQL query result (100 rows) | 2-8K | Depends on field count |
| Test output (full suite) | 5-15K | Use --result-format human to reduce |
| Debug log (1000 lines) | 8-15K | Filter with --log-level WARN |
Related
suggest-compact.jshook — Automatic compaction suggestions/save-sessionand/resume-session— State that survives compactionsf-debuggingskill — Debug context preservationlearning-engineagent — Extracts patterns before session ends
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

