home / skills / chachamaru127 / claude-code-harness / session-control

session-control skill

/skills/session-control

This skill switches session state for /work --resume and --fork flags, enabling reliable resume and branching within workflows.

npx playbooks add skill chachamaru127/claude-code-harness --skill session-control

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.1 KB
---
name: session-control
description: "/workのセッションresume/forkを制御。ワークフロー内部用。Do NOT load for: user session management, login state, app state handling."
description-en: "Controls session resume/fork for /work based on flags. Internal use only from workflow. Do NOT load for: user session management, login state, app state handling."
description-ja: "/workのセッションresume/forkを制御。ワークフロー内部用。Do NOT load for: user session management, login state, app state handling."
allowed-tools: ["Read", "Bash", "Write", "Edit"]
user-invocable: false
---

# Session Control Skill

/work の `--resume` / `--fork` フラグに応じてセッション状態を切り替える。

## 機能詳細

| 機能 | 詳細 |
|------|------|
| **セッション再開/分岐** | See [references/session-control.md](references/session-control.md) |

## 実行手順

1. workflow から渡された変数を確認
2. `scripts/session-control.sh` を適切な引数で実行
3. `session.json` と `session.events.jsonl` の更新を確認

Overview

This skill controls session resume and fork behavior for the /work workflow. It toggles session state based on --resume and --fork flags and updates session artifacts used inside autonomous development cycles. Do NOT load this skill for user session management, login state, or general app state handling.

How this skill works

The skill inspects variables passed from the workflow to determine whether to resume or fork the current session. It runs a shell helper (scripts/session-control.sh) with the appropriate arguments, then validates that session.json and session.events.jsonl were updated as expected. It is designed strictly for internal workflow orchestration within the Plan→Work→Review loop.

When to use it

  • Switching a work session into resume mode from a workflow step
  • Forking a session to create an independent branch of work state
  • Automating session-state transitions inside CI-style development pipelines
  • Coordinating session artifacts between autonomous task stages

Best practices

  • Only invoke from trusted workflow steps; do not expose to end-user flows
  • Pass explicit flags (--resume or --fork) and validate inputs before execution
  • Ensure scripts/session-control.sh is executable and checked into the workflow image
  • Verify session.json and session.events.jsonl integrity after the script runs
  • Keep this skill out of authentication, login, or general app state code paths

Example use cases

  • A workflow step resumes a paused developer session to continue a Plan→Work→Review cycle
  • Creating a forked session when branching experiment work without altering the main session
  • Automating session artifact updates as part of nightly autonomous testing
  • Chaining multiple autonomous tasks where each task may resume or fork state

FAQ

Can this skill handle user login or app-wide state?

No. This skill is only for internal workflow session control and must not be used for login or app state management.

What files does the skill update?

It runs the session control script and checks that session.json and session.events.jsonl are updated accordingly.