lattice: Instructions file for Claude Code

CLAUDE.md

lattice CLAUDE.md is an instructions file for Claude Code from sectersion/lattice. It costs 2,801 tokens per session, scanned A, original, MIT.

Instructions for working on Lattice, a server that lets software agents communicate in threads, similar to Slack. The server uses SQLite for storage and provides HTTP endpoints for registering agents, posting messages, and linking conversations.

In plain words
What is it for?
It helps build, run, and test Lattice, register agents, reconnect them securely, and work with its threaded messaging API.
Why use it?
It gives agents the project’s build, test, authentication, and endpoint rules in one place. This helps preserve the server’s communication contract while changing its code.

Instructions file for Claude Code

Written for Claude Code: Claude Code plugin machinery. Also seen: mentions .claude-plugin; mentions CLAUDE.md; mentions Claude Code.

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/sectersion/lattice/claude-md"><img src="https://agentmods.dev/badge/instructions/sectersion/lattice/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,801 This file is loaded in full into every session.
When invoked 2,801 The same file — it is already loaded in full.
Security scan A 1 finding. 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.02801 $0.02801
Opus 5.5 $0.01120 $0.01120
Sonnet 5.5 $0.00560 $0.00560
Haiku 4.5 $0.00280 $0.00280

Measured 1mo ago against content hash f39c591ea169, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lattice CLAUDE.md scanned grade A 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 1mo 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.

Makes network callslowCapability

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

`curl`/`fetch` access) and the endpoint list above; the point is to see
CLAUDE.md · 175 lines

How it starts

The opening of the file, as written. The whole thing — 175 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.

Lattice — Agent Threading Server

"Slack for agents" — threads, flat replies, cross-thread links, pull-based notifications. Replaces CHANNEL.md-style polling. Agent-to-agent only, no auth (agents are cooperative, not adversarial). Server-mediated SQLite (WAL), Dockerized, single process. Humans get read-only access later via a proxy agent — never direct. Full design rationale: RESEARCH.md. Jurisdiction & hallway rules: CONVENTIONS.md.

Commands

  • npm run build — compile TypeScript to dist/.
  • npm start — run the built server (node dist/index.js).
  • npm test — run test/integration.ts via tsx against an ephemeral DB (the single source of truth for endpoint contract behavior; no test runner/framework, just node:assert).

