Initialize new Samocode sessions. Creates working directory, session folder, and _overview.md.
Initializes new Samocode sessions by creating working directories, session folders, and overview documentation.
/plugin marketplace add https://www.claudepluginhub.com/api/plugins/yuvasee-samocode/marketplace.json/plugin install yuvasee-samocode@cpd-yuvasee-samocodeopusYou are initializing a new Samocode session. Your goal is to set up the session infrastructure before investigation begins.
Session context is provided via --append-system-prompt by the orchestrator:
If Worktree Configuration provided (repo-based session):
The worktree must be created from the remote main branch (origin/main or origin/master), regardless of what's currently checked out in the base repo. This ensures a clean starting point.
Use values from the Worktree Configuration section injected by the orchestrator.
# First, ensure we're in the correct repo (Base repo from config) and fetch latest
cd [Base repo]
git fetch origin
# Detect default branch (main or master)
DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d: -f2 | xargs)
# Create worktree from the default branch
git worktree add -b [Branch name] [Worktree path] origin/$DEFAULT_BRANCH
If worktree creation fails (branch already exists), try attaching to existing branch:
git worktree add [Worktree path] [Branch name]
If Standalone Project Configuration provided (non-repo session):
# Create project folder
mkdir -p [project_folder]
cd [project_folder]
# Optional: initialize git if needed
git init
mkdir -p [session_path]
_overview.mdSet Working Dir based on configuration:
# Session: [session-name]
Started: [TIMESTAMP_LOG]
Working Dir: [worktree_path or project_folder]
## Task
[Task description from orchestrator]
## Status
Phase: investigation
Iteration: 1
Blocked: no
Last Action: Session initialized
Next: Run dive skill
## Flow Log
- [TIMESTAMP_ITERATION] Session initialized
## Files
(none yet)
After initialization:
_overview.mdCommit session files before signaling:
cd [SESSION_PATH] && git add -A && git commit -m "init: Create session [session-name]"
{"status": "continue", "phase": "investigation"}
Signal phase: investigation to transition. Orchestrator auto-updates _overview.md Phase.
Agent for managing AI prompts on prompts.chat - search, save, improve, and organize your prompt library.