CherryHQ/cherry-studio · error · RuntimeError

claude -p exited \nstderr

Error message

claude -p exited {result.returncode}\nstderr: {result.stderr}

What it means

Error "claude -p exited {result.returncode}\nstderr: {result.stderr}" thrown in CherryHQ/cherry-studio.

Solutions

  1. Read the stderr included in the message to see why the claude CLI failed.
  2. Verify the claude CLI is installed, on PATH, and authenticated before running improve_description.py.
  3. Retry after fixing the reported CLI error (auth, model access, or rate limit).

Example fix

Authenticate the CLI (claude login) and confirm `claude -p "hello"` succeeds, then rerun the script.

When it happens

Trigger: The skill-creator improve_description script shells out to `claude -p` and the CLI exits with a non-zero return code.

Common situations: Occurs when the Claude CLI is missing, unauthenticated, rate-limited, or the prompt run otherwise fails. The RuntimeError includes the exit code and captured stderr; the description improvement run aborts.


AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12). Data as JSON: /api/errors/a144438585338127. Report an issue: GitHub.

Appendix: source

Thrown at resources/skills/skill-creator/scripts/improve_description.py:45

    if model:
        cmd.extend(["--model", model])

    # Remove CLAUDECODE env var to allow nesting claude -p inside a
    # Claude Code session. The guard is for interactive terminal conflicts;
    # programmatic subprocess usage is safe. Same pattern as run_eval.py.
    env = {k: v for k, v in os.environ.items() if k != "CLAUDECODE"}

    result = subprocess.run(
        cmd,
        shell=False,
        input=prompt,
        capture_output=True,
        text=True,
        env=env,
        timeout=timeout,
    )
    if result.returncode != 0:
        raise RuntimeError(
            f"claude -p exited {result.returncode}\nstderr: {result.stderr}"
        )
    return result.stdout


def improve_description(
    skill_name: str,
    skill_content: str,
    current_description: str,
    eval_results: dict,
    history: list[dict],
    model: str,
    test_results: dict | None = None,
    log_dir: Path | None = None,
    iteration: int | None = None,
) -> str:
    """Call Claude to improve the description based on eval results."""
    failed_triggers = [

View on GitHub (pinned to 726446b54c)