{
  "schemaVersion": "1.0",
  "item": {
    "slug": "claude-code-runner",
    "name": "Claude Code Runner",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/lhl09120/claude-code-runner",
    "canonicalUrl": "https://clawhub.ai/lhl09120/claude-code-runner",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/claude-code-runner",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=claude-code-runner",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md",
      "clawhub.json",
      "scripts/run_claude.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "claude-code-runner",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-01T11:28:07.751Z",
      "expiresAt": "2026-05-08T11:28:07.751Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=claude-code-runner",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=claude-code-runner",
        "contentDisposition": "attachment; filename=\"claude-code-runner-0.1.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "claude-code-runner"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/claude-code-runner"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/claude-code-runner",
    "agentPageUrl": "https://openagent3.xyz/skills/claude-code-runner/agent",
    "manifestUrl": "https://openagent3.xyz/skills/claude-code-runner/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/claude-code-runner/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Overview",
        "body": "A wrapper skill for running Claude Code programmatically in non-interactive environments. Uses PTY (pseudo-terminal) to handle TTY-required operations and automatically responds to confirmation prompts."
      },
      {
        "title": "Features",
        "body": "PTY-based execution: Works in non-TTY environments (containers, CI/CD, background processes)\nAuto-respond to prompts: Automatically answers \"Do you want to...\" confirmations\nUser switching: Runs as specified non-root user\nFile synchronization: Copies project to temp directory, executes, syncs changes back\nTimeout handling: Configurable timeout with proper cleanup\nOutput capture: Captures and returns full stdout/stderr"
      },
      {
        "title": "Installation",
        "body": "# Clone the skill\ngit clone https://github.com/lhl09120/claude-code-runner-en.git\n\n# Make script executable\nchmod +x claude-code-runner-en/scripts/run_claude.py"
      },
      {
        "title": "Basic Usage",
        "body": "from claude_code_runner import run_claude_code\n\nresult = run_claude_code(\n    workdir='/path/to/project',\n    prompt='Refactor the authentication module to use JWT tokens',\n    user='lighthouse',\n    timeout=300\n)\n\nprint(result)"
      },
      {
        "title": "Via Command Line",
        "body": "python3 scripts/run_claude.py /path/to/project \"Your task description here\""
      },
      {
        "title": "Advanced Options",
        "body": "result = run_claude_code(\n    workdir='/root/repo/my-project',\n    prompt='''\n    1. Review the codebase\n    2. Identify security vulnerabilities\n    3. Fix any issues found\n    4. Add appropriate tests\n    ''',\n    user='developer',\n    timeout=600  # 10 minutes\n)"
      },
      {
        "title": "run_claude_code(workdir, prompt, user='lighthouse', timeout=300)",
        "body": "Execute a Claude Code task in a PTY environment.\n\nParameters:\n\nworkdir (str): Working directory containing the project\nprompt (str): Natural language task description\nuser (str): User to run as (default: 'lighthouse')\ntimeout (int): Timeout in seconds (default: 300)\n\nReturns:\n\nstr: Combined stdout and stderr output\n\nBehavior:\n\nCopies project to temporary directory\nChanges ownership to specified user\nExecutes Claude Code via PTY\nAuto-responds to confirmation prompts\nSyncs changes back to original directory\nCleans up temporary files"
      },
      {
        "title": "1. Automated Code Review",
        "body": "result = run_claude_code(\n    workdir='/root/repo/project',\n    prompt='Review this codebase and identify potential bugs or improvements'\n)"
      },
      {
        "title": "2. Refactoring Tasks",
        "body": "result = run_claude_code(\n    workdir='/root/repo/legacy-app',\n    prompt='Refactor the database layer to use SQLAlchemy ORM instead of raw SQL'\n)"
      },
      {
        "title": "3. Adding Features",
        "body": "result = run_claude_code(\n    workdir='/root/repo/api-service',\n    prompt='''\n    Add a new REST endpoint for user profile management:\n    - GET /api/users/{id}/profile\n    - PUT /api/users/{id}/profile\n    - Include validation and error handling\n    - Add unit tests\n    '''\n)"
      },
      {
        "title": "4. Bug Fixes",
        "body": "result = run_claude_code(\n    workdir='/root/repo/web-app',\n    prompt='Fix the memory leak in the WebSocket connection handler'\n)"
      },
      {
        "title": "Requirements",
        "body": "Python 3.8+\nClaude Code installed and in PATH\nUnix-like environment (Linux/macOS)\nRoot or sudo access (for user switching)"
      },
      {
        "title": "Environment Variables",
        "body": "CLAUDE_CODE_USER: Default user to run as (default: 'lighthouse')\nCLAUDE_CODE_TIMEOUT: Default timeout in seconds (default: 300)"
      },
      {
        "title": "Customization",
        "body": "Edit scripts/run_claude.py to customize:\n\nAuto-response keywords\nTemp directory location\nSync behavior\nOutput formatting"
      },
      {
        "title": "\"Permission denied\" errors",
        "body": "Ensure the script is run with sufficient privileges to:\n\nCreate temporary directories\nChange file ownership\nSwitch to target user"
      },
      {
        "title": "Claude Code not found",
        "body": "Make sure Claude Code is installed and in the system PATH:\n\nwhich claude"
      },
      {
        "title": "Task timeout",
        "body": "Increase the timeout for long-running tasks:\n\nrun_claude_code(workdir, prompt, timeout=600)  # 10 minutes"
      },
      {
        "title": "Interactive prompts not auto-responded",
        "body": "Add new prompt patterns to the auto-respond logic:\n\nif b'new prompt text' in output:\n    os.write(master_fd, b'y\\n')"
      },
      {
        "title": "Limitations",
        "body": "Requires Unix-like environment (uses PTY)\nRequires root/sudo for user switching\nClaude Code must be installed separately\nMay not handle all edge cases of interactive prompts"
      },
      {
        "title": "License",
        "body": "MIT License\n\nCopyright (c) 2026 lhl09120\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nSee LICENSE file for full details."
      },
      {
        "title": "v1.0.0 (2026-02-27)",
        "body": "Initial release\nPTY-based Claude Code execution\nAuto-response to confirmation prompts\nFile synchronization\nUser switching support"
      }
    ],
    "body": "Claude Code Runner\nOverview\n\nA wrapper skill for running Claude Code programmatically in non-interactive environments. Uses PTY (pseudo-terminal) to handle TTY-required operations and automatically responds to confirmation prompts.\n\nFeatures\nPTY-based execution: Works in non-TTY environments (containers, CI/CD, background processes)\nAuto-respond to prompts: Automatically answers \"Do you want to...\" confirmations\nUser switching: Runs as specified non-root user\nFile synchronization: Copies project to temp directory, executes, syncs changes back\nTimeout handling: Configurable timeout with proper cleanup\nOutput capture: Captures and returns full stdout/stderr\nInstallation\n# Clone the skill\ngit clone https://github.com/lhl09120/claude-code-runner-en.git\n\n# Make script executable\nchmod +x claude-code-runner-en/scripts/run_claude.py\n\nUsage\nBasic Usage\nfrom claude_code_runner import run_claude_code\n\nresult = run_claude_code(\n    workdir='/path/to/project',\n    prompt='Refactor the authentication module to use JWT tokens',\n    user='lighthouse',\n    timeout=300\n)\n\nprint(result)\n\nVia Command Line\npython3 scripts/run_claude.py /path/to/project \"Your task description here\"\n\nAdvanced Options\nresult = run_claude_code(\n    workdir='/root/repo/my-project',\n    prompt='''\n    1. Review the codebase\n    2. Identify security vulnerabilities\n    3. Fix any issues found\n    4. Add appropriate tests\n    ''',\n    user='developer',\n    timeout=600  # 10 minutes\n)\n\nAPI Reference\nrun_claude_code(workdir, prompt, user='lighthouse', timeout=300)\n\nExecute a Claude Code task in a PTY environment.\n\nParameters:\n\nworkdir (str): Working directory containing the project\nprompt (str): Natural language task description\nuser (str): User to run as (default: 'lighthouse')\ntimeout (int): Timeout in seconds (default: 300)\n\nReturns:\n\nstr: Combined stdout and stderr output\n\nBehavior:\n\nCopies project to temporary directory\nChanges ownership to specified user\nExecutes Claude Code via PTY\nAuto-responds to confirmation prompts\nSyncs changes back to original directory\nCleans up temporary files\nUse Cases\n1. Automated Code Review\nresult = run_claude_code(\n    workdir='/root/repo/project',\n    prompt='Review this codebase and identify potential bugs or improvements'\n)\n\n2. Refactoring Tasks\nresult = run_claude_code(\n    workdir='/root/repo/legacy-app',\n    prompt='Refactor the database layer to use SQLAlchemy ORM instead of raw SQL'\n)\n\n3. Adding Features\nresult = run_claude_code(\n    workdir='/root/repo/api-service',\n    prompt='''\n    Add a new REST endpoint for user profile management:\n    - GET /api/users/{id}/profile\n    - PUT /api/users/{id}/profile\n    - Include validation and error handling\n    - Add unit tests\n    '''\n)\n\n4. Bug Fixes\nresult = run_claude_code(\n    workdir='/root/repo/web-app',\n    prompt='Fix the memory leak in the WebSocket connection handler'\n)\n\nRequirements\nPython 3.8+\nClaude Code installed and in PATH\nUnix-like environment (Linux/macOS)\nRoot or sudo access (for user switching)\nConfiguration\nEnvironment Variables\nCLAUDE_CODE_USER: Default user to run as (default: 'lighthouse')\nCLAUDE_CODE_TIMEOUT: Default timeout in seconds (default: 300)\nCustomization\n\nEdit scripts/run_claude.py to customize:\n\nAuto-response keywords\nTemp directory location\nSync behavior\nOutput formatting\nTroubleshooting\n\"Permission denied\" errors\n\nEnsure the script is run with sufficient privileges to:\n\nCreate temporary directories\nChange file ownership\nSwitch to target user\nClaude Code not found\n\nMake sure Claude Code is installed and in the system PATH:\n\nwhich claude\n\nTask timeout\n\nIncrease the timeout for long-running tasks:\n\nrun_claude_code(workdir, prompt, timeout=600)  # 10 minutes\n\nInteractive prompts not auto-responded\n\nAdd new prompt patterns to the auto-respond logic:\n\nif b'new prompt text' in output:\n    os.write(master_fd, b'y\\n')\n\nLimitations\nRequires Unix-like environment (uses PTY)\nRequires root/sudo for user switching\nClaude Code must be installed separately\nMay not handle all edge cases of interactive prompts\nLicense\n\nMIT License\n\nCopyright (c) 2026 lhl09120\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nSee LICENSE file for full details.\n\nChangelog\nv1.0.0 (2026-02-27)\nInitial release\nPTY-based Claude Code execution\nAuto-response to confirmation prompts\nFile synchronization\nUser switching support"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/lhl09120/claude-code-runner",
    "publisherUrl": "https://clawhub.ai/lhl09120/claude-code-runner",
    "owner": "lhl09120",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/claude-code-runner",
    "downloadUrl": "https://openagent3.xyz/downloads/claude-code-runner",
    "agentUrl": "https://openagent3.xyz/skills/claude-code-runner/agent",
    "manifestUrl": "https://openagent3.xyz/skills/claude-code-runner/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/claude-code-runner/agent.md"
  }
}