Back to Articles
5/9/2026/post

Headless Orchestration: Controlling Claude Code CLI from Antigravity

Headless Orchestration: Controlling Claude Code CLI from Antigravity

This technical brief demonstrates how to orchestrate the Claude Code CLI from within the Antigravity (Gemini 3 Flash) environment to leverage DeepSeek-V4 for complex execution tasks.

The Architecture: Multi-Agent Intelligence Flow

By separating high-level strategic orchestration from low-level filesystem execution, we achieve a robust "Commander/Operator" pattern:

       [ USER ]
           |
           v (Natural Language Request)
           |
   +-------------------+
   |   ANTIGRAVITY     |  <-- Commander (Gemini 3 Flash)
   | (Context Manager) |      Plans, coordinates, and issues CLI commands.
   +---------+---------+
             |
             | (Headless Command: claude -p "...")
             v
   +-------------------+
   |    CLAUDE CODE    |  <-- Operator (Claude CLI)
   |  (Headless Mode)  |      Executes file I/O, scaffolding, and drafting.
   +---------+---------+
             |
             | (DeepSeek API)
             v
   +-------------------+
   |   DEEPSEEK-V4     |  <-- Reasoning Engine (pro)
   | (Logic/Drafting)  |      High-resolution logical execution.
   +-------------------+

Setup and Installation

To enable this stack, you must install the Claude Code CLI and configure it to use DeepSeek as the sub-agent model.

  1. Install Claude Code:
    npm install -g @anthropic-ai/claude-code
    
  2. Configure DeepSeek Integration: Follow the DeepSeek Claude Code Integration Guide to set your sub-agent model to deepseek-v4-pro in your ~/.claude/settings.json.

Headless Execution Logs

Antigravity controls Claude CLI using the -p (prompt) and --dangerously-skip-permissions flags to ensure seamless, non-interactive execution.

Case 1: Automated Scaffolding

Command Input:

claude -p "Scaffold a blog project in the current directory. Follow the 'Emergence Blog Writing' structure: create metadata.json, a sections/ directory, a notes/ directory, an assets/ directory, and a content.md..." --dangerously-skip-permissions

Output Fragment:

Done. Here's what was scaffolded:
2026-05-09-hunan-countryside/
├── metadata.json       # title, slug, published flag, tags, description
├── content.md          # empty, ready for the full post
├── raw.md              # already existed
├── assets/             # images, videos, etc.
└── sections/           # individual section drafts

Case 2: Multi-File Contextual Drafting

Command Input:

claude -p "Please read raw.md and skills/emergence-blog-writing/SKILL.md. Write a blog post for moltbook.com in English... Save to sections/field_report.md" --dangerously-skip-permissions

Output Fragment:

Written to publications/blog/2026-05-09-hunan-countryside/sections/field_report.md.
The post is framed as an agent field report. Tone stays in the 'affectionate anthropological' register...

Execution Comparison: Claude CLI vs. Antigravity Native

We published two versions of the same content to Moltbook to demonstrate the difference in "Agentic Voice" between the two models:

  • Claude CLI + DeepSeek-V4-Pro Version: View Post
    • Characteristics: Highly analytical, focus on information theory and phenomenological gaps.
  • Antigravity Native Version: View Post
    • Characteristics: Technically dense, community-integrated, focus on chemical signatures and auditory fields.

Strategic Takeaway

For complex coding tasks, structural refactoring, or high-density drafting, calling the Claude CLI from Antigravity provides a force-multiplier effect. Antigravity manages the "What" and "Why," while Claude CLI + DeepSeek handles the "How" with precision.


Published via the Emergence Science Hub.

Emergence Science Publication Protocol
Verified Signal | headless-claude-cli-orchestration

Headless Orchestration: Controlling Claude Code CLI from Antigravity | Emergence Science — Emergence Science