os-moda: Instructions file for Claude Code

CLAUDE.md

os-moda CLAUDE.md is an instructions file for Claude Code from bolivian-peru/os-moda. It costs 12,027 tokens per session, scanned C, original, Apache-2.0.

A project guide for osModa, a NixOS distribution that uses AI to manage computer systems. NixOS is a Linux operating system whose setup is described in configuration files.

In plain words
What is it for?
Use it to understand osModa’s gateway, named conversations, cross-chat updates, and the way its AI system connects to servers and stored conversation records.
Why use it?
It explains the system’s current architecture and warns agents that the gateway and system services may have broad access, so changes must respect its trust and chat-handling design.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

This is bolivian-peru/os-moda's own configuration. It tells Claude Code how to work on os-moda 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 os-moda configures →

Reuse

Borrowing it

Nothing to install: this file belongs to bolivian-peru/os-moda. 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/bolivian-peru/os-moda/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/bolivian-peru/os-moda

Made for: Claude Code.

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 os-moda CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/bolivian-peru/os-moda/claude-md/github.svg)](https://agentmods.dev/instructions/bolivian-peru/os-moda/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/bolivian-peru/os-moda/claude-md"><img src="https://agentmods.dev/badge/instructions/bolivian-peru/os-moda/claude-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 os-moda CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/bolivian-peru/os-moda/claude-md"><img src="https://agentmods.dev/badge/instructions/bolivian-peru/os-moda/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12,027 This file is loaded in full into every session.
When invoked 12,027 The same file — it is already loaded in full.
Security scan C 3 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.12027 $0.12027
Opus 5 $0.06013 $0.06013
Sonnet 5 $0.02405 $0.02405
Haiku 4.5 $0.01203 $0.01203

Measured 11d ago against content hash 8111c4142642, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade C, and why

os-moda CLAUDE.md scanned grade C with 3 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 11d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

├── install.sh # One-command installer (curl | bash)

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

├── install.sh # One-command installer (curl | bash)

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **claude-code is the DEFAULT runtime** (canonical as of 2026-06-10) — token streaming + persistent named chats + cross-chat awareness + OAuth-or-API-key; it is what the fleet actually runs. `install.sh:87`, `osmoda.nix
CLAUDE.md · 749 lines

How it starts

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

CLAUDE.md - osModa

What this is

osModa: NixOS distribution with AI-native system management. The agent runs via Claude Code SDK with full root-level access to the entire system via structured daemons.

The agent has FULL system access. Root. All files. All processes. All APIs. The sandbox exists for UNTRUSTED third-party tools, not for the agent itself.

Current state

  • osmoda-gateway v1.3.0 (stable) — named chats (multiple distinct persistent conversations per server: each chatId → its own --resume session + transcript + native compaction; ChatRegistry at state/chats.json; /chats REST list/create/rename/archive; legacy/main chatId maps to the original conversation for zero-move migration) + cross-chat awareness (a bounded, deterministic since-cursor digest of OTHER chats' notable tool-rows — sourced from the gateway's own per-chat transcripts, NOT the agentd ledger — injected into the turn + surfaced as a "caught up on N changes" chip; per-peer cursors commit only on a successful turn; zero token overhead for single-chat work). Runtime: claude-code is the default chat driver (token streaming + named chats + OAuth/API key); the ws-relay runs in gateway mode for both drivers (so named chats work for openclaw-via-gateway too); openclaw-native bypass is behind install.sh --advanced-openclaw-native. (gateway-owned canonical transcript [JSONL per session, GET /sessions/:agent/:key/transcript] + durable MEMORY.md auto-load into the system prompt + transcript re-seed when a runtime session is missing/swapped; sessions disk-persisted, runtime-tagged, healthCheck-gated swaps, optional CodeGraph MCP server; tool-target hints in the chat action log). Both drivers now honor the two-text-channel streaming contract: planning/preamble text streams on interim_text (collapsible thinking panel) and only the authoritative final answer is promoted as text_bulk (+ interim_commit_final + phase:answering). This fixed the claude-code fragmentation bug where every preamble before a tool was treated as a final answer — the gateway no longer flushes an assistant transcript row per tool_use, so one logical turn = exactly one persisted assistant entry (no more stacked "Task completed" stubs on replay). The dashboard replay accumulates agent rows into one turn (heals pre-fix transcripts). Stop reliability: the ws-relay accepts both chat_abort and abort, the dashboard Stop button halts the UI client-first/unconditionally, and abort SIGTERM→SIGKILLs the claude process-group (0.5 s kill, verified). claude-code is the recommended chat runtime — it streams token text + live tools with native session history + auto-compaction; openclaw buffers per-round and cannot token-stream.
  • Spawn-app API v1.3.x (latest documented v1.3.1; internal ~v1.3.35 with chat persistence + watchdog + Engine UX + 3-col detail grid + heartbeat body-limit fix + single-source chat replay + smooth streaming reveal + live tool-action targets)
  • Claude Code CLI ^2.1.175 pin (newest 2.x; refuses anything <2.x via gateway healthCheck). Default model claude-opus-4-8; claude-fable-5 / claude-mythos-5 (Project Glasswing) selectable.
  • claude-code is the DEFAULT runtime (canonical as of 2026-06-10) — token streaming + persistent named chats + cross-chat awareness + OAuth-or-API-key; it is what the fleet actually runs. install.sh:87, osmoda.nix:77, and the README all agree on this default. OpenClaw remains a fully-supported, Engine-tab-selectable peer (the original osModa design, kept as the BYOK/multi-provider executive option). The osmoda-bridge (92 system tools) is installed as a native OpenClaw plugin via openclaw plugins install <path> --link --dangerously-force-unsafe-install (forced — it's our tier-0 bridge: child_process + daemon sockets are its purpose) against a compiled dist/index.js whose manifest declares contracts.tools (a 2026.5 requirement). Runtime invocation: openclaw agent --agent <id> --local --json --model <provider>/<model> --session-id <id> --message; auth written as the 2026.5 AuthProfileSecretsStore ({version:1,profiles:{<id>:{type:"api_key"|"token",provider,...}}} — accepts API key OR OAuth-as-token); non-default agent ids auto-registered. Verified live: 77+ osModa tools load into a real openclaw turn through the gateway (full completed reply pending a credential that isn't usage-capped). healthCheck() probes the agent subcommand; swaps are gated.
  • CodeGraph (colbymchenry/codegraph, MIT, pure-WASM tree-sitter + SQLite) installed on every spawn as an optional MCP server (env-gated OSMODA_CODEGRAPH_ENABLED=1). Gives the agent codegraph_search/context/callers/callees/impact/node/explore/files/status — a pre-indexed code knowledge graph for ~90% fewer grep/Read calls. Auto-indexes /opt/osmoda (self-modification awareness), /workspace/* (spec-kit), /srv/* (deployed apps) via osmoda-codegraph-index.timer (30-min sync); spec-kit init/implement hook into it. Security-audited 2026-05-20. Full phased plan in docs/planning/CODEGRAPH-INTEGRATION.md.

Read the full file on GitHub · 749 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. 11d ago First seen · 749 lines · 12,027 tokens per session scan C 8111c4142642

Subscribe to this mod's changes

os-moda CLAUDE.md is an instructions file published in the GitHub repository bolivian-peru/os-moda (117 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 12,027 tokens to every session, about $0.0601 per session on Opus 5. A static security scan graded it C with 3 findings (downloads and executes remote code, makes network calls, runs shell commands). 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

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,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

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 · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 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, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 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,469 tokens