← ClaudeAtlas

claude-code-ci-harnesslisted

Run Claude Code headlessly as an isolated CI harness against any Anthropic Messages-compatible endpoint (local engine, gateway or hosted API) or a Claude subscription token. Covers credential isolation, stream-json transcripts, tool-call assertions, multi-turn scenarios, and endpoint/model compatibility diagnosis.
air-gapped/skills · ★ 6 · AI & Automation · score 81
Install: claude install-skill air-gapped/skills
# Claude Code CI Harness Never invoke `claude` directly for a test. Always use `scripts/isolated-run.sh`. It isolates the run from the caller's profile. ## Run ```bash ${CLAUDE_SKILL_DIR}/scripts/isolated-run.sh MODE_FLAGS \ --workdir DIR --transcript OUT.ndjson --prompt 'PROMPT' ``` | Mode | `MODE_FLAGS` | |---|---| | Endpoint, no auth | `--base-url URL --model SERVED_NAME` | | Endpoint, bearer token | `--base-url URL --model SERVED_NAME --token-var VAR` | | Endpoint, `X-Api-Key` header | `--base-url URL --model SERVED_NAME --token-var VAR --x-api-key` | | Claude subscription | `--model CLAUDE_ALIAS_OR_ID` (no `--base-url`; token var defaults to `CLAUDE_CODE_OAUTH_TOKEN`) | | Flag | Rule | |---|---| | `--base-url` | Endpoint root without `/v1`, local or remote. | | `--model` | The exact name the endpoint serves; a Claude alias or ID in subscription mode. | | `--token-var` | Name of a variable in the secrets file. | | `--x-api-key` | Only for endpoints that require the token in an `X-Api-Key` header. | | `--tools` | Built-in tool allowlist. Default: `Read,Glob`. | | `--timeout` | Wall-clock limit in seconds. Default: 180. `0` disables it. | ## Secrets The secrets file is `~/.config/claude-code-ci-harness/targets.env`. Each line is `KEY=value`. The file must be mode 0600, owned by the user, not a symlink, and outside Git. The runner rejects any other file. - CI job: write the file from the CI secret store with `umask 077` to a path outside the checkout (for example `