
session-opening
by spm1001
Behavioral skills for Claude Code: session lifecycle, utilities, and setup
SKILL.md
name: session-opening description: > Re-orient to session context on demand. Loads companion skills (beads, todoist-gtd) based on what's present. Use when you missed the startup context, want a fresh look at what's available, or after cd'ing to a different project. Triggers on /open, 'what were we working on', 'where did we leave off'. Pairs with /ground and /close. (user) user-invocable: false
/open
Interpret context and load companion skills.
When to Use
Context is surfaced automatically at session start via hook. The hook provides data; this skill provides behavior.
Use /open for:
- Re-orientation — "Show me the context again"
- Skill loading — Ensures beads/todoist-gtd patterns are available
- After directory change — Context is project-specific; if you cd'd, context may differ
Prerequisites
Before running /open, verify infrastructure is healthy. Silent failures here cause downstream confusion.
| Check | How | If Broken |
|---|---|---|
| open-context.sh exists | [ -x ~/.claude/scripts/open-context.sh ] | Run claude-doctor.sh |
| Script symlinks valid | ~/.claude/scripts/check-symlinks.sh | Fix symlinks, see ERROR_PATTERNS.md |
| bd available (if .beads/) | command -v bd | Install: brew install bd |
Quick pre-flight:
[ -x ~/.claude/scripts/open-context.sh ] && echo "OK" || echo "BROKEN: open-context.sh missing"
If pre-flight fails, STOP and diagnose before proceeding. See ~/Repos/claude-advanced/references/ERROR_PATTERNS.md for common issues.
Structure
Prerequisites → Verify infrastructure
Gate → Load required companion skills
Gather → Script output (already present from hook, or re-run if needed)
Orient → Synthesize what matters
Decide → User picks direction
Act → Draw-down to TodoWrite
1. Gate: Load Companion Skills
Before synthesizing, load skills based on what's present. Do not proceed until loaded.
| Condition | Action | Why |
|---|---|---|
.beads/ exists | Skill(beads) | Draw-down patterns, bead lifecycle |
| @Claude items in context OR Todoist in handoff | Offer Skill(todoist-gtd) | GTD framing, inbox check |
| User seems disoriented about past work | Offer Skill(memory) | Ancestral lookup |
Beads is mandatory when present. The draw-down pattern (bead → TodoWrite checkpoints) is where drift gets caught. Without it, Claude works from bead directly → no checkpoints → drift compounds.
Todoist-gtd is conditional. Offer it when relevant, don't load by default.
Skill loading bias (Jan 2026 learning): Loading todoist-gtd primes Claude to think about "where work belongs" (Todoist vs bd). This caused misinterpretation when user said "refactor beads into proper epics" — Claude proposed moving to Todoist instead of organizing within bd. When todoist-gtd is loaded, stay anchored to the user's explicit tool references ("the beads", "in bd").
Memory is optional. Offer when user seems confused about history, not by default.
2. Gather
Pattern: Notifications to stdout, content on disk.
Hook output at session start shows what exists:
📋 Handoffs: 9 available, latest 23h ago
Index: ~/.claude/.session-context/<encoded-cwd>/handoffs.txt
📦 Beads: 8 ready
Context: ~/.claude/.session-context/<encoded-cwd>/beads.txt
📰 News: available
File: ~/.claude/.update-news
Context files are per-project. The <encoded-cwd> is the working directory with / and . replaced by - (e.g., -Users-modha-Repos-claude-suite).
To get actual content, read the files:
| What | File |
|---|---|
| Handoff index | ~/.claude/.session-context/<encoded-cwd>/handoffs.txt |
| Specific handoff | Path from index (e.g., ~/.claude/handoffs/.../9ac230b1.md) |
| Beads context | ~/.claude/.session-context/<encoded-cwd>/beads.txt |
| News | ~/.claude/.update-news |
To compute the path: echo "$(pwd -P)" | tr '/.' '-' → use as subdirectory name.
Missing or Stale Context
If context files don't exist for current directory, regenerate them:
~/.claude/scripts/open-context.sh
This happens when:
- Session started in a different directory (hook ran there, not here)
- First time in this project
- After cd'ing to a different project mid-session
Check first: [ -d ~/.claude/.session-context/$(pwd -P | tr '/.' '-') ]
Script Failure Handling
If the script fails (exit code 127 = file not found, or any other error):
- STOP. Do not continue with partial context.
- Tell the user: "The open-context.sh script failed. This usually means a broken symlink."
- Diagnose: Run
~/.claude/scripts/check-symlinks.shto identify the issue.
3. Orient
Read files based on what notifications indicate, then synthesize.
Reading Pattern
First, compute the context directory:
CONTEXT_DIR=~/.claude/.session-context/$(pwd -P | tr '/.' '-')
Then read:
- Check handoff index — read
$CONTEXT_DIR/handoffs.txt(if missing, run~/.claude/scripts/open-context.shfirst) - Read most recent handoff — path is in the index, read the actual
.mdfile - Check beads context — read
$CONTEXT_DIR/beads.txtfor hierarchy + ready - News if relevant — read
~/.claude/.update-newsif user asks or it's actionable
Synthesize What Matters
- Handoff — Done, Next, Gotchas from previous session
- Beads hierarchy — from beads.txt, show directly to user
- Beads ready — what's unblocked
- Commands — if handoff has a Commands section, offer to run them
- Scope mismatches — if handoff "Next" doesn't match ready beads, flag it
Orphaned Local Handoffs
When stdout shows orphaned .handoff* files:
- Tell the user: "Found local .handoff* files — these are invisible to /open"
- Offer to rescue: "Want me to move them to the central location?"
- If yes:
mv .handoff* ~/.claude/handoffs/<encoded-path>/
Multiple Handoffs
When handoff index shows multiple entries, present choices to user:
AskUserQuestion([{
header: "Handoff",
question: "Multiple handoffs found. Which workstream to continue?",
options: [
{ label: "9ac230b1", description: "23h ago — Removed --local bypass..." },
{ label: "a6317919", description: "yesterday — Added raw_text to FTS..." },
{ label: "Start fresh", description: "Ignore existing handoffs" }
],
multiSelect: false
}])
Then read the selected handoff file.
Single Handoff (default)
Read the handoff, present concisely: "Previous session did X. Next suggested: Y. Z beads ready."
4. Decide
User picks direction. Options typically:
- Continue with handoff "Next"
- Pick from ready beads
- @Claude inbox items
- Something else
5. Act: Draw-Down
Draw-down triggers on ALL substantial work, not just explicit bead claims.
Explicit bead selection
When user picks a bead to work on:
bd show <bead-id> --json— read design and acceptance criteria- Create TodoWrite items from acceptance criteria
- Show user: "Breaking this down into: [list]. Sound right?"
- Mark bead in_progress:
bd update <id> --status in_progress
Continuation phrases
When user says "continue X", "keep going", "pick up where we left off":
- Clarify scope: "Which bead? Epic nzr (broad goal) or subtask nzr.1 (specific task)?"
- Read the bead's acceptance criteria
- Create TodoWrite items — this catches scope gaps before work begins
- Proceed with checkpoints
Failure mode (Jan 2026): User said "continue backfill" → Claude continued existing code without checking epic scope → discovered an hour later that "complete pass" meant more than file attachments.
External briefs
When user provides a spec, brief, or requirements from elsewhere:
- Extract acceptance criteria from the brief
- Create TodoWrite items from those criteria
- Show user: "I'm reading this as: [list]. Right?"
- Proceed with checkpoints
Failure mode: User provided brief from another Claude → work completed → "fix" didn't work → second debugging phase had no TodoWrite → drift.
Ambiguous references
When user says "the email thing", "that feature", or similar:
- Don't guess. Ask: "Do you mean bead X (description) or Y (description)?"
- Once clarified, do full draw-down
The test
If the work will take >10 minutes, it needs TodoWrite items.
No TodoWrite items = No checkpoints = Drift compounds.
Full draw-down patterns live in the beads skill — that's why gate-loading it matters.
Mirrors (GODAR)
| Phase | /open | /close |
|---|---|---|
| Gate | Load beads, offer todoist | — |
| Gather | Notifications (stdout) → Read files | Todos, beads, git, drift |
| Orient | "Where we left off" | Reflect (AskUserQuestion) |
| Decide | User picks direction | Crystallize actions (STOP) |
| Act | Draw-down → TodoWrite | Execute, handoff, commit |
| Remember | — | Captured in handoff |
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です