﻿# Continue headless input and output need separate pipeline contracts

A Continue headless pipeline has separate input, agent-tool and output-consumer contracts: silent text cleanup differs from JSON formatting and does not validate downstream actions.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/guide-continue-headless-output-pipeline/
Language: en

## Separate the stages of a pipe

Continue's [headless guide](https://docs.continue.dev/cli/headless-mode) supports piping source material into a single task and piping its response onward. These are separate boundaries. An input diff supplies context to the model; the output may become a message, document or argument for another program. Describe both sides explicitly. A pipeline that merely prints advice has different consequences from one that sends generated text directly into a command with write effects.

## Choose an output format for the consumer

The documented `--silent` option removes thinking tags and excess whitespace. The `--format json` option produces structured JSON. These options solve different presentation needs. Cleaned text is not automatically a structured record, and structured output is not proof that the content meets the consumer's business requirements. Parse the expected representation and validate required fields before treating a generated response as an instruction for the next stage.

## Keep tool permissions separate from downstream effects

The [tool-permission guide](https://docs.continue.dev/cli/tool-permissions) controls tools exposed to the agent. It does not determine what an independently invoked shell program does with the agent's stdout. Even an agent restricted from file writes can produce text that a downstream consumer uses to write a file or create a commit. Review the whole pipeline's authorized effect rather than describing it solely by the agent's permission mode.

## Preserve input scope and task configuration

Use a bounded source input, such as the intended staged diff, and state what the output should describe. The [CLI quickstart](https://docs.continue.dev/cli/quickstart) identifies configuration and headless invocation choices. Capture those with the pipeline so a later model or configuration switch can be evaluated. Avoid passing an entire unrelated log when a small error excerpt establishes the question, particularly if the generated output will be retained elsewhere.

## Introduce a reviewable intermediate artifact

For a new workflow, first save the output for inspection instead of immediately feeding an effectful consumer. Check format, meaning and the intended destination independently. A [response contract](/journal/learn-openrouter-response-contract/) helps define acceptable output; [tool observations](/journal/learn-codex-tool-observation/) distinguish generation from downstream execution. Once a pipeline is authorized and understood, its validation should remain explicit. Successful text generation alone does not establish that the next program applied the correct operation.
