project-session-manager

1
0
Source

Manage isolated dev environments with git worktrees and tmux sessions

Install

mkdir -p .claude/skills/project-session-manager && curl -L -o skill.zip "https://mcp.directory/api/skills/download/3744" && unzip -o skill.zip -d .claude/skills/project-session-manager && rm skill.zip

Installs to .claude/skills/project-session-manager

About this skill

Project Session Manager (PSM) Skill

psm is the compatibility alias for this canonical skill entrypoint.

Quick Start: For simple worktree creation without tmux sessions, use omc teleport:

omc teleport #123          # Create worktree for issue/PR
omc teleport my-feature    # Create worktree for feature
omc teleport list          # List worktrees

See Teleport Command below for details.

Automate isolated development environments using git worktrees and tmux sessions with Claude Code. Enables parallel work across multiple tasks, projects, and repositories.

Canonical slash command: /oh-my-claudecode:project-session-manager (alias: /oh-my-claudecode:psm).

Commands

CommandDescriptionExample
review <ref>PR review session/psm review omc#123
fix <ref>Issue fix session/psm fix omc#42
feature <proj> <name>Feature development/psm feature omc add-webhooks
list [project]List active sessions/psm list
attach <session>Attach to session/psm attach omc:pr-123
kill <session>Kill session/psm kill omc:pr-123
cleanupClean merged/closed/psm cleanup
statusCurrent session info/psm status

Project References

Supported formats:

  • Alias: omc#123 (requires ~/.psm/projects.json)
  • Full: owner/repo#123
  • URL: https://github.com/owner/repo/pull/123
  • Current: #123 (uses current directory's repo)

Configuration

Project Aliases (~/.psm/projects.json)

{
  "aliases": {
    "omc": {
      "repo": "Yeachan-Heo/oh-my-claudecode",
      "local": "~/Workspace/oh-my-claudecode",
      "default_base": "main"
    }
  },
  "defaults": {
    "worktree_root": "~/.psm/worktrees",
    "cleanup_after_days": 14
  }
}

Providers

PSM supports multiple issue tracking providers:

ProviderCLI RequiredReference FormatsCommands
GitHub (default)ghowner/repo#123, alias#123, GitHub URLsreview, fix, feature
JirajiraPROJ-123 (if PROJ configured), alias#123fix, feature

Jira Configuration

To use Jira, add an alias with jira_project and provider: "jira":

{
  "aliases": {
    "mywork": {
      "jira_project": "MYPROJ",
      "repo": "mycompany/my-project",
      "local": "~/Workspace/my-project",
      "default_base": "develop",
      "provider": "jira"
    }
  }
}

Important: The repo field is still required for cloning the git repository. Jira tracks issues, but you work in a git repo.

For non-GitHub repos, use clone_url instead:

{
  "aliases": {
    "private": {
      "jira_project": "PRIV",
      "clone_url": "git@gitlab.internal:team/repo.git",
      "local": "~/Workspace/repo",
      "provider": "jira"
    }
  }
}

Jira Reference Detection

PSM only recognizes PROJ-123 format as Jira when PROJ is explicitly configured as a jira_project in your aliases. This prevents false positives from branch names like FIX-123.

Jira Examples

# Fix a Jira issue (MYPROJ must be configured)
psm fix MYPROJ-123

# Fix using alias (recommended)
psm fix mywork#123

# Feature development (works same as GitHub)
psm feature mywork add-webhooks

# Note: 'psm review' is not supported for Jira (no PR concept)
# Use 'psm fix' for Jira issues

Jira CLI Setup

Install the Jira CLI:

# macOS
brew install ankitpokhrel/jira-cli/jira-cli

# Linux
# See: https://github.com/ankitpokhrel/jira-cli#installation

# Configure (interactive)
jira init

The Jira CLI handles authentication separately from PSM.

Directory Structure

~/.psm/
├── projects.json       # Project aliases
├── sessions.json       # Active session registry
└── worktrees/          # Worktree storage
    └── <project>/
        └── <type>-<id>/

Session Naming

TypeTmux SessionWorktree Dir
PR Reviewpsm:omc:pr-123~/.psm/worktrees/omc/pr-123
Issue Fixpsm:omc:issue-42~/.psm/worktrees/omc/issue-42
Featurepsm:omc:feat-auth~/.psm/worktrees/omc/feat-auth

Implementation Protocol

When the user invokes a PSM command, follow this protocol:

Parse Arguments

Parse {{ARGUMENTS}} to determine:

  1. Subcommand: review, fix, feature, list, attach, kill, cleanup, status
  2. Reference: project#number, URL, or session ID
  3. Options: --branch, --base, --no-claude, --no-tmux, etc.

Subcommand: review <ref>

Purpose: Create PR review session

