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.

For containerized Dagu runs, see Run Claude Code in a Container.

Base Invocation ​

text
claude -p "<prompt>"

Common Flags ​

Any with key other than the reserved keys prompt, stdin, provider, fallback, managed, and acp_permission is passed as a CLI flag. Snake-case keys are normalized to kebab-case.

FlagTypeDescription
--modelstringModel variant (e.g. sonnet, opus)
--barebooleanMinimal mode: skips hooks, LSP, plugin sync, auto-memory, CLAUDE.md discovery, and keychain reads
--max-turnsnumberMaximum tool-calling iterations

bare: true skips keychain reads, so a subscription login is not visible to the step and the run fails with Not logged in · Please run /login. Use it only when the credential comes from ANTHROPIC_API_KEY in the step environment.

Example ​

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

Generated invocation:

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

YOLO Mode ​

By default, Claude Code asks for approval before running commands. A harness.run step has no terminal to answer those prompts, so 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.

Push-back ​

A human task after a Claude Code step lets a reviewer send the work back:

yaml
steps:
  - id: implement
    action: harness.run
    with:
      provider: claude
      prompt: |
        Implement the requested feature
      model: opus

  - id: review
    depends: [implement]
    action: human.task
    with:
      prompt: Review the implementation
      push_back:
        rewind_to: implement
        form:
          type: object
          required: [feedback]
          properties:
            feedback:
              type: string

On push-back, the prompt is augmented with reviewer feedback and the previous stdout log path. See Agent Loops for repeating the step until a check passes and for review workflows.

See Also ​

Dagu is open source under the GNU General Public License v3.0.