SuperAPI AI Directory

session-init

Office & productivity

View repository

Updated 10-15 17:33

About this skill

Session Init Skill

A skill that checks the environment and grasps the current task status at session start.


Invocation Conditions

This skill is session Called internally from the / SessionStart-type flow. The user-facing entry point is /session or the normal session start flow.

Legacy trigger phrases:

  • "Start session"
  • "Start work"
  • "Start today's work"
  • "Check the status"
  • "What should I do?"
  • "start session"
  • "what should I work on?"

Overview

The Session Init skill automatically checks the following at Claude Code session start:

  1. Git status: current branch, uncommitted changes
  2. Plans.md: in-progress tasks, requested tasks
  3. AGENTS.md: confirmation of role division and prohibited matters
  4. Previous session: confirmation of handover items
  5. Latest snapshot: summary of progress snapshot and diff from previous time

Execution Steps

Step 0: File status check (automatic cleanup)

Check file sizes before session start:

# Plans.md の行数チェック
if [ -f "Plans.md" ]; then
  lines=$(wc -l < Plans.md)
  if [ "$lines" -gt 200 ]; then
    echo "⚠️ Plans.md が ${lines} 行です。「整理して」で整理を推奨"
  fi
fi

# session-log.md の行数チェック
if [ -f ".claude/memory/session-log.md" ]; then
  lines=$(wc -l < .claude/memory/session-log.md)
  if [ "$lines" -gt 500 ]; then
    echo "⚠️ session-log.md が ${lines} 行です。「セッションログを整理して」で整理を推奨"
  fi
fi

If cleanup is needed, display a suggestion (does not affect work).

Step 0.5: Handling legacy local memory compatibility (optional)

The current standard is Unified Harness Memory in Step 0.7. Checking legacy local memory compatibility is not required in principle; refer to it individually only when special migration confirmation is needed.

Note: In normal operation, skip this step and treat the common DB's Resume Pack as the sole resume pathway.

Step 0.7: Unified Harness Memory Resume Pack (required)

Retrieve the resume context from the Codex / Claude / OpenCode common DB (~/.harness-mem/harness-mem.db).

Required invocation:

harness_mem_resume_pack(project, session_id?, limit=5, include_private=false)

Operation rules:

  • project Always specify the current project name for
  • session_id は $CLAUDE_SESSION_ID → .claude/state/session.json の .session_id in that order
  • harness_mem_sessions_list(project, limit=1) The first use of is limited to read-only (resume confirmation), andrecord_checkpoint / finalize_session is not used for writing in
  • Inject the retrieval result into the context at session start
  • On retrieval failure, harness_mem_health() check the daemon status with , explicitly state the failure, and continue
  • Perform recovery in the order of scripts/harness-memd doctor → scripts/harness-memd cleanup-stale → scripts/harness-memd start .

Step 1: Environment check

Execute the following in parallel:

# Git状態
git status -sb
git log --oneline -3
# Plans.md
cat Plans.md 2>/dev/null || echo "Plans.md not found"
# AGENTS.md の要点
head -50 AGENTS.md 2>/dev/null || echo "AGENTS.md not found"

Step 2: Grasping task status

Extract the following from Plans.md:

  • cc:WIP - Tasks continuing from last time
  • pm:依頼中 - Tasks newly requested by the PM (compatible: cursor: requested)
  • cc:TODO - Tasks not yet started but already assigned

Step 3: Output a status report

## 🚀 セッション開始

**日時**: {{YYYY-MM-DD HH:MM}}
**ブランチ**: {{branch}}
**セッションID**: ${CLAUDE_SESSION_ID}

---

### 📋 今日のタスク

**優先タスク**:
- {{pm:依頼中(互換: cursor:依頼中) または cc:WIP のタスク}}

**その他のタスク**:
- {{cc:TODO のタスク一覧}}

---

### ⚠️ 注意事項

{{AGENTS.md からの重要な制約・禁止事項}}

---

**作業を開始しますか?**

Output format

At session start, present the following information concisely:

Item Content
Current branch staging etc.
Priority tasks The 1-2 most important items
Notes Summary of Prohibited Items
Next Actions Concrete Proposals

Related Commands

  • /work - Task execution (parallel execution supported)
  • /sync-status - Progress summary of Plans.md
  • /maintenance - Automatic file organization

Notes

  • Be sure to check AGENTS.md: Understand the division of roles before starting work
  • If there is no Plans.md: /harness-init guide them
  • If the previous work was interrupted: Confirm whether to continue