NachschlagenQuellenregister

Dokumentationerreichbar

Claude Code, Run Claude Code pro­gram­ma­ti­cally

code.claude.com (externe Seite)

Die Her­stel­ler­do­ku­men­ta­tion zum Lauf ohne Terminal mit claude -p. Im Abschnitt zu unbeaufsichtigten Läufen steht, was mit einer Rückfrage geschieht, die niemand beantwortet: Ohne angeschlossenes Programm wird sie abgelehnt und der Lauf geht weiter. Mit einem Programm als Antwortgeber, etwa über das Agent SDK, wartet der Lauf auf dessen Antwort, bis ein eigener Schalter das abstellt. Mit --output-format stream-json steht jede Ablehnung als eigene Meldung im Ausgabestrom, die Schlussmeldung zählt sie unter permission_denials auf. Ohne den Schalter --bare führt ein solcher Lauf die Hooks aus der Pro­jekt­ein­stel­lung aus und verbindet die Server aus der .mcp.json, auch in einem Ordner, dem nie jemand vertraut hat. Abgerufen am 09.10.2026.

geprüft 22.11.2026

Worauf sich diese Seite beruft, wörtlich, abgerufen am 16.11.2026:

  • Without the flag or the permissions.denyInsteadOfPrompting setting, your run waits for that host to answer each permission request.bestätigt 22.11.2026
  • available as a CLI for scripts and CI/CDbestätigt 22.11.2026
  • Claude Code exits with code 0 on success and a non-zero code when the run fails, so your scripts can branch on the exit status.bestätigt 22.11.2026
  • Piping the diff means Claude doesn’t need Bash permission to read itbestätigt 22.11.2026
  • Claude Code denies every call that would otherwise prompt, which is useful for locked-down CI runs, though a mod you installed can still approve some of those calls.bestätigt 22.11.2026
  • Bare mode is useful for CI and scripts where you need the same result on every machine.steht dort nicht mehr
  • is the recommended mode for scripted and SDK calls, and will become the default forbestätigt 22.11.2026
  • In bare mode, Claude Code never reads OAuth credentials or the system keychain.bestätigt 22.11.2026
  • Error: --json-schema is not a valid JSON Schemabestätigt 22.11.2026
  • When a failure happens inside the run, such as missing authentication, Claude Code prints the failure as the result on stdout.bestätigt 22.11.2026
  • To end the turn instead, send SIGINT, or call the Agent SDK’sbestätigt 22.11.2026
  • message with the final response text, cost, and session metadatabestätigt 22.11.2026
  • so a CI gate can fail on a non-empty arraybestätigt 22.11.2026
  • these limits held only partlybestätigt 22.11.2026
  • This page covers using the Agent SDK via the CLIbestätigt 22.11.2026
  • even in a folder you’ve never trustedbestätigt 22.11.2026
  • the response payload includes total_cost_usd and a per-model cost breakdownbestätigt 22.11.2026
  • Without it, claude -p discovers and loads them as an interactive session wouldbestätigt 22.11.2026
  • Non-interactive mode reads stdin, so you can pipe data in and redirect the response out.bestätigt 22.11.2026
  • Piped stdin is capped at 10MB.bestätigt 22.11.2026
  • Both figures are client-side estimates and can differ from your actual bill.bestätigt 22.11.2026
  • Actions covered by your --allowedTools entries or permissions.allow rules also run.bestätigt 22.11.2026
  • Actions that need no approval in Manual mode still run, such as file reads in your working directories and the read-only command setbestätigt 22.11.2026
  • Hooks still don’t run in bare mode when you pass them with --settingsbestätigt 22.11.2026
  • Before your script uses structured_output, check that the field is present.bestätigt 22.11.2026
  • A claude -p run doesn’t wait for MCP work in the backgroundbestätigt 22.11.2026
  • the call’s result is lostbestätigt 22.11.2026
  • In a -p run with no host, these requests are denied either waybestätigt 22.11.2026
  • When a subagent’s long command moves to the background at its timeout, a claude -p run can exit with code 0 before the command finishes.bestätigt 22.11.2026
  • For a background subagent’s command over 10 minutes, also raise the 10-minute cap.bestätigt 22.11.2026

02 Die Werkzeuge08 Berechtigungen und Rechtemodi10 Texte und Dateien in Ordnern11 Eine Wissensbasis aufbauen12 Rechner und Netz pflegen29 Skripte und CI

Alle Quellen

↑↓ auswählenEnter öffnenDie Suche läuft im Browser. Nichts wird übertragen.