From majestic-engineer
Saves session state—goals, decisions, tasks, files—to .agents/session_ledger.md for recovery after crashes, /clear reloads, or context switches in long-running workflows.
How this skill is triggered — by the user, by Claude, or both
Slash command
/majestic-engineer:session-checkpointThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Audience:** Agents and developers needing to preserve session state during long-running workflows.
Audience: Agents and developers needing to preserve session state during long-running workflows.
Goal: Snapshot current session state to a ledger file for crash recovery, context refresh, and cross-session continuity.
Key insight: /clear + ledger reload provides fresh context with full signal preservation, avoiding the cumulative degradation of repeated /compact cycles.
Requires session.ledger: true in .agents.yml:
session:
ledger: true
ledger_path: .agents/session_ledger.md # optional, defaults to .agents/session_ledger.md
Note: The ledger is per-worktree (ephemeral session state). Handoffs go to main worktree (permanent, for /learn).
SESSION = /majestic:config session {}
If session.ledger is false or missing:
Checkpoint skipped - session.ledger not enabled in .agents.ymlUse session.ledger_path from config, or default to .agents/session_ledger.md.
Ensure the directory exists:
mkdir -p .agents
From the provided context, extract:
UNCONFIRMED if uncertain)Write to the ledger file using this format:
# Session Ledger
_Last updated: <timestamp>_
## Goal
<goal and success criteria>
## Constraints/Assumptions
- <constraint 1>
- <constraint 2>
## Key Decisions
- <decision 1>
- <decision 2>
## State
### Done
- <completed item 1>
- <completed item 2>
### Now
<current focus>
### Next
<planned next step>
## Open Questions
- <question 1>
- <question 2> `UNCONFIRMED`
## Working Set
- Files: <key files>
- IDs: <relevant IDs>
- Commands: <useful commands>
Return a brief confirmation:
Checkpoint saved to .agents/session_ledger.md
- Goal: <brief goal>
- State: <done count> done, now: <current>, next: <next>
/clear + ledger reload/session:handoffOther agents or skills can invoke checkpointing:
Before starting major refactor, apply `session-checkpoint` skill to save current state.
After completing each major step, apply `session-checkpoint` skill with current progress.
If context usage exceeds 70%, apply `session-checkpoint` skill before continuing.
When resuming after /clear with a ledger file:
UNCONFIRMED needs verificationMark assumptions as UNCONFIRMED when:
Prefer /clear + ledger reload over multiple /compact cycles:
| Approach | Context Quality | Signal Loss |
|---|---|---|
Single /compact | Good | Minimal |
Multiple /compact cycles | Degraded | Cumulative - each cycle loses detail |
/clear + ledger reload | Fresh | None - ledger preserves full signal |
Guideline: After 2-3 compactions in a session, checkpoint to ledger and /clear for fresh context with preserved state.
| Tool | Purpose | Persistence | Trigger |
|---|---|---|---|
session-checkpoint | Crash recovery, quick state save | File (.agents/session_ledger.md) | Skill-triggered |
/session:handoff | Cross-session continuity | File (main worktree .agents/handoffs/) | User/ship-triggered |
Tasks | Session task tracking | File (~/.claude/tasks/) | Agent-triggered |
Use session-checkpoint for:
Use /session:handoff for:
npx claudepluginhub majesticlabs-dev/majestic-marketplace --plugin majestic-engineerPersists architectural decisions, conventions, and progress across sessions by auto-saving to .rune/ files. Loads state at session start for continuity when skills establish patterns.
Saves session state at end of session and resumes it at start of next session. Useful when context is running out, wrapping up, or continuing previous work.
Captures session handoff details (completed, pending, learned) into .claude/handoff.md and loads it on session start. Maintains context across Claude Code sessions.