Steps:

  1. Resolve reference:

    # Read project aliases
    cat ~/.psm/projects.json 2>/dev/null || echo '{"aliases":{}}'
    
    # Parse ref format: alias#num, owner/repo#num, or URL
    # Extract: project_alias, repo (owner/repo), pr_number, local_path
    
  2. Fetch PR info:

    gh pr view <pr_number> --repo <repo> --json number,title,author,headRefName,baseRefName,body,files,url
    
  3. Ensure local repo exists:

    # If local path doesn't exist, clone
    if [[ ! -d "$local_path" ]]; then
      git clone "https://github.com/$repo.git" "$local_path"
    fi
    
  4. Create worktree:

    worktree_path="$HOME/.psm/worktrees/$project_alias/pr-$pr_number"
    
    # Fetch PR branch
    cd "$local_path"
    git fetch origin "pull/$pr_number/head:pr-$pr_number-review"
    
    # Create worktree
    git worktree add "$worktree_path" "pr-$pr_number-review"
    
  5. Create session metadata:

    cat > "$worktree_path/.psm-session.json" << EOF
    {
      "id": "$project_alias:pr-$pr_number",
      "type": "review",
      "project": "$project_alias",
      "ref": "pr-$pr_number",
      "branch": "<head_branch>",
      "base": "<base_branch>",
      "created_at": "$(date -Iseconds)",
      "tmux_session": "psm:$project_alias:pr-$pr_number",
      "worktree_path": "$worktree_path",
      "source_repo": "$local_path",
      "github": {
        "pr_number": $pr_number,
        "pr_title": "<title>",
        "pr_author": "<author>",
        "pr_url": "<url>"
      },
      "state": "active"
    }
    EOF
    
  6. Update sessions registry:

    # Add to ~/.psm/sessions.json
    
  7. Create tmux session:

    tmux new-session -d -s "psm:$project_alias:pr-$pr_number" -c "$worktree_path"
    
  8. Launch Claude Code (unless --no-claude):

    tmux send-keys -t "psm:$project_alias:pr-$pr_number" "claude" Enter
    
  9. Output session info:

    Session ready!
    
      ID: omc:pr-123
      Worktree: ~/.psm/worktrees/omc/pr-123
      Tmux: psm:omc:pr-123
    
    To attach: tmux attach -t psm:omc:pr-123
    

Subcommand: fix <ref>

Purpose: Create issue fix session

Steps:

  1. Resolve reference (same as review)

  2. Fetch issue info:

    gh issue view <issue_number> --repo <repo> --json number,title,body,labels,url
    
  3. Create feature branch:

    cd "$local_path"
    git fetch origin main
    branch_name="fix/$issue_number-$(echo "$title" | tr ' ' '-' | tr '[:upper:]' '[:lower:]' | head -c 30)"
    git checkout -b "$branch_name" origin/main
    
  4. Create worktree:

    worktree_path="$HOME/.psm/worktrees/$project_alias/issue-$issue_number"
    git worktree add "$worktree_path" "$branch_name"
    
  5. Create session metadata (similar to review, type="fix")

  6. Update registry, create tmux, launch claude (same as review)

Subcommand: feature <project> <name>

Purpose: Start feature development

Steps:

  1. Resolve project (from alias or path)

  2. Create feature branch:

    cd "$local_path"
    git fetch origin main
    branch_name="feature/$feature_name"
    git checkout -b "$branch_name" origin/main
    
  3. Create worktree:

    worktree_path="$HOME/.psm/worktrees/$project_alias/feat-$feature_name"
    git worktree add "$worktree_path" "$branch_name"
    
  4. Create session, tmux, launch claude (same pattern)

Subcommand: list [project]

Purpose: List active sessions

Steps:

  1. Read sessions registry:

    cat ~/.psm/sessions.json 2>/dev/null || echo '{"sessions":{}}'
    
  2. Check tmux sessions:

    tmux list-sessions -F "#{session_name}" 2>/dev/null | grep "^psm:"
    
  3. Check worktrees:

    ls -la ~/.psm/worktrees/*/ 2>/dev/null
    
  4. Format output:

    Active PSM Sessions:
    
    ID                 | Type    | Status   | Worktree
    -------------------|---------|----------|---------------------------
    omc:pr-123        | review  | active   | ~/.psm/worktrees/omc/pr-123
    omc:issue-42      | fix     | detached | ~/.psm/worktrees/omc/issue-42
    

Subcommand: attach <session>

Purpose: Attach to existing session

Steps:

  1. Parse session ID: project:type-number

  2. Verify session exists:

    tmux has-session -t "psm:$session_id" 2>/dev/null
    
  3. Attach:

    tmux attach -t "psm:$session_id"
    

Subcommand: kill <session>

Purpose: Kill session and cleanup

Steps:

  1. Kill tmux session:

    tmux kill-session -t "psm:$session_id" 2>/dev/null
    
  2. Remove worktree:

    worktree_path=$(jq -r ".sessions[\"$session_id\"].worktree" ~/.psm/sessions.json)
    source_repo=$(jq -r ".sessions[\"$session_id\"].source_repo" ~/.psm/sessions.json)
    
    cd "$source_repo"
    git worktree remove "$worktree_path" --force
    
  3. Update registry:

    # Remove from sessions.json
    

Subcommand: cleanup

Purpose: Clean up merged PRs and closed issues

Steps:

  1. Read all sessions

  2. For each PR session, check if merged:

    gh pr view <pr_number> --repo <repo> --json merged,state
    
  3. **For each issue session, ch


Content truncated.

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

643969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

591705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318398

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

339397

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

451339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.