agentleFS
buddyhbuddyh/agent-skills/project-spawn/SKILL.md

project-spawn

Skill5 starsChanged 8 months agoMITView on GitHub

Spawn a new Claude Code or Codex session in a project directory with context handoff. This skill should be used when discussion shifts to a different project/repo and the user wants to work on it in a dedicated session. Creates a handoff document with relevant context from the current conversation, then launches a new tmux session ready to continue.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If explicit path/name provided: Use directly

    line 25
  2. Very specific:

    If project name provided: Search for matching directories in common locations (~/repos/, ~/projects/, etc.)

    line 26
  3. Distinctive:

    If target directory doesn't exist, ask user:

    line 31
  4. Distinctive:

    Create as requested before proceeding to Step 2.

    line 40
  5. Very specific:

    Write PROJECT_HANDOFF.md to the target project directory:

    line 56
  6. Distinctive:

    Create a new tmux session named after the project

    line 89
  7. Distinctive:

    Start the AI agent with initial prompt to read the handoff

    line 91

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Project Spawn

Overview

Transfer context from the current conversation to a new session in a different project directory. This enables seamless context handoff when pivoting from a general session to focused project work.

Platform Support

  • Claude Code: claude CLI
  • Codex: codex CLI

The handoff workflow is identical on both platforms.

Workflow

Step 1: Resolve Target Project

Determine the target project directory:

  1. If explicit path/name provided: Use directly
  2. If project name provided: Search for matching directories in common locations (~/repos/, ~/projects/, etc.)
  3. If no target specified: Detect from recent conversation context or ask the user

Step 1b: Handle Non-Existent Directory

If target directory doesn't exist, ask user:

"Directory <path> doesn't exist. Want me to create it?"

  • Create folder only
  • Create folder + init git repo
  • Create folder + init git + create GitHub repo (public)
  • Create folder + init git + create GitHub repo (private)
  • Cancel

Create as requested before proceeding to Step 2.

Step 2: Extract Relevant Context

Analyze the last 5-10 messages for content relevant to the target project:

  • Tasks or work items discussed
  • Specific files, scripts, or features mentioned
  • Decisions made or questions raised
  • Any errors or issues identified
  • Uncommitted changes noted

Focus only on information relevant to the target project, not the entire conversation.

Step 3: Create Handoff Document

Write PROJECT_HANDOFF.md to the target project directory:

# Project Handoff - [DATE] [TIME]

## Context
[Why this handoff is happening - what triggered the pivot]

## Discussion Summary
[Relevant context extracted from conversation]

## Specific Tasks/Questions
- [Actionable items identified]

## Files/Areas Mentioned
- [Specific files or code areas referenced]

## Suggested Starting Point
[What to do first in this session]

Step 4: Launch Session

~/.claude/skills/project-spawn/scripts/spawn_session.sh "<project-path>" "<session-name>" [--agent claude|codex]

Options:

FlagDescription
--agent claude|codexWhich AI agent to launch (default: auto-detect from environment)

The script will:

  1. Create a new tmux session named after the project
  2. Change to the project directory
  3. Start the AI agent with initial prompt to read the handoff

Platform-specific launch commands:

  • Claude Code: claude
  • Codex: codex

Step 5: Confirm to User

Report:

Spawned: <session-name>
Directory: <project-path>
Handoff: PROJECT_HANDOFF.md created

To attach: tmux attach -t <session-name>

Quick Reference

Invocation: /spawn <project-name-or-path> or /spawn (auto-detect)

Session naming: Uses repo folder name (e.g., my-project)

Handoff location: <project-dir>/PROJECT_HANDOFF.md

Examples:

# Spawn with auto-detected agent
/spawn my-project

# Use Codex instead of Claude
/spawn my-project --agent codex

Setup

chmod +x ~/.claude/skills/project-spawn/scripts/*.sh

Resources

scripts/

  • spawn_session.sh - Creates tmux session and launches AI agent with handoff context

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.