/worktree-check · Comandos slash para Claude Code | Prompt Studio
    1. Claude Code
    2. Comandos slash
    3. /worktree-check
    Claude Code · Comandos slashGit

    /worktree-check

    Muestra el estado del worktree, la rama y la tarea asignada.

    por davila7/claude-code-templates

    git-workflow

    Licencia: MITVer original

    Instalación

    npx claude-code-templates@latest --command git-workflow/worktree-check

    Contenido

    Dónde va: .claude/commands/worktree-check.md

    ---
    allowed-tools: Bash(git:*), Bash(cat:*), Bash(pwd:*), Bash(ls:*)
    description: Check current worktree status, branch, and assigned task
    ---
    
    # Worktree Status Check
    
    Verify the current worktree environment and show task details.
    
    ## Instructions
    
    You are inside a worktree (or the main repo). Gather and display the current status clearly.
    
    ### Step 1: Detect Worktree
    
    1. Get the current directory: `pwd`
    2. List all worktrees: `git worktree list`
    3. Determine if the current directory is a worktree (not the main working tree). The main working tree is listed first in `git worktree list` output — if the current path matches the first entry, this is the main repo, not a worktree.
    
    If this is **not** a worktree, inform the user:
    > You're in the main repository, not a worktree. Use `/worktree-init` to create worktrees.
    
    Then list any existing worktrees and exit.
    
    ### Step 2: Show Branch Info
    
    1. Get current branch: `git branch --show-current`
    2. Verify it follows the `claude/*`, `claude-daniel/*`, or `review/*` naming convention
    3. Show how many commits ahead of origin/main: `git rev-list --count origin/main..HEAD`
    
    ### Step 3: Read Task
    
    1. Check if `.worktree-task.md` exists in the worktree root
    2. If it exists, read and display its contents
    3. If it doesn't exist, note that no task file was found (may have been created manually)
    
    ### Step 4: Show Working Status
    
    Run and display:
    1. `git status --short` — show modified, staged, and untracked files
    2. `git diff --stat` — show a summary of unstaged changes
    
    ### Step 5: Display Summary
    
    Present a clean summary:
    
    ```
    Worktree Status
    ──────────────────────────────────
    Branch:    claude/<name>
    Task:      <task description from .worktree-task.md>
    Commits:   <N> ahead of main
    Modified:  <N> files
    Staged:    <N> files
    Untracked: <N> files
    ──────────────────────────────────
    ```
    
    If there are changes ready to deliver, suggest: "Run `/worktree-deliver` when you're ready to commit, push, and create a PR."
    

    Más en Comandos slash

    • /commit

      Redacta un commit con Conventional Commits a partir de los cambios en stage.

    • /review

      Revisa el diff actual buscando bugs, casos borde y problemas de seguridad.

    • /tests

      Escribe tests para el archivo o función que indiques.

    • /changelog

      Genera las notas de versión desde el último tag.

    • /explain

      Explica cómo funciona un archivo o módulo, con un diagrama del flujo.

    • /cleanup

      Elimina imports, variables y código muerto sin cambiar el comportamiento.

    Ver todo en Comandos slash (717) →

    Tu colección definitiva de prompts de IA. Inspírate, explora ejemplos y crea con IA.

    Hubs principales

    • Prompts
    • Imágenes
    • Videos
    • Generar Videos
    • Plantillas
    • Animaciones
    • Precios
    • Conoce
    • Afiliado

    Explorar por tipo

    • Kits de componentes
    • Etiquetas de imagen
    • Etiquetas de video
    • Webs

    Temas populares

    • Música
    • Portafolio
    • Gaming
    • Viajes
    • Nano Banana Pro

    Legal

    • Términos de uso
    • Política de privacidad
    • Política de cookies
    • Política de licencias
    • Política de reembolsos
    • Términos del programa de afiliados
    • Términos de Crowdfunding

    Magzin LLC, 800 Third Avenue Associates, New York, NY, 10022, United States

    © 2026 Prompt Studio by Magzin. Todos los derechos reservados.