claude-code-headless

Automate Claude Code operations in headless CI/CD environments.

9|5|Updated Aug 8, 2025
One-click install
npx skills add https://github.com/AnExiledDev/CodeForge --skill claude-code-headless-anexileddev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-code-headless
Source: https://github.com/AnExiledDev/CodeForge/tree/main/.devcontainer/plugins/devs-marketplace/plugins/code-directive/skills/claude-code-headless
Command: npx skills add https://github.com/AnExiledDev/CodeForge --skill claude-code-headless-anexileddev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Non-interactive automation of Claude Code, enabling scripted control, streaming output, and CI/CD workflows without a terminal UI.

Core Features & Use Cases

  • Headless execution of Claude Code for automation pipelines.
  • Streaming JSON output and session management across runs.
  • SDK integration (TypeScript and Python) and MCP server support for automated tooling.

Quick Start

Use claude-code-headless with print mode to run Claude Code non-interactively in CI/CD pipelines.

Frequently Asked Questions about claude-code-headless

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

FAQPage Schema
How do I run Claude Code in a CI/CD pipeline without a terminal UI?

To run Claude Code non-interactively in CI/CD pipelines, use the headless print mode with the CLAUDE_CODE flag. This enables scripted automation, streaming JSON output, and session management across runs without requiring a terminal UI.

Can I get streaming JSON output from Claude Code for automation scripts?

Yes, you can get streaming JSON output from Claude Code for automation scripts by using headless execution mode. This exposes SDK integrations and allows scripts to process Claude Code operations dynamically without an interactive terminal.

Does Claude Code SDK support TypeScript and Python for non-interactive workflows?

Yes, Claude Code SDK supports both TypeScript and Python for non-interactive workflows. The headless mode integrates with these SDKs to enable automated tooling, MCP server support, and scripted control in CI/CD environments.

Do I need the CLAUDE_CODE flag to use headless execution in automation pipelines?

Yes, the CLAUDE_CODE flag is required to enable headless execution in automation pipelines. This flag activates the non-interactive context necessary for print mode, streaming JSON output, and SDK integrations.

How does headless Claude Code handle permission controls and MCP servers?

Headless Claude Code handles permission controls and MCP servers through SDK integration during non-interactive execution. It automates tooling access and manages MCP server connections within CI/CD pipelines using configured permission settings.