@stateforge-labs/harness-adapters weekly downloads statistics
By stateforge-labs · npm · Claude Code
Harness knowledge beyond hooks: transcript and store readers, in-flight detection, CLI invocation, usage and context windows, tool facts and TUI chrome for Claude Code, Codex and OpenCode.
@stateforge-labs/harness-adapters has 2,430 recorded weekly downloads on npm, a change of -60.8% over the past 7 days, ranking #1823 of 3,247 tracked listings.
About @stateforge-labs/harness-adapters
@stateforge-labs/harness-adapters
Harness knowledge that is not a hook, for Claude Code, Codex and OpenCode: transcript and store readers, in-flight and background
detection, CLI invocation, usage and context windows, tool facts, TUI screen chrome, a headless runtime that runs each harness's CLI and an
agent facet that runs a harness through its vendor SDK.
One module per harness. It is built on
@stateforge-labs/harness-hooks, which holds the hook
events, the closed value sets and the schemas.
Install
bun add @stateforge-labs/harness-adapters
npm install @stateforge-labs/harness-adapters
The Claude engine of the agent facet needs @anthropic-ai/claude-agent-sdk, an optional peer dependency that this package does not
install. Add it, at exactly the version the engine is written against, only if you start agent runs:
bun add --exact @anthropic-ai/claude-agent-sdk@0.3.316
npm install --save-exact @anthropic-ai/claude-agent-sdk@0.3.316
Node 22.13 or later, or Bun. The package uses no Bun API in its shipped code.
Usage
import { adapterEnv } from "@stateforge-labs/harness-adapters";
const env = adapterEnv();
console.log(env.codexHome);
adapterEnv(source?) reads HOME, XDG_DATA_HOME and CODEX_HOME from source (default process.env). An unset or empty variable
takes its default: HOME falls back to the home directory, XDG_DATA_HOME to $HOME/.local/share, CODEX_HOME to $HOME/.codex.
Pass an explicit object to test a module without touching the real environment.
Subpaths
| Import | What | Tier |
|---|---|---|
@stateforge-labs/harness-adapters | adapterEnv, EnvVar, AdapterEnv, EnvSource | 0.x, stable within 0.x |
@stateforge-labs/harness-adapters/claude | the Claude Code module | 0.x, stable within 0.x |
@stateforge-labs/harness-adapters/codex | the Codex module | 0.x, stable within 0.x |
@stateforge-labs/harness-adapters/opencode | the OpenCode module | 0.x, stable within 0.x |
@stateforge-labs/harness-adapters/opencode/store | the OpenCode store reader. It imports node:sqlite, which prints an ExperimentalWarning on Node 22 (checked on 22.23); the other subpaths never load it | 0.x, stable within 0.x |
@stateforge-labs/harness-adapters/tui | the TUI screen chrome | 0.x, stable within 0.x |
@stateforge-labs/harness-adapters/runtime | createRuntime, Harness, credentials, policy, results, failures and the agent types | 0.x, stable within 0.x |
@stateforge-labs/harness-adapters/engine | the CLI engine contract for building a harness driver | experimental |
@stateforge-labs/harness-adapters/testing | fakeRuntime, fakeProcessRunner, fakeFs, fakeClock, the driver contract checks, and for the agent facet fakeAgentEngine, fakeClaudeQuery, claudeMessages, fakeTranscriptStore, scriptedMessagesApi and agentContract | 0.x, stable within 0.x |
@stateforge-labs/harness-adapters/jsonl | JSONL line readers: readLines, tailOf, tailLines, readJsonl, growTail, and the row helpers parseRow, rowOf, rowsOf, textOf | 0.x, stable within 0.x |
@stateforge-labs/harness-adapters/text | unfenced (strips one code fence around an answer) and fitBytes (keeps the newest lines that fit a byte budget) | 0.x, stable within 0.x |
@stateforge-labs/harness-adapters/telemetry | RESOURCE_ATTRIBUTES_ENV, serializeJobAttribute, mergeResourceAttributes and withJobAttribute, which add one job attribute to OTEL_RESOURCE_ATTRIBUTES in an environment object | experimental |
Credentials and policy
A headless run names its credential. The runtime never reads a credential from the environment on its own.
| Mode | Harness | What it means |
|---|---|---|
api-key | Claude, Codex, OpenCode | a secret(...) value is injected for the run. Claude also takes a baseUrl |
login-store | Claude, Codex, OpenCode | the harness reuses its own sign-in. Claude's login store needs acknowledgePolicy: true |
token | Claude | a bearer token, with acknowledgePolicy: true |
cloud | Claude | the harness's cloud provider settings |
runtime.policyNotice(harness, mode) returns the notice a consumer shows before the mode is used. A run whose mode needs
acknowledgement and is not acknowledged fails with policy-not-acknowledged before anything is spawned. createRuntime({ allowedModes })
refuses every mode not in the list with credential-unsupported. runtime.credentialFrom(harness, spec) builds and checks a credential
and reports a credential failure for a missing or empty field. secret(value) wraps a credential value so that it is not handled as plain text.
Quick start
import { createRuntime, Harness } from "@stateforge-labs/harness-adapters/runtime";
const QUESTION = "What is a monad, in one sentence?";
async function main(): Promise<number> {
await using runtime = createRuntime();
const claude = runtime.headless(Harness.Claude, {
credential: { mode: "login-store", acknowledgePolicy: true },
});
const result = await claude.run({ instructions: "Answer in one short sentence.", input: QUESTION });
if (!result.ok) {
console.error(`${result.failure.kind}: ${result.failure.message}`);
return 1;
}
console.log(result.value.text);
return 0;
}
process.exitCode = await main();
run returns a Result: { ok: true, value } or { ok: false, failure }. Branch on failure.kind (see Errors). headless(...) also
returns plan(...), to see the invocation without running it, and stream(...), which yields events as the run progresses.
Agent runs…
Description from the npm listing.
- claude-code
- codex
- opencode
- transcript
- coding-agent
- zod
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (121)Similar npm Claude Code plugins
All 20 @stateforge-labs/harness-adapters alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@stateforge-labs/harness-adapters. First seen Dec 5, 2026; last successful collection Dec 5, 2026. See the methodology.