ce-compound: pre-resolved repo-name command (git ... | sed ...) blocked by Claude Code multi-operation permission check

Abierto Apto para principiantes
#795 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
66/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
git, typescript

Línea de trabajo

Lee plugins/compound-engineering/skills/ce-compound/SKILL.md alrededor de la línea del nombre de Repo resuelto previamente y compárala con el patrón del centinela sin resolver mencionado para ce-commit y ce-commit-push-pr. Confirma cómo usa la skill el valor del repositorio resuelto y, luego, actualiza el comando y sus instrucciones del dispatcher para que el nombre de Repo se derive sin un comando canalizado. Se habrá completado cuando /ce-compound supere la resolución previa dentro de un git worktree.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Bug Description

Component: Skill — ce-compound
Summary: Invoking /ce-compound from inside a git repo fails immediately because the pre-resolved "Repo name" command pipes git rev-parse into sed. Claude Code's permission system treats piped commands as multiple operations and refuses to auto-approve, so the substitution never runs and the skill aborts before Phase 1.

This is not the same issue as #730 (which was about being outside a git repo / missing || true). I'm in a normal git worktree with broad git permissions allowlisted; the failure is the multi-op check, not exit-code handling.

Environment

  • Plugin Version: compound-engineering 3.3.2 (from every-marketplace)
  • Agent Platform: Claude Code
  • OS: Darwin 24.6.0 (macOS, arm64)
  • Working dir: inside a git worktree (git rev-parse would succeed)

What Happened

Error: Shell command permission check failed for pattern
"!`git rev-parse --path-format=absolute --git-common-dir 2>/dev/null | sed -E 's|/\.git/?$||; s|.*/||'`":
This Bash command contains multiple operations. The following parts require approval:
  git rev-parse --path-format=absolute --git-common-dir
  sed -E 's|/\.git/?$||; s|.*/||'

Skill never executes. The other pre-resolved line (git rev-parse --abbrev-ref HEAD) works fine — it's the | sed chain that trips the check.

Root Cause

plugins/compound-engineering/skills/ce-compound/SKILL.md (around line 25):

**Repo name (pre-resolved):** !`git rev-parse --path-format=absolute --git-common-dir 2>/dev/null | sed -E 's|/\.git/?$||; s|.*/||'`

Claude Code's bash permission layer splits piped commands and requires each segment to be individually allowlisted. Even with Bash(git rev-parse:*) permitted, the sed segment isn't, so the whole !...`` substitution is blocked rather than executed.

Suggested Fixes

Pick whichever fits the skill's defensive style; any of these avoids the pipe:

Option A — let git produce the basename directly (no second tool):

-**Repo name (pre-resolved):** !`git rev-parse --path-format=absolute --git-common-dir 2>/dev/null | sed -E 's|/\.git/?$||; s|.*/||'`
+**Repo name (pre-resolved):** !`basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo '__REPO_UNRESOLVED__'`

(Still two commands, but basename is usually allowlisted; if not, swap for option B.)

Option B — emit the toplevel path and let the agent take the basename:

-**Repo name (pre-resolved):** !`git rev-parse --path-format=absolute --git-common-dir 2>/dev/null | sed -E 's|/\.git/?$||; s|.*/||'`
+**Repo toplevel (pre-resolved):** !`git rev-parse --show-toplevel 2>/dev/null || echo '__REPO_UNRESOLVED__'`

Then update the "If the lines above resolved..." instruction to tell the dispatcher to take the basename of the path.

Option C — bundle into a single shell invocation (still one command from the permission system's perspective if wrapped):

-**Repo name (pre-resolved):** !`git rev-parse --path-format=absolute --git-common-dir 2>/dev/null | sed -E 's|/\.git/?$||; s|.*/||'`
+**Repo name (pre-resolved):** !`sh -c 'd=$(git rev-parse --show-toplevel 2>/dev/null) && printf "%s" "${d##*/}"' 2>/dev/null || echo '__REPO_UNRESOLVED__'`

(Permission-fragile — depends on whether sh -c is allowlisted in a given environment.)

I'd recommend B — it's the simplest, matches the existing __*_UNRESOLVED__ sentinel pattern used in ce-commit/ce-commit-push-pr, and shifts the trivial string manipulation to the agent where it belongs.

Repro

  1. Open Claude Code in any git worktree.
  2. Run /ce-compound.
  3. Observe Shell command permission check failed ... contains multiple operations before any phase begins.

Additional Context

The companion line right below (git rev-parse --abbrev-ref HEAD) does not use a pipe and works correctly, which confirms the trigger is the | sed chain, not git itself.

Lenguaje dominante
TypeScript
Estrellas
25.6k
Forks
2.1k
Merge medio
3 h 57 min
PR fusionados (30 d)
170

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de EveryInc/compound-engineering-plugin

Todos los issues de EveryInc/compound-engineering-plugin

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.