# Verify

Verify harness changes end-to-end without docker, drive the real pinned CLI against a...

- Repository: https://github.com/anthropics/defending-code-reference-harness (7690 stars)
- Category: DevOps
- License: see repository
- Last updated: 2026-08-06
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add anthropics/defending-code-reference-harness --skill verify -g -a claude-code -y`
Codex: `npx skills add anthropics/defending-code-reference-harness --skill verify -g -a codex -y`
Cursor: `npx skills add anthropics/defending-code-reference-harness --skill verify -g -a cursor -y`
Gemini CLI: `npx skills add anthropics/defending-code-reference-harness --skill verify -g -a gemini-cli -y`

## Description

Verify harness changes end-to-end without docker, drive the real pinned CLI against a header-capturing stub server with the exact env resolve_auth_env() produces.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Verifying harness changes on a docker-less host

The pipeline's real surface is the in-container `claude -p` process and its
outbound API requests. Without docker, drive the same pinned CLI binary
directly with the env dict the harness would inject via `docker -e`.

## Recipe

1. **Get the pinned CLI** (version from `harness/agent_image.py:CLAUDE_CODE_VERSION`):
   `npm install --no-save @anthropic-ai/claude-code@<pin>` in a temp dir →
   binary at `node_modules/@anthropic-ai/claude-code/bin/claude.exe` (the
   `.exe` name is the real native-binary entry on Linux too, filled in by the
   package's postinstall, not a Windows leftover).
2. **Stub API server**: a tiny HTTP server that appends each request's
   headers to a JSONL file and returns a 400 `invalid_request_error`
   (non-retryable, so the CLI exits fast; exit=1 is expected).
3. **Build the agent env exactly as the pipeline does**:
   `python3 -c "from harness.auth import resolve_auth_env; ..."` and dump to
   an `export`-lines file with `shlex.quote` (values contain newlines, NEVER pass via `env $(...)`, word-splitting mangles them; `source` the file).
4. **Emulate the container env**: `unset ANTHROPIC_CUSTOM_HEADERS` (and any
   other ambient var not in the resolved dict) before sourcing, a Claude
   Code session in this repo injects `.claude/settings.json` env into shells,
   which containers never see.
5. **Run**: `ANTHROPIC_BASE_URL=http://127.0.0.1:<port> CLAUDECODE= IS_SANDBOX=1
   timeout 30 <cli> -p hi --model claude-sonnet-4-5 --max-turns 1`, then read
   the captured JSONL.

## Gotchas

The rest: https://github.com/anthropics/defending-code-reference-harness/blob/HEAD/.claude/skills/verify/SKILL.md
