nio CLAUDE.md

nio CLAUDE.md is an instructions file for coding agents from core0-io/nio. It costs 3,473 tokens per session, scanned B, original, Apache-2.0.

Repository instructions for Nio, a toolset for checking AI-agent code and actions for execution risk and recording what happened. It describes commands for scanning code, evaluating runtime actions, viewing reports, checking configuration, and testing connectivity.

In plain words
What is it for?
Running risk scans, deciding whether an action should be allowed or confirmed, reviewing execution logs, diagnosing setup, and checking external scores.
Why use it?
It gives the coding assistant the project’s rules for safety checks, observability, configuration, and release work.

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/core0-io/nio/claude-md
Clone the repo
git clone --depth 1 https://github.com/core0-io/nio

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 nio CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/core0-io/nio/claude-md.svg)](https://agentmods.dev/instructions/core0-io/nio/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/core0-io/nio/claude-md"><img src="https://agentmods.dev/badge/instructions/core0-io/nio/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,473 This file is loaded in full into every session.
When invoked 3,473 The same file — it is already loaded in full.
Security scan B 1 finding. 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.03473 $0.03473
Opus 5 $0.01736 $0.01736
Sonnet 5 $0.00695 $0.00695
Haiku 4.5 $0.00347 $0.00347

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

Security

Grade B, and why

nio CLAUDE.md scanned grade B with 1 finding 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 4d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- `plugins/codex/` — Codex CLI plugin. Repo layout is flat (parallels cc/openclaw/hermes): manifest at `.codex-plugin/plugin.json` (with `interface{displayName,category,…}`); hooks at `hooks/hooks.json`; skills under `sk
CLAUDE.md · 111 lines

How it starts

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

Nio

Execution assurance and observability for autonomous AI agents. Provides code scanning, runtime guard, and OTEL collector.

Skill

This project provides a unified Claude Code skill: /nio

/nio scan <path>          — Scan code for execution risks (15 static + 7 behavioural rules)
/nio action <description> — Evaluate runtime action safety (allow/deny/confirm)
/nio report               — Agent execution audit log + diagnostics summary
/nio doctor               — Validate config + dry-run OAuth/LLM connectivity
/nio config <level>       — Set protection level (strict/balanced/permissive)
/nio external-score       — Snapshot current scores from external scoring endpoints

Alongside the unified /nio, each capability is also exposed as a focused single-purpose skill for sharper passive (natural-language) discovery on the LLM-driven platforms (Claude Code, Codex, Pi, and opencode — OpenClaw/Hermes keep the unified /nio): nio-scan, nio-action, nio-report, nio-config, nio-doctor, nio-external-score. Source of truth: plugins/shared/skills/<name>/SKILL.md (synced by scripts/sync-shared.js). These are pure LLM-driven skills (no command-dispatch/command-tool); script-running ones (action/config/doctor/external-score) sibling-reference the kept nio skill's bundled scripts via ../nio/scripts/<cli>.js rather than duplicating the bundle.

Project Structure

  • plugins/shared/ — Shared config + skill source of truth. All skill sources live under skills/<name>/: the unified umbrella skills/nio/ (SKILL.md + README.md) plus the focused per-capability skills (skills/nio-scan/, skills/nio-action/, …). Rule docs are owned by their capability — SCAN-RULES.md in skills/nio-scan/, ACTION-POLICIES.md in skills/nio-action/; sync-shared.js borrows a copy of each into the umbrella's dest dir (whose SKILL.md links them)
  • plugins/claude-code/ — Claude Code plugin (hooks, skills/nio/ synced from shared, setup)
  • plugins/codex/ — Codex CLI plugin. Repo layout is flat (parallels cc/openclaw/hermes): manifest at .codex-plugin/plugin.json (with interface{displayName,category,…}); hooks at hooks/hooks.json; skills under skills/nio/; setup.sh at root. No marketplace.json in the repo — codex 0.128 schema requires source.path to be a non-empty ./<subdir> and our flat layout has no such subdir, so setup.sh generates a valid marketplace.json at install time instead. Subscribes to SessionStart / UserPromptSubmit / PreToolUse / PostToolUse / Stop; PermissionRequest is deferred to phase 2. Skill content synced from plugins/shared/skills/nio/ via scripts/sync-shared.js; scripts mirrored from plugins/claude-code/skills/nio/scripts/ by scripts/build.js. Codex CLI does not support custom slash commands — /nio is exposed only via $nio skill trigger or natural-language match. Adapter at src/adapters/codex.ts with name='codex' and default native_tool_mapping = { Bash: exec_command } (Codex's only first-party tool; writes/reads/fetches go through shell). setup.sh performs a full nuke + cp install on every invocation (no codex plugin install CLI exists in 0.128): wipes and rewrites $CODEX_HOME/plugins/cache/nio/nio/<version>/ from $SCRIPT_DIR; wipes and rebuilds a Codex-valid marketplace catalog under $NIO_HOME/codex-marketplace/; writes a hooks.json with absolute paths into the cache dir (Codex runs hook commands with cwd=session-cwd, so plugin-relative paths can't resolve); edits ~/.codex/config.toml to register the marketplace, enable the plugin, and set both [features] codex_hooks = true (stable) and [features] plugin_hooks = true (under-development; required for plugin-bundled hooks to fire). Same setup.sh works whether invoked from the repo or an extracted release zip. Hook scripts (guard-hook.js / collector-hook.js / scanner-hook.js) accept --platform codex to thread the platform tag through Phase 0–6 and the audit log; default platform stays claude-code for cc.
  • plugins/pi/ — Pi extension. The release zip is itself a valid pi package (package.json with the pi manifest key and the pi-package keyword), so setup.sh prefers pi install "$SCRIPT_DIR" and falls back to copying the bundle into ~/.pi/agent/extensions/nio/ plus an explicit path entry in settings.json. Subscribes tool_call (blocking) / tool_result / input / session_start / session_shutdown / agent_end / message_end / user_bash. /nio is a real slash command via pi.registerCommand, bypassing the LLM. Pi is the only platform with an interactive channel, so a confirm verdict opens a real ctx.ui.confirm dialog with a timeout (pi -p print mode has ctx.hasUI === false and folds to the two-state behaviour). Pi has no subagent concept, so no Task spans are emitted. Pi core has no MCP either, but the third-party pi-mcp-adapter package adds it and is the de-facto default for Pi users, so parseMcpToolName carries a pi branch (Task 11b): the proxy tool mcp resolves its target from the tool / server parameters, and directTools mode is matched as <server>_<tool> / mcp__<server>_<tool> against servers read from $PI_CODING_AGENT_DIR/mcp.json (else ~/.pi/agent/mcp.json). toolPrefix: "none" is undetectable by design. setup.sh exports PI_CODING_AGENT_DIR="$PI_HOME" before shelling out so --pi-home actually binds the pi CLI. Adapter at src/adapters/pi.ts; binding at src/adapters/pi-plugin.ts.
  • plugins/opencode/ — opencode plugin. No plugin-install CLI exists, so setup.sh does an idempotent nuke + copy into ~/.config/opencode/ (plugins/nio.js, commands/nio.md, skills/). Hooks: tool.execute.before (throws NioBlockedError to block) / tool.execute.after / chat.message / permission.ask / event / dispose. tool.execute.after does not fire when a tool throws, so the session.idle branch of event doubles as the safety net that reclaims the pending span. No plugin API for slash commands, so /nio is a commands/nio.md template that instructs the model to call the plugin-registered nio_command tool. MCP tool names are <sanitize(server)>_<sanitize(tool)>, handled by the two-tier opencode branch in parseMcpToolName. setup.sh writes the {"type":"module"} ESM sentinel into $OC_HOME/plugins/ only when that shared directory holds no sibling plugin and no pre-existing package.json; it drops a .nio-esm-sentinel ownership marker at the same time, and --uninstall removes the pair only when that marker is present. Adapter at src/adapters/opencode.ts; binding at src/adapters/opencode-plugin.ts.
  • plugins/openclaw/ — OpenClaw plugin (plugin/ subdir holds manifest + bundled plugin.js; skills/nio/ synced from shared; setup.sh orchestrates both)
  • plugins/hermes/ — Hermes integration. Two surfaces:
    1. Shell-hooks (upstream PR #13296): setup.sh + install-hook.py merge 7 lifecycle event entries into ~/.hermes/config.yaml — all pointing at the same self-contained scripts/hook-cli.js, which internally dispatches pre_tool_call to the guard pipeline (Phase 0–6) and post_tool_call / pre_llm_call / post_llm_call / on_session_start / on_session_end / subagent_stop to the collector pipeline (OTEL traces + metrics + logs).
    2. /nio slash command via a tiny Python plugin (plugins/hermes/python-plugin/): setup.sh drops plugin.yaml + __init__.py + bundled scripts/nio-cli.js into ~/.hermes/plugins/nio/ and adds nio to the user's plugins.enabled opt-in list. The plugin's register(ctx) hooks /nio straight into Hermes's slash dispatch — bypasses the LLM, mirrors OpenClaw's command-dispatch: tool route. No pip install / wheel; Hermes auto-discovers any directory under ~/.hermes/plugins/<name>/. Both scripts/hook-cli.js and scripts/nio-cli.js are built by build.js as single-file bundles (splitting: false) so a Hermes-only release zip (nio-hermes-vX.zip) has no dependency on the Claude Code plugin.
  • src/ — TypeScript source (scanner, analysers, runtime guard, adapters). src/adapters/plugin-runtime.ts holds the shared InProcessPluginRuntime that OpenClaw, Pi, and opencode all sit on: it owns config, the three OTEL providers, per-session collector state, guard-decision → span-attribute translation, orphan-span compensation on the block path, and turn flushing. Platform bindings only translate their host's event shapes into its semantic methods. Despite its name, src/adapters/openclaw-dispatch.ts is the shared /nio sub-command router and doctor implementation for every in-process platform — the Pi and opencode doctor probes live there.
  • dist/ — Compiled JavaScript output (npm library export)
  • scripts/ — Build and release scripts

Read the full file on GitHub · 111 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. 4d ago First seen · 111 lines · 3,473 tokens per session scan B 1b3907c570b5

Subscribe to this mod's changes

nio CLAUDE.md is an instructions file published in the GitHub repository core0-io/nio (19 stars, last pushed 13d ago), licensed Apache-2.0. It adds 3,473 tokens to every session, about $0.0174 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.