ac-session-manager
自律的なコーディング作業において、セッションの開始や再開、種類判別、自動継続などを管理し、開発者がスムーズに作業を進められるように支援するSkill。
📜 元の英語説明(参考)
Session lifecycle management for autonomous coding. Use when starting sessions, resuming work, detecting session type (init vs continue), or managing auto-continuation between sessions.
🇯🇵 日本人クリエイター向け解説
自律的なコーディング作業において、セッションの開始や再開、種類判別、自動継続などを管理し、開発者がスムーズに作業を進められるように支援するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o ac-session-manager.zip https://jpskill.com/download/9338.zip && unzip -o ac-session-manager.zip && rm ac-session-manager.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9338.zip -OutFile "$d\ac-session-manager.zip"; Expand-Archive "$d\ac-session-manager.zip" -DestinationPath $d -Force; ri "$d\ac-session-manager.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
ac-session-manager.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
ac-session-managerフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
AC Session Manager
自律的なコーディング操作のための完全なセッションライフサイクル管理。
概要
完全なセッションライフサイクルを管理します。
- セッションタイプの検出(INIT vs CONTINUE)
- セッションの作成と構成
- セッション間の自動継続
- 状態を保持した状態での正常なシャットダウン
クイックスタート
セッションタイプの検出
from scripts.session_manager import SessionManager
manager = SessionManager(project_dir)
session_type = await manager.detect_type()
if session_type == "INIT":
# 最初の実行 - プロジェクトを初期化
await manager.run_initializer()
elif session_type == "CONTINUE":
# 作業を再開
await manager.run_continuation()
elif session_type == "COMPLETE":
print("すべての機能が完了しました!")
セッションの実行
async with SessionManager(project_dir) as session:
result = await session.run(prompt)
print(f"Status: {result.status}")
セッションライフサイクル
┌─────────────────────────────────────────────────────────────┐
│ SESSION LIFECYCLE │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. セッションタイプの検出 │
│ ├─ feature_list.json の確認 │
│ ├─ 見つからない場合 → INIT セッション │
│ ├─ handoff が存在する場合 → CONTINUE_FROM_HANDOFF │
│ ├─ すべてパスした場合 → COMPLETE │
│ └─ それ以外の場合 → CONTINUE_IMPLEMENTATION │
│ │
│ 2. セッションの作成 │
│ ├─ SDK クライアントの初期化 │
│ ├─ ツールと権限の構成 │
│ └─ 作業ディレクトリの設定 │
│ │
│ 3. セッションの実行 │
│ ├─ prompt の実行 (initializer またはコーディング) │
│ ├─ ツールコールの処理 │
│ └─ 結果の取得 │
│ │
│ 4. セッションの終了 │
│ ├─ 状態の保存 │
│ ├─ 完了ステータスの確認 │
│ └─ 自動継続またはシャットダウンのトリガー │
│ │
└─────────────────────────────────────────────────────────────┘
セッションタイプ
| Type | Condition | Action |
|---|---|---|
INIT |
feature_list.json が存在しない | initializer エージェントを実行 |
CONTINUE_FROM_HANDOFF |
handoffs/current.json が存在する | handoff から再開 |
CONTINUE_IMPLEMENTATION |
機能が未完了 | コーディングを継続 |
COMPLETE |
すべての機能がパス | レポートを生成し、終了 |
検出ロジック
def detect_session_type(project_dir: Path) -> SessionType:
# 初期化の確認
if not (project_dir / "feature_list.json").exists():
return SessionType.INIT
# handoff の確認
if (project_dir / ".claude/handoffs/current.json").exists():
return SessionType.CONTINUE_FROM_HANDOFF
# 完了の確認
features = load_features(project_dir)
if all(f["passes"] for f in features):
return SessionType.COMPLETE
return SessionType.CONTINUE_IMPLEMENTATION
操作
1. セッションの作成
session = await SessionManager.create(
project_dir=project_dir,
model="claude-opus-4-5-20251101",
max_turns=1000,
tools=["Read", "Write", "Edit", "Bash", "Glob", "Grep"]
)
2. Initializer の実行
result = await session.run_initializer(
spec="Build a task management app with auth..."
)
# 作成されるもの:
# - feature_list.json (100 以上の機能)
# - init.sh (環境設定)
# - プロジェクトのスケルトン
3. 継続の実行
result = await session.run_continuation()
# 状態をロードし、現在の機能から再開
4. 自動継続
# 自動継続の構成
session.configure_auto_continue(
enabled=True,
delay_seconds=3
)
# セッション終了後、自動的に次を開始
await session.run()
# ... セッションが完了 ...
# [3 秒の遅延]
# 次のセッションが自動的に開始
5. 正常なシャットダウン
await session.shutdown(
save_state=True,
create_handoff=True
)
# 状態を保存し、次のセッションのために handoff を作成
セッション構成
@dataclass
class SessionConfig:
model: str = "claude-opus-4-5-20251101"
max_turns: int = 1000
timeout_ms: int = 600000
continue_delay: int = 3
max_sessions: int = None # 無制限
# ツールの構成
tools: list = field(default_factory=lambda: [
"Read", "Write", "Edit", "Bash", "Glob", "Grep"
])
# 権限
sandbox_enabled: bool = True
allowed_paths: list = field(default_factory=lambda: ["./**"])
マルチセッションフロー
SESSION 1: 初期化 + 機能 1-15
│
▼ (コンテキスト 85% → handoff)
SESSION 2: 再開 + 機能 16-30
│
▼ (コンテキスト 85% → handoff)
SESSION 3: 再開 + 機能 31-50
│
▼
COMPLETE: すべての機能がパスしました!
セッション状態の永続化
// .claude-session-state.json
{
"id": "session-20250115-100000",
"type": "CONTINUE_IMPLEMENTATION",
"status": "running",
"iteration": 5,
"started_at": "2025-01-15T10:00:00Z",
"features_this_session": ["auth-001", "auth-002"],
"context_usage": 0.65
}
プロンプト
Initializer プロンプト
あなたは自律的なコーディングプロジェクトを初期化しています。
SPECIFICATION:
{spec}
あなたのタスク:
1. 仕様を分析する
2. 100 以上のテスト可能な機能を持つ feature_list.json を生成する
3. 環境設定のために init.sh を作成する
4. 初期プロジェクト構造を構築する
5. Ini
(原文がここで切り詰められています) 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
AC Session Manager
Complete session lifecycle management for autonomous coding operations.
Overview
Manages the full session lifecycle:
- Session type detection (INIT vs CONTINUE)
- Session creation and configuration
- Auto-continuation between sessions
- Graceful shutdown with state preservation
Quick Start
Detect Session Type
from scripts.session_manager import SessionManager
manager = SessionManager(project_dir)
session_type = await manager.detect_type()
if session_type == "INIT":
# First run - initialize project
await manager.run_initializer()
elif session_type == "CONTINUE":
# Resume work
await manager.run_continuation()
elif session_type == "COMPLETE":
print("All features complete!")
Run Session
async with SessionManager(project_dir) as session:
result = await session.run(prompt)
print(f"Status: {result.status}")
Session Lifecycle
┌─────────────────────────────────────────────────────────────┐
│ SESSION LIFECYCLE │
├─────────────────────────────────────────────────────────────┤
│ │
│ 1. DETECT SESSION TYPE │
│ ├─ Check for feature_list.json │
│ ├─ If missing → INIT session │
│ ├─ If handoff exists → CONTINUE_FROM_HANDOFF │
│ ├─ If all pass → COMPLETE │
│ └─ Otherwise → CONTINUE_IMPLEMENTATION │
│ │
│ 2. CREATE SESSION │
│ ├─ Initialize SDK client │
│ ├─ Configure tools and permissions │
│ └─ Set working directory │
│ │
│ 3. RUN SESSION │
│ ├─ Execute prompt (initializer or coding) │
│ ├─ Handle tool calls │
│ └─ Capture results │
│ │
│ 4. END SESSION │
│ ├─ Save state │
│ ├─ Check completion status │
│ └─ Trigger auto-continue or shutdown │
│ │
└─────────────────────────────────────────────────────────────┘
Session Types
| Type | Condition | Action |
|---|---|---|
INIT |
No feature_list.json | Run initializer agent |
CONTINUE_FROM_HANDOFF |
handoffs/current.json exists | Resume from handoff |
CONTINUE_IMPLEMENTATION |
Features incomplete | Continue coding |
COMPLETE |
All features pass | Generate report, exit |
Detection Logic
def detect_session_type(project_dir: Path) -> SessionType:
# Check for initialization
if not (project_dir / "feature_list.json").exists():
return SessionType.INIT
# Check for handoff
if (project_dir / ".claude/handoffs/current.json").exists():
return SessionType.CONTINUE_FROM_HANDOFF
# Check completion
features = load_features(project_dir)
if all(f["passes"] for f in features):
return SessionType.COMPLETE
return SessionType.CONTINUE_IMPLEMENTATION
Operations
1. Create Session
session = await SessionManager.create(
project_dir=project_dir,
model="claude-opus-4-5-20251101",
max_turns=1000,
tools=["Read", "Write", "Edit", "Bash", "Glob", "Grep"]
)
2. Run Initializer
result = await session.run_initializer(
spec="Build a task management app with auth..."
)
# Creates:
# - feature_list.json (100+ features)
# - init.sh (environment setup)
# - Project scaffold
3. Run Continuation
result = await session.run_continuation()
# Loads state, resumes at current feature
4. Auto-Continue
# Configure auto-continuation
session.configure_auto_continue(
enabled=True,
delay_seconds=3
)
# After session ends, automatically starts next
await session.run()
# ... session completes ...
# [3 second delay]
# Next session starts automatically
5. Graceful Shutdown
await session.shutdown(
save_state=True,
create_handoff=True
)
# Saves state, creates handoff for next session
Session Configuration
@dataclass
class SessionConfig:
model: str = "claude-opus-4-5-20251101"
max_turns: int = 1000
timeout_ms: int = 600000
continue_delay: int = 3
max_sessions: int = None # Unlimited
# Tool configuration
tools: list = field(default_factory=lambda: [
"Read", "Write", "Edit", "Bash", "Glob", "Grep"
])
# Permissions
sandbox_enabled: bool = True
allowed_paths: list = field(default_factory=lambda: ["./**"])
Multi-Session Flow
SESSION 1: Initialize + Features 1-15
│
▼ (context 85% → handoff)
SESSION 2: Resume + Features 16-30
│
▼ (context 85% → handoff)
SESSION 3: Resume + Features 31-50
│
▼
COMPLETE: All features pass!
Session State Persistence
// .claude-session-state.json
{
"id": "session-20250115-100000",
"type": "CONTINUE_IMPLEMENTATION",
"status": "running",
"iteration": 5,
"started_at": "2025-01-15T10:00:00Z",
"features_this_session": ["auth-001", "auth-002"],
"context_usage": 0.65
}
Prompts
Initializer Prompt
You are initializing an autonomous coding project.
SPECIFICATION:
{spec}
Your tasks:
1. Analyze the specification
2. Generate feature_list.json with 100+ testable features
3. Create init.sh for environment setup
4. Scaffold initial project structure
5. Initialize git repository
6. Commit initial state
Output MUST include:
- feature_list.json (all features passes: false)
- init.sh (executable setup script)
- Project files (scaffold)
Continuation Prompt
You are continuing autonomous development.
Current state:
- Features completed: {completed}/{total}
- Current feature: {current_feature}
- Last action: {last_action}
Resume implementing features following TDD:
1. Select next incomplete feature
2. Write failing test (RED)
3. Implement to pass (GREEN)
4. Refactor as needed
5. Commit changes
Work on ONE feature at a time.
Update feature_list.json when feature passes.
Integration Points
- ac-config-manager: Gets session configuration
- ac-state-tracker: Saves/loads session state
- ac-hooks-manager: Registers Stop hook
- ac-handoff-coordinator: Creates handoff packages
- ac-autonomous-loop: Orchestrates sessions
References
references/SESSION-LIFECYCLE.md- Detailed lifecyclereferences/PROMPTS.md- Session promptsreferences/MULTI-SESSION.md- Multi-session patterns
Scripts
scripts/session_manager.py- Core SessionManagerscripts/session_detector.py- Session type detectionscripts/auto_continue.py- Auto-continuation logicscripts/prompts.py- Prompt templates