zeptoclaw: Instructions file for Codex

AGENTS.md

zeptoclaw AGENTS.md is an instructions file for Codex, OpenCode from qhkm/zeptoclaw. It costs 4,007 tokens per session, scanned A, original, Apache-2.0.

Project instructions for coding agents working on zeptoclaw, a Rust codebase with command-line tools, integrations, benchmarks, tests, and strict file and process rules.

In plain words
What is it for?
Use them to understand the codebase, follow its commands and ownership rules, respect binary-size limits, and complete the required checks after implementation.
Why use it?
They give agents the project facts and working constraints needed to make compatible changes without breaking repository practices.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md; mentions AGENTS.md; built for openclaw.

This is qhkm/zeptoclaw's own configuration. It tells Codex and OpenCode how to work on zeptoclaw itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything zeptoclaw configures →

Reuse

Borrowing it

Nothing to install: this file belongs to qhkm/zeptoclaw. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/qhkm/zeptoclaw/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/qhkm/zeptoclaw

Made for: Codex, OpenCode.

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 zeptoclaw AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/qhkm/zeptoclaw/agents-md/github.svg)](https://agentmods.dev/instructions/qhkm/zeptoclaw/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/qhkm/zeptoclaw/agents-md"><img src="https://agentmods.dev/badge/instructions/qhkm/zeptoclaw/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for zeptoclaw AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/qhkm/zeptoclaw/agents-md"><img src="https://agentmods.dev/badge/instructions/qhkm/zeptoclaw/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,007 This file is loaded in full into every session.
When invoked 4,007 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.04007 $0.04007
Opus 5.5 $0.01603 $0.01603
Sonnet 5.5 $0.00801 $0.00801
Haiku 4.5 $0.00401 $0.00401

Measured 4d ago against content hash 04b6431a0491, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

zeptoclaw AGENTS.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 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.

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.

AGENTS.md · 182 lines

How it starts

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

AGENTS.md

Project-level guidance for coding agents working in this repository.

Project Snapshot

  • Language: Rust (edition 2021)
  • Core binary: zeptoclaw (src/main.rs thin entrypoint; CLI handlers in src/cli/); stripped release size budgets are 11MB on linux-x86_64 and 7MB on aarch64, checked locally when relevant; escape valve for genuine new heavy deps is feature-gating, not bumping the budget
  • Extra binary: benchmark (src/bin/benchmark.rs)
  • Benchmarks: benches/message_bus.rs
  • Integration tests: tests/integration.rs
  • Agent coding benchmark fixture: test-coding/ with intentionally buggy Python code and stdlib verification tests
  • Pristine agent comparison fixture: test-coding-pristine/ preserves the original failing state for repeatable head-to-head runs
  • Codebase: ~154,000 lines of Rust under src/
  • Channels: 10 active built-ins (Telegram, Slack, Discord, WhatsApp Web, WhatsApp Cloud, Lark, Email, Webhook, Serial, ACP); MQTT code is present but the Cargo feature is parked until rumqttc no longer pins the vulnerable rustls-webpki
  • Runtimes: 6 (Native, Docker, Apple Container, Landlock, Firejail, Bubblewrap)
  • Peripherals: 4 boards (ESP32, RPi, Arduino, Nucleo) with GPIO, I2C, NVS, Serial
  • Skills: OpenClaw-compatible (reads metadata.zeptoclaw > metadata.openclaw > raw)
  • Plugins: Command-mode (shell template) + Binary-mode (JSON-RPC 2.0 stdin/stdout)
  • Library facade: ZeptoAgent::builder() for embedding as a crate (Tauri, GUI apps)
  • Runtime provider resolution: builds chain in registry order only when providers.fallback.enabled; honors providers.fallback.provider; can wrap chain with RetryProvider via providers.retry.*
  • Provider introspection CLI: zeptoclaw provider status prints resolved providers, wrapper config (retry/fallback), and quota usage snapshot
  • Provider onboarding validation: Anthropic uses GET /v1/models; OpenAI-compatible presets validate keys with read-only endpoint checks, including Zhipu/GLM via GET /models
  • Model discoverability hardening: gateway-style slash IDs (for example anthropic/...) only infer OpenRouter when that provider is actually available, and live /model fetch now honors api_version while normalizing Azure deployment bases to /openai/models
  • OpenAI-compatible serve tool calling: /v1/chat/completions forwards request tools to providers, returns assistant/tool messages plus tool-call payloads in OpenAI format, streams tool-call deltas even for providers using the default chat_stream() adapter, and rejects unsupported tool_choice values instead of silently ignoring them
  • Channel dispatch: avoids holding the channels map RwLock across async send() awaits
  • Channel supervisor: polling (15s) detects dead channels, restarts with 60s cooldown, max 5 restarts
  • Channel panic isolation: Slack/Discord/Webhook/WhatsApp/WhatsApp Web/WhatsApp Cloud/Lark/Email/Serial spawned tasks are wrapped with catch_unwind and panic logging; MQTT code remains present while its Cargo feature is parked
  • Webhook auth hardening: generic webhook supports optional HMAC-SHA256 body signatures plus fixed server-side sender/chat identity by default (trust_payload_identity is an explicit legacy escape hatch); WhatsApp Cloud verifies X-Hub-Signature-256 when app_secret is configured
  • Telegram allowlist hardening: numeric user IDs are the safe default for new setups; legacy username matching remains available only through channels.telegram.allow_usernames for compatibility and emits warnings when non-numeric allowlist entries are present
  • Telegram config compatibility: channels.telegram accepts legacy bot_token, allowed_senders, and allowed_chats keys, and auto-enables when enabled is omitted but a Telegram token is present
  • Email allowlist limitation surfaced: channels.email.allowed_senders matches the parsed From header only and now emits config/runtime warnings so authenticated-mail enforcement is pushed upstream
  • Telegram outbound formatting: sends HTML parse mode with ||spoiler|| → <tg-spoiler> conversion
  • Telegram response streaming: opt-in channels.telegram.streaming routes provider deltas through cumulative outbound stream phases, edits UTF-16-safe previews at a bounded cadence, preserves reply/topic routing, and falls back to a fresh final HTML message after preview failures
  • Discord outbound delivery: supports reply references and thread-create metadata (discord_thread_*) in OutboundMessage
  • Cron scheduling hardening: dispatch timeout + exponential error backoff + one-shot delete-after-run only on success
  • Model switching: Telegram /model supports per-chat overrides (in-memory + long-term)
  • Persona switching: /persona command with presets and custom text, LTM persistence per chat
  • CLI interactive mode: TTY-gated local slash commands with rustyline tab completion when available, persisted REPL history, inline tool approval prompts, session-scoped /trust override for local use, /model and /persona overrides, /tools, /template, and /clear
  • Memory injection: per-message query-matched injection via shared LTM on AgentLoop (startup static injection removed)
  • Prompt envelope (#661): the system prompt is byte-stable (no live clock, no query memory); ContextBuilder::build_turn_context() renders the clock + memory once per turn into a <turn-context> block prepended to a request copy of the latest user message (persisted history stays clean). ToolRegistry is a BTreeMap, so tool definitions are name-sorted. The Claude provider adds up to 4 cache_control breakpoints (system or last tool, plus trailing messages) to the serialized request copy and debug-logs cache read/write tokens; only the first System message becomes Claude's system field, later notices ride as user-turn text after tool results. Usage.prompt_tokens includes cache reads/writes (folded in via Usage::with_cache(), split kept in cache_read_tokens/cache_creation_tokens), so token budgets and metrics see the full prompt; utils::cost::estimate_usage_cost() bills cache reads at 0.1x and writes at 1.25x the input rate (#711).
  • Long-term memory tool guidance: longterm_memory now advertises explicit use/counter-use trigger phrases so agents persist durable corrections and preferences without duplicating repo docs or task-scoped context
  • Tool execution convergence: agent loop, MCP server, and embedded ZeptoAgent facade all route through kernel::execute_tool() (shared safety scan + taint checks + single metrics recording); the facade also enforces per-tool timeout, panic capture, and optional approval handling for embedded coding backends
  • Coding tool hardening: grep now surfaces subprocess failures instead of silently returning "No matches"; shell truncates output at 2,000 lines / 50KB; edit_file rejects empty old_text and supports optional expected_replacements for safer surgical edits
  • Tool composition: natural language tool creation with {{param}} template interpolation
  • Filesystem hardening: filesystem write/edit tools now create parent directories one component at a time inside the workspace and use secure no-follow writes; mount validation rejects Unix regular-file mounts with multiple hard links in both blocked-path and allowlist flows; safety pre-scan keeps full path scanning while scanning file bodies with a narrow shell_injection carve-out instead of skipping content wholesale
  • Secret storage hardening: config and panel token writes use user-only permissions on Unix (0600 files and 0700 ZeptoClaw directories) and repair permissions left by older versions
  • Panel auth hardening: static bearer tokens use constant-time comparison, WebSocket connections exchange them for bounded 30-second single-use tickets, and CLI output points to the token file instead of printing the secret
  • Safer default execution posture: fresh configs now start in agent_mode = "assistant" with approvals enabled under the require_for_dangerous policy
  • Gateway startup guard: degrade after N crashes to prevent crash loops
  • Loop guard: SHA256 tool-call repetition detection with warn + circuit-breaker stop
  • In-memory audit hash-chain: src/audit.rs appends SHA-256-linked entries (record_audit_chain_event, verify_audit_chain_integrity, recent_audit_entries, audit_tip_hash), and kernel::execute_tool() now emits tool execution chain events with shell/network/spawn classification
  • Tool execution hardening: per-tool-call timeout + panic capture in both process_message and process_message_streaming tool join_all paths
  • Runtime subprocess hardening: Native, Docker, Apple Container, Landlock, Firejail, and Bubblewrap scrub secret-like inherited environment variables by default; runtime.env_passthrough explicitly opts names back in, Unix timeouts terminate/reap the process group, and timed-out Docker containers are force-removed
  • Streaming tool parity: process_message_streaming() now mirrors non-streaming hook callbacks, usage-metric accounting, success/failure logging, thinking/response feedback, and malformed tool-argument parse preservation
  • Context trimming: normal/emergency/critical compaction tiers (70%/90%/95%)
  • Session repair: auto-fixes orphan tool results, empty/duplicate messages, alternation issues
  • r8r bridge: optional WebSocket client for workflow approvals, health updates, and replay-safe duplicate-event acknowledgments
  • Config hot-reload: gateway polls config mtime every 30s and applies provider/channel/safety updates
  • Config validation: zeptoclaw config check recognizes top-level tunnel and r8r_bridge, plus agent defaults such as timezone, tool_timeout_secs, and system_prompt
  • Validation runs locally; GitHub Actions CI, E2E, and PR hygiene workflows are removed. Optional feature paths require local checks when changed; tag-triggered release and Docker publishing remain enabled
  • Dependency audit baseline: cargo deny check passes with patched anyhow 1.0.103, bcrypt 0.19.2, chacha20 0.10.2, crossbeam-epoch 0.9.20, h2 0.4.19, quinn-proto 0.11.15, quick-xml 0.41, lopdf 0.42, and rustls 0.23.45 (RUSTSEC-2026-0285)
  • Tool-schema repair: utils::tool_schema sanitizes outbound schemas in ToolRegistry::definitions*() (illegal property keys, type arrays, bare-string schemas, $ref siblings, top-level combinators, properties on bare object schemas for llama.cpp GBNF) and repairs inbound args at every nesting depth in kernel::execute_tool() via unrename_tool_args() + coerce_tool_args(); never rewrites a string the schema already permits, so "07030" survives a ["string","integer"] union
  • Reasoning models: reasoning_content (non-stream + stream delta) and finish_reason are parsed on the OpenAI-compatible path; resolve_assistant_text() falls back to reasoning only when there is no content and no tool calls, warning with finish_reason. Reasoning deltas never stream as reply text. ChatOptions::with_reasoning_effort() sets reasoning_effort, omitted when unset
  • MCP transport: supports both HTTP and stdio MCP servers (url or command + args/env) with tool registration during create_agent()
  • Hands-lite: HAND.toml + bundled hands (researcher, coder, monitor) + hand CLI
  • Panel CLI fallback: feature-disabled builds still parse zeptoclaw panel ... and return explicit --features panel guidance instead of a raw unknown-subcommand error
  • Uninstall CLI: zeptoclaw uninstall removes ~/.zeptoclaw; --remove-binary deletes direct installs in ~/.local/bin or /usr/local/bin and defers Homebrew/Cargo binaries to their package managers
  • Process exit codes: explicit main mapping for success (0) and error (1); uncaught panic/crash remains Rust default (101)
  • Tests: current local validation passes cargo fmt -- --check, cargo clippy -- -D warnings, cargo nextest run --lib (3531 passed, 6 skipped), and cargo test --doc (128 passed, 27 ignored)

Read the full file on GitHub · 182 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 Changed · +1 lines · +225 tokens per session 04b6431a0491
  2. 1mo ago Changed · +2 lines · +206 tokens per session 68cc0cf2fbc4
  3. 1mo ago Changed · -80 tokens per session b600d2953281
  4. 1mo ago Changed · +1 lines · +42 tokens per session dcf29695f972
  5. 1mo ago Changed · +1 lines · +62 tokens per session f3837cc09361
  6. 1mo ago Changed · +2 lines · +145 tokens per session 9a9172200726
  7. 1mo ago First seen · 175 lines · 3,407 tokens per session scan A 682101b549e9

Subscribe to this mod's changes

zeptoclaw AGENTS.md is an instructions file published in the GitHub repository qhkm/zeptoclaw (650 stars, last pushed 5d ago), licensed Apache-2.0. It adds 4,007 tokens to every session, about $0.0160 per session on Opus 5.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.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,649 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,549 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens