Skip to content

Commit 67d2430

Browse files
NiveditJainclaude
andauthored
[luv-17] Replace multi-slash-command injection with CLI flags and bump to 0.0.8 (#14)
The launch prefix joined /color, /remote-control, and /plan with newlines, but claude treats the positional prompt as one message — when it starts with '/', the rest (including newlines) becomes the first command's argument, so only /color ran and the color name was "cyan\n/remote-control". Swap to native CLI flags: --remote-control replaces the slash command, --permission-mode plan + positional prompt replaces /plan <prompt>. /color stays only in the no-prompt branch since it has no flag equivalent. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 71f5581 commit 67d2430

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

luv/__init__.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -350,20 +350,23 @@ def launch(clone_dir: Path, prompt: str | None, extra_env: dict[str, str] = {})
350350
settings = load_luv_settings(clone_dir)
351351
compose_file = (settings or {}).get("compose_file")
352352

353-
color_cmd = f"/color {pick_color()}"
354-
remote_cmd = "/remote-control"
355-
prefix = f"{color_cmd}\n{remote_cmd}"
356-
initial = f"{prefix}\n/plan {prompt}" if prompt else prefix
353+
common_flags = ["--dangerously-skip-permissions",
354+
"--model", "claude-opus-4-7",
355+
"--effort", "max",
356+
"--remote-control"]
357+
if prompt:
358+
mode_flags = ["--permission-mode", "plan"]
359+
initial_args = [prompt]
360+
else:
361+
mode_flags = ["--permission-mode", "bypassPermissions"]
362+
initial_args = [f"/color {pick_color()}"]
357363

358364
if compose_file:
359365
project = docker_project_name(clone_dir)
360366
start_docker(clone_dir, compose_file, project)
361367
try:
362368
base = docker_compose_base(clone_dir, compose_file, project)
363-
claude_cmd = ["claude", "--dangerously-skip-permissions",
364-
"--permission-mode", "bypassPermissions",
365-
"--model", "claude-opus-4-7", "--effort", "max",
366-
initial]
369+
claude_cmd = ["claude"] + common_flags + mode_flags + initial_args
367370
r = subprocess.run(base + ["exec", "-it"] + docker_env_flags(extra_env) + ["dev-environment"] + claude_cmd)
368371
sys.exit(r.returncode)
369372
finally:
@@ -372,11 +375,8 @@ def launch(clone_dir: Path, prompt: str | None, extra_env: dict[str, str] = {})
372375
claude_bin = shutil.which("claude")
373376
if not claude_bin:
374377
die("'claude' not found in PATH")
375-
base_args = [claude_bin, "--dangerously-skip-permissions",
376-
"--permission-mode", "bypassPermissions",
377-
"--model", "claude-opus-4-7", "--effort", "max"]
378378
os.environ.update(extra_env)
379-
os.execv(claude_bin, base_args + [initial])
379+
os.execv(claude_bin, [claude_bin] + common_flags + mode_flags + initial_args)
380380

381381

382382
def cmd_clean(force: bool = False) -> None:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "luv-cli"
7-
version = "0.0.7"
7+
version = "0.0.8"
88
description = "Launch Claude Code agents on GitHub repos with isolated workspaces and optional Docker dev environments"
99
requires-python = ">=3.10"
1010
license = "MIT"

0 commit comments

Comments
 (0)