AI Agent Hub
Back to skills
Claude Code One-Shot CLI icon

Claude Code One-Shot CLI

Development Updated 2026.08.29

Paste the following prompt into your AI chat to install this skill:

Install @user_bbc7674c/claude-coder-cli according to https://skillhub.cn/install/skillhub.md.

About this skill

Problem

Automation workflows often stall on interactive confirmation, PTY dependency, or background tasks that are hard to observe. Claude Code CLI is capable, but when embedded directly in scripts, permission prompts, foreground blocking, and directory drift can prevent unattended execution. Script integrations especially need predictable output, a controlled workdir, and an execution path that does not depend on manual confirmation.

How it works

The skill wraps Claude Code as a one-shot coding agent. Its core requirement is to always use --print and --permission-mode bypassPermissions, which avoids confirmation prompts and keeps the output non-interactive. Tasks can run in the current directory or be pinned with workdir. Short tasks are suited to foreground execution; longer tasks can be run in the background and checked with process action:log. The documentation stresses not using PTY for Claude Code, because Claude Code does not require PTY and PTY can break the flow.

Boundaries

It is best for well-scoped engineering tasks such as feature building, refactoring, debugging, testing, and code review, but prompts must be specific. bypassPermissions reduces interaction friction while expanding automatic execution scope, so it should not be run casually in untrusted directories. Background tasks without monitoring can appear complete while still lacking verification.

Use Cases

  • A local script calls Claude Code to make a one-off feature change and prints output without confirmation dialogs.
  • Run a one-shot refactor or test update in a pinned repo directory, with the agent running in the background.
  • Use it in CI or local jobs to request code review, then check background progress via the log command.
  • Debug a failing module by sending a specific one-shot prompt and receiving suggested code changes.

Best For

  • Engineers who maintain local automation and need non-interactive Claude Code execution
  • SRE or platform engineers who run longer coding tasks in the background and check logs
  • Backend engineers who embed Claude Code in scripts for refactoring, tests, and review
  • Independent developers who need one-shot coding tasks inside a pinned project directory