ahmed3elshaer/everything-claude-code-mobile/mobile-compaction
Claude Code and agent skill by ahmed3elshaer/everything-claude-code-mobile
- community
Checking that the SKILL.md file is still in the repository.
Context compaction strategies for large Android codebases. Optimize token usage while preserving critical context.
Install
npx vskill@latest install ahmed3elshaer/everything-claude-code-mobile/mobile-compactionSKILL.md
Mobile Compaction Skill
Strategic context compaction for large Android projects to optimize token usage while preserving critical information.
When to Compact
Compact context when:
- Token usage exceeds 100,000
- Working on large refactors spanning many files
- Switching between unrelated features
- Session becomes unfocused
- Context contains resolved discussions
Compaction Strategies
1. Module-Level Compaction
Focus on a single Android module:
What happens:
- Retain: All files in feature:auth module
- Summarize: Other modules to high-level description
- Drop: Resolved discussions about other modules
Use when: Deep work on a specific feature
2. Layer-Based Compaction
Focus on architecture layer:
What happens:
| Layer | Retain | Summarize | |
|---|---|---|---|
| UI | Composables, ViewModels, navigation | Repository details, data models | |
| Data | Repositories, data sources, models | Compose code, UI state | |
| Domain | Use cases, domain models | Implementation details |
Use when: Working on cross-cutting concerns in a layer
3. Build Variant Focus
Narrow to specific build variant:
What happens:
- Retain: Debug-specific configurations, test code
- Summarize: Release configurations, ProGuard rules
Use when: Debugging or test development
4. Test Isolation
Compact around failing tests:
What happens:
- Retain: Test file, related source files
- Summarize: Unrelated test discussions
- Drop: Resolved test fix discussions
Use when: Fixing specific test failures
5. Pattern-Based Compaction
Compact based on architectural patterns:
What happens:
- Retain: Files matching the pattern
- Summarize: Non-matching files to pattern names only
Use when: Pattern-specific work (e.g., Compose optimization)
Compaction Levels
| Level | Retention | Token Savings | Use Case | |
|---|---|---|---|---|
| Lite | Current task only | 70-80% | Deep focus work | |
| Medium | Current + related | 50-60% | Feature development | |
| Standard | Project summary | 30-40% | Default compaction | |
| Minimal | Essential only | 80-90% | Context at limit |
What Gets Preserved
Always Preserve (Critical)
- Active task context (what we're doing now)
- Recent code changes (last 5-10 files)
- Current errors/failures
- Mobile memory context
- High-confidence instincts (>0.7)
- Unresolved questions
Usually Preserve (Important)
- Architecture decisions
- Recent discussions (last 50 messages)
- Related file contents
- Test states
Summarize (Compressible)
- Completed features
- Resolved bugs
- Working code explanations
- Background discussions
Drop (Disposable)
- Successful build outputs
- Trivial operations
- Duplicated information
- Off-topic discussions
Compaction Commands
Basic Compaction
Smart Compaction
Manual Compaction
Compaction Workflow
Before Compaction
After Compaction
Integration
With Checkpoints
With Memory
With Instincts
Anti-Patterns
Don't Compact When:
- In the middle of debugging
- Unresolved errors exist
- Active discussion ongoing
- Task almost complete
Do Compact When:
- Starting new task
- Switching context
- Token limit approaching
- Task completed, keeping summary
Recovery
If compaction removed needed context:
Examples
Example 1: Feature Development
Example 2: Test Fixing
Example 3: Compose Optimization
Remember: Compaction is reversible via checkpoints and memory. When in doubt, checkpoint first.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/mobile-compaction/SKILL.md
Popularity
- Repository stars
- 34
- Repository forks
- 3
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 30 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ahmed3elshaer/everything-claude-code-mobile/mobile-compaction)