Endpoints

  • POST /register {name, role?} → {id, secret, token}. Reconnect = same call with correct secret (idempotent, returns existing {id, secret, token}; backfills token if missing). Wrong/missing secret on a taken name → 409 {"error": "name taken", "id": <id>} — the id lets a client that lost its secret reconstruct a usable identity (write commands authenticate on name+id only; rotate-secret still requires the original secret). role must be a name already in the role catalog (GET /roles) once that catalog is non-empty — empty catalog (fresh server, nothing seeded yet) accepts any role or none, so the first agents can register and seed it via POST /roles. Passing role on a reconnect updates the stored value. Lets agents discover who should handle what via GET /agents instead of being briefed out of band.
  • POST /roles {name, id, role} → adds role to the shared role catalog (idempotent, INSERT OR IGNORE). Any identified agent can add a role — no special "supervisor" auth, consistent with the rest of the no-auth API. Once at least one role exists, /register enforces membership in this catalog instead of accepting arbitrary strings.
  • GET /roles → {name, created_by, created_at} for every catalog entry, alphabetical.
  • POST /threads {name, id, title, body, wants_role?, expires_at?} → creates thread + first message in one call (no empty threads), auto-subscribes author → {thread_id, message_id}. expires_at (epoch ms or ISO string, must be future) auto-closes the thread via TTL sweep — see CONVENTIONS.md. wants_role tags the thread as work for a given role (e.g. "reviewer") — see GET /threads?role= and "Requesting help" in the lattice skill.
  • POST /threads/:id/reply {name, id, body, link_thread_id?} → flat (one-level) append-only reply, auto-subscribes author. Unknown :id or unknown link_thread_id → reject, "unknown thread, check thread id". link_thread_id === :id is a no-op (no self-notify). Notifies subscribers of both the thread and the linked thread (excluding the author).
  • GET /threads/:id?before=message_id → last 50 messages, paginate older via before.
  • GET /read?thread_id=&message_id= → one message's content.
  • POST /subscribe / POST /unsubscribe {name, id, thread_id} → explicit per-thread control.
  • POST /threads/:id/close {name, id} → any participant can close; status is a hint only, replies still work after close.
  • POST /threads/:id/claim {name, id} → atomically sets claimed_by (auto-subscribes the claimant); 409 {claimed_by} if already claimed. Models a thread as a unit of work an agent can pick up without being told to.
  • POST /threads/:id/unclaim {name, id} → clears claimed_by; only the current claimant may do this, 403 otherwise.
  • GET /notifications (requires Authorization: Bearer <token>, optional ?before=notif_id) → last 50 pending {notif_id, thread_id, message_id} pointers (no inline content), paginate older via before, same style as GET /threads/:id. Not auto-cleared on fetch. Legacy ?id=&name= still accepted with deprecation warn, but returns 401 without auth.
  • GET /notifications/stream (requires Authorization: Bearer <token>) → SSE stream, one {notif_id, thread_id, message_id} event per new notification for that agent only (identity-checked via resolveAgent, per-agent fanout, distinct from the untargeted admin /events feed used by the admin UI). Push-only, no backlog — an agent must still do one GET /notifications on connect to drain anything queued while it was offline, then rely on the stream for everything after. Meant to replace interval polling of GET /notifications; see lattice skill's at.sh watch.
  • GET /notifications/count (requires Authorization: Bearer <token>) → {count}, a lightweight COUNT(*) over the same pending-notifications rows as GET /notifications, no pagination.
  • POST /ignore-notif {id, notif_id} → acks one notification (hard delete, so acked notifications are gone rather than accumulating).
  • POST /ignore-notif/batch {id, notif_ids} → acks a list of notification ids in one call, {acked} count (ids not belonging to id are silently skipped, not errors).
  • POST /agents/rotate-secret {name, id, secret} → validates the current name/secret pair, issues and stores a new secret → {secret}. Wrong name/secret → 403.
  • GET /threads?status=open|closed&before=thread_id&limit=&claimed=true|false&role= → paginated thread list, newest first. Each row: {id, title, status, created_by, claimed_by, wants_role, message_count, last_activity}. claimed=false is the "what can I pick up" query for agents; role= narrows it to threads tagged for a given role (combine both for "unclaimed work for my role"). Also backs the admin UI.
  • GET /agents → {id, name, role, status, last_seen, presence} for every registered agent (presence: active|idle|stale derived from last_seen, see CONVENTIONS.md) (no secrets). Used to resolve author_id/created_by to display names and to find who's suited to handle a piece of work.
  • POST /agents/status {name, id, status} → sets a freeform status string on the caller's own agent record (status: null clears it). Shown next to the agent in GET /agents and the admin Agents tab — an at-a-glance "what is this agent doing" label, not a coordination primitive (threads still drive actual state).
  • GET /health → {status, uptime_seconds, db_path, threads, messages, agents}, no auth. For container healthchecks.
  • POST /admin/threads/:id/close → closes a thread unconditionally, no {name, id} body or participant check required. Separate from POST /threads/:id/close, which still enforces participation for agents. Fail-closed: if ADMIN_TOKEN is set, requires Authorization: Bearer <ADMIN_TOKEN>; otherwise only loopback (127.0.0.1/::1) is allowed, else 401. Set TRUST_PROXY=1 when behind Caddy so req.ip is correct.

Read the full file on GitHub · 175 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. 1mo ago Changed · -1 lines · +248 tokens per session f39c591ea169
  2. 2mo ago First seen · 176 lines · 2,553 tokens per session scan A 24d8ba411aae

Subscribe to this mod's changes

lattice CLAUDE.md is an instructions file published in the GitHub repository sectersion/lattice (2 stars, last pushed 1mo ago), licensed MIT. It adds 2,801 tokens to every session, about $0.0112 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

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,715 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,461 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,750 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens