ajbcoding/claude-skill-eval/moai-alfred-session-state
- community
Checking that the SKILL.md file is still in the repository.
Enterprise session state management, token budget optimization, runtime tracking, session handoff protocols, context continuity for Claude Sonnet 4.5 and Haiku 4.5 with context awareness features
Install
npx vskill@latest install ajbcoding/claude-skill-eval/moai-alfred-session-stateSKILL.md
Alfred Session State Management Skill (Enterprise v4.0.0)
Skill Metadata
| Field | Value | |
|---|---|---|
| Skill Name | moai-alfred-session-state | |
| Version | 4.0.0 (Enterprise) | |
| Updated | 2025-11-12 | |
| Status | Active | |
| Tier | Alfred | |
| Supported Models | Claude Sonnet 4.5, Claude Haiku 4.5 | |
| Context Window | 200K tokens (Sonnet/Haiku), 500K tokens (Enterprise), 1M tokens (beta) | |
| Key Features | Context Awareness, Token Budget Tracking, Session Persistence, Adaptive Recovery |
What It Does
Provides enterprise-grade session state management for extended workflows, token budget optimization, runtime tracking, and handoff protocols to maintain context continuity across Alfred workflows and session boundaries.
Enterprise v4.0.0 Capabilities:
- ✅ Context-aware token budget management (November 2025 Claude API features)
- ✅ Session persistence with automatic history loading
- ✅ Session forking for parallel exploration
- ✅ Incremental multi-pack index optimization (Git 2.47+ integration)
- ✅ Context continuity across handoffs with state snapshots
- ✅ Progressive disclosure for memory efficiency
- ✅ Adaptive recovery checkpoints
- ✅ Multi-agent coordination protocols
- ✅ Memory file state synchronization
- ✅ Token budget awareness callbacks (Sonnet/Haiku 4.5 feature)
When to Use
Automatic triggers:
- Session start/end events
- Long-running task execution (>10 minutes)
- Multi-agent handoffs
- Context window approaching limits
- Model switches (Haiku ↔ Sonnet)
- Workflow phase transitions
Manual reference:
- Session state debugging and recovery
- Token budget optimization strategies
- Handoff protocol design
- Context continuity planning
- Multi-session workflow design
Token Budget Management (November 2025)
Context Awareness Feature
Claude Sonnet 4.5 and Haiku 4.5 feature built-in context awareness, enabling these models to:
- Track remaining context window ("token budget") throughout conversation
- Understand current position within 200K token limit (Sonnet/Haiku)
- Execute adaptive strategies based on available tokens
- Automatically manage context without manual intervention
Key Advantage: Models now self-regulate context usage in real time.
Token Budget Optimization Framework
Optimization Techniques (v4.0.0)
Technique 1: Progressive Summarization
Technique 2: Context Tagging with Unique Identifiers
Technique 3: Structured Context Architecture
Technique 4: MCP Server Context Budget
Technique 5: Task-Based Session Management
Session State Architecture (Enterprise v4.0.0)
State Layers
Session Creation & Persistence
Agent SDK Session Management (November 2025 API):
Session Resumption Pattern
Runtime State Tracking
Task State Machine (Enterprise v4.0.0)
Task Lifecycle States:
pending- Queued but not startedin_progress- Currently executing (monitor tokens)blocked- Waiting for dependencies or inputtoken_warning- Approaching context limit (v4.0.0)context_switch- Model change or session forkcompleted- Finished successfullyfailed- Error occurred, initiating recoveryrecovered- Resumed from checkpoint
Token Budget Callbacks (Haiku/Sonnet 4.5 Feature)
Session Handoff Protocols
Inter-Agent Handoff Package (Enterprise v4.0.0)
Handoff Validation (Enterprise v4.0.0)
Session Recovery (Enterprise v4.0.0)
Recovery Checkpoints
Checkpoint Triggers:
- Task phase boundaries (before RED, GREEN, REFACTOR)
- Agent handoffs
- User interruptions
- Token budget thresholds
- Error conditions
- Session timeouts
Checkpoint Structure:
Recovery Process (Enterprise v4.0.0)
- State Restoration - Reload last valid checkpoint
- Context Validation - Verify token budget sufficient
- Session Resumption - Use Agent SDK resume feature
- Progress Assessment - Determine what was completed
- Continuation Planning - Decide next steps with updated token budget
- User Notification - Inform user of recovery status
Memory State Synchronization
Memory Files (v4.0.0)
Files:
.moai/sessions/session-state.json- Current session metadata.moai/sessions/context-cache.json- Cached context for performance.moai/sessions/checkpoints/- Saved recovery checkpoints.moai/sessions/token-usage.log- Token budget historyactive-tasks.md- TodoWrite task tracking
This is the start of the file. Read the full SKILL.md on GitHub.
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/moai-alfred-session-state/SKILL.md
Popularity
- Repository stars
- 4
- 7-day trend score
- 8
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/ajbcoding/claude-skill-eval/moai-alfred-session-state)