From claude-code-harness
Internal skill that checks git state, Plans.md status, AGENTS.md roles, and retrieves resume context from Unified Harness Memory (harness-mem DB) at session start. Reports oversized files and suggests cleanup.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-harness:session-initThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
セッション開始時の環境確認と現在のタスク状況把握を行うスキル。
セッション開始時の環境確認と現在のタスク状況把握を行うスキル。
このスキルは session / SessionStart 系フローから内部的に呼び出します。
ユーザー向けの入口は /session または通常のセッション開始フローです。
旧トリガーフレーズ:
Session Init スキルは、Claude Code セッション開始時に自動的に以下を確認します:
セッション開始前にファイルサイズをチェック:
# 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
整理が必要な場合は提案を表示(作業には影響しない)。
現在の標準は Step 0.7 の Unified Harness Memory です。 旧ローカルメモリ互換の確認は原則不要で、特別な移行確認が必要な場合だけ個別に参照します。
注: 通常運用ではこのステップをスキップし、共通DB の Resume Pack を唯一の再開導線として扱います。
Codex / Claude / OpenCode 共通DB(~/.harness-mem/harness-mem.db)から再開文脈を取得する。
必須呼び出し:
harness_mem_resume_pack(project, session_id?, limit=5, include_private=false)
運用ルール:
project は必ず現在プロジェクト名を指定session_id は $CLAUDE_SESSION_ID → .claude/state/session.json の .session_id の順で取得するharness_mem_sessions_list(project, limit=1) の先頭利用は read-only(resume確認)に限定し、record_checkpoint / finalize_session での書き込みには使わないharness_mem_health() で daemon 状態を確認し、失敗を明示して続行scripts/harness-memd doctor → scripts/harness-memd cleanup-stale → scripts/harness-memd start の順で行う以下を並列で実行:
# 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"
Plans.md から以下を抽出:
cc:WIP - 前回から継続中のタスクpm:依頼中 - PM から新規依頼されたタスク(互換: cursor:依頼中)cc:TODO - 未着手だが割り当て済みのタスク## 🚀 セッション開始
**日時**: {{YYYY-MM-DD HH:MM}}
**ブランチ**: {{branch}}
**セッションID**: ${CLAUDE_SESSION_ID}
---
### 📋 今日のタスク
**優先タスク**:
- {{pm:依頼中(互換: cursor:依頼中) または cc:WIP のタスク}}
**その他のタスク**:
- {{cc:TODO のタスク一覧}}
---
### ⚠️ 注意事項
{{AGENTS.md からの重要な制約・禁止事項}}
---
**作業を開始しますか?**
セッション開始時は、以下の情報を簡潔に提示:
| 項目 | 内容 |
|---|---|
| 現在のブランチ | staging など |
| 優先タスク | 最も重要な 1-2 件 |
| 注意事項 | 禁止事項の要約 |
| 次のアクション | 具体的な提案 |
/work - タスク実行(並列実行対応)/sync-status - Plans.md の進捗サマリー/maintenance - ファイルの自動整理/harness-init を案内npx claudepluginhub chachamaru127/claude-code-harness --plugin claude-code-harnessInternal session startup skill that checks git state, Plans.md status, and harness-mem resume pack. Not user-invocable; triggered by session/startup workflows only.
Initializes Claude Code sessions by migrating legacy harness files to .claude-harness/, creating missing state files like memory rules and config, and preparing GitHub sync.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.