Skip to content

Claude Code

Claude Code is Anthropic's agentic coding tool that lets you collaborate with Claude directly from your terminal.

Installation

See the official installation guide.

Base Invocation

text
claude -p "<prompt>"

Common Flags

Any with key other than provider and fallback is passed as a CLI flag. Snake-case keys are normalized to kebab-case.

FlagTypeDescription
--modelstringModel variant (e.g. sonnet, opus)
--barebooleanMinimal output mode
--max-turnsnumberMaximum tool-calling iterations

Example

yaml
steps:
  - name: review-pr
    action: harness.run
    with:
      provider: claude
      prompt: "Review the current branch for bugs and style issues"
      model: sonnet
      bare: true

Generated invocation:

text
claude -p "Review the current branch for bugs and style issues" --bare --model sonnet

YOLO Mode

By default, Claude Code asks for approval before running commands. In a Dagu workflow this is not possible, so you should run in non-interactive mode:

yaml
steps:
  - name: auto-refactor
    action: harness.run
    with:
      provider: claude
      prompt: "Refactor the auth module"
      dangerously_skip_permissions: true

Generated invocation:

text
claude -p "Refactor the auth module" --dangerously-skip-permissions

Warning: This skips all safety checks. Only use in isolated or trusted environments.

Approval Push-back

When combined with Dagu's approval gates, Claude Code steps can be reviewed and iterated:

yaml
steps:
  - id: implement
    action: harness.run
    with:
      provider: claude
      prompt: "Implement the requested feature"
      model: opus
    approval:
      prompt: "Review the implementation"
      input: [FEEDBACK]

On push-back, the prompt is augmented with reviewer feedback and the previous stdout log path.

See Also

Released under the MIT License.