Skip to main content
skill CX Codex official · Anthropic

verify · anthropics/defending-code-reference-harness — Claude Code skill: test harness without Docker

verify — a skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode that tests harness changes end-to-end without Docker.

Apache-2.0 257 installs ★ 7,771 updated 2026-08-06

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add anthropics/defending-code-reference-harness --skill verify -a claude-code
Open on GitHub

What verify does

Inside: a five-step recipe. Download the pinned CLI version via npm install @anthropic-ai/claude-code@<pin>, spin up a stub server that writes request headers to JSONL and returns 400, build the agent env exactly as the pipeline does using resolve_auth_env(), unset variables like ANTHROPIC_CUSTOM_HEADERS from the session (containers never see them), run the CLI with timeout and read the log.

The command calls the CLI with --model, --max-turns and a prompt. Without Docker, you cannot exercise the -e injection leg in docker run — it uses the same mechanism as ANTHROPIC_API_KEY in production. For the interactive-skills surface, copy .claude/settings.json into a fresh temp directory and run the host claude from there, with ambient ANTHROPIC_CUSTOM_HEADERS unset. Tests in test_patch.py and test_patch_grade.py require Docker and fail on docker-less hosts — pre-existing, unrelated to your changes.

What it helps with

  • test harness changes without spinning up Docker
  • capture outbound headers from the agent CLI
  • reproduce container env on a bare host
  • spot the difference between session and container variables
  • verify interactive skills with a clean settings.json

Example prompts for the agent

  • Run the harness test without Docker following the verify recipe.
  • Build the CLI env using resolve_auth_env() and dump it to an export file.
  • Spin up a stub server that logs headers to JSONL and drive the CLI through it.

How to install verify

1Skills CLI (Vercel)

npx skills add anthropics/defending-code-reference-harness --skill verify -a claude-code

2Manually: put the files in place

~/.claude/skills/verify/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/verify/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about verify

How to install verify in Claude Code?

Run npx skills add anthropics/defending-code-reference-harness --skill verify -a claude-code, then open ~/.claude/skills/verify/SKILL.md.

What does the verify skill do?

Runs the pinned Claude CLI binary against a stub server with the env dict resolve_auth_env() builds for containers. Lets you verify harness changes on a host without Docker.

Why do test_patch.py tests fail without Docker?

They require Docker and do not run on bare hosts — unrelated to your harness changes, the issue existed before them.

Source text

SKILL.md · Apache-2.0
---
name: verify
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.
---

# 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

- Unit tests in `tests/test_patch.py` / `tests/test_patch_grade.py` need
  docker and fail on docker-less hosts — pre-existing, not your change.
- The docker `-e` injection leg itself can't be exercised without docker;
  it's the same mechanism that carries `ANTHROPIC_API_KEY` in production.
- For the interactive-skills surface, copy `.claude/settings.json` into a
  fresh temp dir and run the host `claude` from there (with ambient
  `ANTHROPIC_CUSTOM_HEADERS` unset so settings.json is the only source).

© anthropics · Apache-2.0 · anthropics/defending-code-reference-harness

Similar skills

All skills for Testing and QA →

verify by other authors comes first.

verify react verify validates code changes against React repository requirements before committing. Runs Prettier, linter, Flow type checks, and tests. CX Codex +1 1,200installs verify Yeachan-Heo verify turns "it should work" into evidence you can read: which check ran, what passed, and what stayed unverified. CX Codex +1 721installs verify codewithmukesh verify — a skill for Claude Code, Codex, Cursor, and other agents that runs a seven-phase verification pipeline on .NET projects: build, analyzers, antipattern detection, tests, security, formatting, and diff review. CX Codex +1 4,000installs verify plastic-labs The verify Claude Code skill tests Honcho changes against a running local app. It exercises the HTTP API, deriver queue, and SQL query plans. CX Codex +1 172installs verify OrchestKit verify is a skill that checks whether work is ready to merge by running tests, security and type checks, then assigns a 0–10 score. CX Codex +1 210installs elastic-package-cli elastic elastic-package-cli walks your agent through elastic-package commands: formatting, linting, artifact builds, pipeline and system tests, local Elastic stack. CX Codex +1 515installs inngest-cli inngest inngest-cli teaches the agent to boot the local Inngest Dev Server, debug a serve endpoint and test functions with @inngest/test. CX Codex +1 901installs backend-development mrgoonie backend-development — a skill that walks your agent through API design, database schemas, auth and CI/CD. Useful when a backend starts from scratch or heads to production. CX Codex +1 2,400installs coolify-manager ajmcclary coolify-manager — a skill for running Coolify through its official CLI and API: service status, logs, containers, SSL, WordPress fixes. CX Codex +1 520installs app-verification mblode app-verification — a skill for Claude Code, Codex, Cursor and other agents that scaffolds a project-local verification harness — verify, doctor, and seed commands — inside the target repository. CX Codex +1 217installs ossfuzz trailofbits Guides your AI agent through enrolling projects in Google OSS-Fuzz and running fuzzer targets locally with helper scripts. CX Codex +1 5,700installs

From the same set9

threat-model Builds a threat model for a target codebase and writes the result to THREAT_MODEL.md. Three modes cover code-only analysis, owner interviews, and both chained together. CX Codex +1 1,300installs patch Generates candidate diffs for verified security findings and writes inert patches for manual review. CX Codex +1 1,200installs triage A skill for Claude Code, Cursor, Codex and other platforms: verifies security scanner reports, deduplicates findings, re-ranks by exploitability, and assigns owners. Runs with /triage on a directory of JSON scanner output. CX Codex +1 1,200installs vuln-scan vuln-scan is a Claude Code skill that statically scans source code for vulnerabilities and writes findings to JSON and markdown for triage. CX Codex +1 1,200installs quickstart quickstart guides a first pass through the code-security repository, from threat modeling to a canary scan. It also answers repo-specific questions with cited sources. CX Codex +1 1,100installs customize customize — a skill to adapt the C/C++ vulnerability-finding pipeline to other languages, domains, and target shapes. Turns an opinionated demo into a template: swap the detector, prompts, and sandbox — and the pipeline hunts what you need. CX Codex +1 1,100installs dnr-hunt dnr-hunt searches web and application logs for compromise clues without an existing alert, then checks suspects in source and with a local PoC. CX Codex +1 250installs dnr-respond dnr-respond performs incident response for a suspicious lead, alert, or IOC. Assesses blast radius, validates root causes with local PoCs, and drafts a remediation plan. CX Codex +1 247installs

More in the catalog

Project sponsors

Companies that keep this analytics open