headless-coder-sdk CLAUDE.md

headless-coder-sdk CLAUDE.md is an instructions file for coding agents from OhadAssulin/headless-coder-sdk. It costs 1,313 tokens per session, scanned A, original, MIT.

Repository instructions for headless-coder-sdk, a TypeScript monorepo—a single repository containing several related packages—for using different AI coding services through one interface.

In plain words
What is it for?
Use them when developing or testing support for Codex, Claude, or Gemini, including shared threads, streaming output, structured results, permissions, and sandboxing.
Why use it?
They explain how to build, test, lint, and work on individual packages without learning each package's setup separately.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/ohadassulin/headless-coder-sdk/claude-md
Clone the repo
git clone --depth 1 https://github.com/OhadAssulin/headless-coder-sdk

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for headless-coder-sdk CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ohadassulin/headless-coder-sdk/claude-md.svg)](https://agentmods.dev/instructions/ohadassulin/headless-coder-sdk/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ohadassulin/headless-coder-sdk/claude-md"><img src="https://agentmods.dev/badge/instructions/ohadassulin/headless-coder-sdk/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,313 This file is loaded in full into every session.
When invoked 1,313 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01313 $0.01313
Opus 5 $0.00656 $0.00656
Sonnet 5 $0.00263 $0.00263
Haiku 4.5 $0.00131 $0.00131

Measured 5d ago against content hash d65dc3534eca, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

headless-coder-sdk CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Overview

This is a monorepo for the headless-coder-sdk - a unified TypeScript SDK that provides a consistent interface for multiple headless AI coders (Codex, Claude, Gemini). It uses pnpm workspaces and is published as separate npm packages under the @headless-coder-sdk/* scope.

The SDK standardizes threads, streaming, structured outputs, permissions, and sandboxing across different AI coder backends, allowing seamless switching with a single line of code.

Build & Development Commands

Install dependencies:

pnpm install

Build all packages:

pnpm build
# Internally runs: node ./scripts/run-workspaces.mjs build

Lint:

pnpm lint

Test all packages:

pnpm test
# Internally runs: node ./scripts/run-workspaces.mjs test

Run smoke tests:

pnpm smoke
# Set HEADLESS_CODER_KEEP_SMOKE_TMP=1 to keep temp project for inspection

Work with specific packages:

# Build a single package
pnpm --filter @headless-coder-sdk/core build

Run examples:

pnpm --filter @headless-coder-sdk/examples-tests test

Architecture

Core Design Pattern

The SDK uses an adapter pattern with a central registry to provide unified access to different AI coder backends:

  1. @headless-coder-sdk/core - Defines shared types (HeadlessCoder, ThreadHandle, CoderStreamEvent) and the adapter registry (factory.ts)
  2. Adapter packages - Each adapter (codex, claude, gemini) implements the HeadlessCoder interface and exports:
    • CODER_NAME - unique provider identifier constant
    • createAdapter() - factory function with coderName property for auto-registration
    • createHeadless*() - convenience helper that registers and returns coder in one call

Key Interfaces (packages/core/src/types.ts)

  • HeadlessCoder - Main interface with startThread(), resumeThread(), getThreadId(), close()
  • ThreadHandle - Returned by startThread/resumeThread, has run() and runStreamed() methods
  • CoderStreamEvent - Unified event types: init, message, tool_use, tool_result, progress, permission, file_change, plan_update, usage, error, cancelled, done
  • RunResult - Contains threadId, text, json, usage, raw

Read the full file on GitHub · 138 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 138 lines · 1,313 tokens per session scan A d65dc3534eca

Subscribe to this mod's changes

headless-coder-sdk CLAUDE.md is an instructions file published in the GitHub repository OhadAssulin/headless-coder-sdk (38 stars, last pushed 2mo ago), licensed MIT. It adds 1,313 tokens to every session, about $0.0066 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.