claude-code-oneshot

Runs deterministic single-pass Claude Code tasks with explicit permissions.

3|Updated Jul 17, 2024
Ready to run
npx skills add https://github.com/Castrozan/.dotfiles --skill claude-code-oneshot
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: claude-code-oneshot
Source: https://github.com/Castrozan/.dotfiles/tree/main/agents/skills/claude-code-oneshot
Command: npx skills add https://github.com/Castrozan/.dotfiles --skill claude-code-oneshot

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables performing deep coding tasks with Claude Code in a single, deterministic session, eliminating back-and-forth prompts and enabling rapid delivery of verified results.

Core Features & Use Cases

  • One-shot execution: run tasks to completion in a single pass without iterative prompting.
  • Deterministic results: produce verifiable code and outputs you can test immediately.
  • Guided workflow: operate within a git-repo workspace and apply changes with explicit permissions.

Quick Start

One-shot task (exits when done) claude --print "Your detailed task here" --dangerously-skip-permissions

In a specific directory cd /path/to/project && claude --print "Build X" --dangerously-skip-permissions

Frequently Asked Questions about claude-code-oneshot

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate code refactoring with Claude Code in a single pass?▼

Automate code refactoring by running Claude Code in a one-shot session using the --print flag with --dangerously-skip-permissions. This executes complex coding tasks deterministically in a single pass without iterative prompting, requiring a git repository workspace.

Can I run Claude Code one-shot sessions for feature implementation without back-and-forth prompts?▼

Yes, Claude Code one-shot sessions handle feature implementation without back-and-forth prompts by using the --print and --dangerously-skip-permissions CLI options. This enables deterministic, permission-controlled execution that exits automatically upon task completion.

Does one-shot Claude Code require a git repository to run coding tasks?▼

Yes, one-shot Claude Code requires a git repository workspace to run coding tasks. The git workspace provides the necessary version control context for applying changes and verifying results during deep coding sessions like refactoring or quick prototyping.

What is the best way to execute deterministic AI-assisted coding tasks in a git workspace?▼

The best way to execute deterministic AI-assisted coding tasks is using Claude Code one-shot execution with --print and --dangerously-skip-permissions flags. This approach ensures verifiable code outputs you can test immediately within a permission-controlled git repository environment.

Why use --dangerously-skip-permissions when running one-shot coding tasks with Claude?▼

The --dangerously-skip-permissions flag enables deterministic, permission-controlled execution by bypassing interactive permission prompts during one-shot Claude Code sessions. This allows complex coding tasks like refactoring to run to completion automatically without user intervention.

Are there limitations to using one-shot Claude Code for complex prototyping tasks?▼

One-shot Claude Code requires clear success criteria for complex prototyping tasks and is designed for single-pass execution. It operates within a git workspace using --dangerously-skip-permissions, meaning tasks without well-defined completion criteria may not produce verifiable results.