halfmoon: Instructions file for Claude Code

CLAUDE.md

halfmoon CLAUDE.md is an instructions file for Claude Code from halfmoon-labs/halfmoon. It costs 1,715 tokens per session, scanned C, original, MIT.

Project instructions for Halfmoon, a lightweight personal assistant written in Go. They document its build, test, formatting, linting, and pre-release checks.

In plain words
What is it for?
Use them when modifying Halfmoon, running its Go and web tests, checking code quality, or preparing a pull request.
Why use it?
They give a coding agent the exact commands and completion checks needed before changes are considered ready.

Instructions file for Claude Code

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/halfmoon-labs/halfmoon/claude-md"><img src="https://agentmods.dev/badge/instructions/halfmoon-labs/halfmoon/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,715 This file is loaded in full into every session.
When invoked 1,715 The same file — it is already loaded in full.
Security scan C 2 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.01715 $0.01715
Opus 5.5 $0.00686 $0.00686
Sonnet 5.5 $0.00343 $0.00343
Haiku 4.5 $0.00171 $0.00171

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

Security

Grade C, and why

halfmoon CLAUDE.md scanned grade C with 2 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 2mo 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.

If `make lint` fails with `"Can't read config"`, your local golangci-lint is v1.x — update to v2: `curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b /usr/local/bin v2.10.1`

Makes network callslowCapability

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

If `make lint` fails with `"Can't read config"`, your local golangci-lint is v1.x — update to v2: `curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b /usr/local/bin v2.10.1`
CLAUDE.md · 154 lines

How it starts

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

CLAUDE.md — Halfmoon

Ultra-lightweight personal AI assistant in Go. Runs on $10 hardware, <10MB RAM. Pure Go (CGO_ENABLED=0).

Commands

# Build
make build                    # Build halfmoon binary
make build-launcher           # Build web launcher (TUI)

# Test
make test                     # Run Go tests (excludes web/) + web tests
go test ./pkg/agent/...       # Test single package
go test -run TestName ./pkg/  # Run specific test

# Lint & Format (requires golangci-lint v2 — config uses version: "2")
make lint                     # golangci-lint run (all linters)
make fmt                      # golangci-lint fmt (auto-format: gci, gofmt, gofumpt, golines)
make fix                      # Auto-fix lint issues
make vet                      # go vet

# Full check before PR
make check                    # deps + fmt + vet + test

Validation Before Committing

Run these in order before considering work complete:

  1. Build: go build ./... — must compile with zero errors
  2. Test: go test ./pkg/... -count=1 — all tests must pass
  3. Lint: make lint — zero issues. CI runs golangci-lint v2.10.1 with gci (import ordering), golines (max 120 chars), and spancheck (span leak detection) among others. Fix issues with make fmt first, then address remaining lint errors manually.
  4. Vet: make vet — zero issues

If make lint fails with "Can't read config", your local golangci-lint is v1.x — update to v2: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b /usr/local/bin v2.10.1

Architecture

cmd/halfmoon/           → CLI entry (Cobra). 10 subcommands.
pkg/agent/              → Core agent loop. THE most important package.
  loop.go               → Main reasoning loop (runTurn, turnLoop at line 1690)
  instance.go           → AgentInstance struct — model, tools, sessions, config
  context.go            → System prompt builder (AGENT.md + SOUL.md + skills + memory)
  hooks.go              → BeforeLLM/AfterLLM/BeforeTool/AfterTool interceptors
  eventbus.go           → 19 event types, multi-subscriber broadcaster
  subturn.go            → Sub-agent spawning (async/sync)
  turn.go               → Turn state management, parent-child hierarchy
pkg/providers/          → LLM provider adapters. Factory pattern + fallback chains.
pkg/channels/           → Chat platforms. 15+ channels, all funnel through BaseChannel.
  base.go               → HandleMessage() — shared entry for all channels
  manager.go            → Message routing, outbound delivery
pkg/tools/              → Tool registry. Interface: Name/Description/Parameters/Execute.
  base.go               → Tool interface + ToolResult (ForLLM, ForUser, IsError)
  registry.go           → Map-based lookup, clone support for sub-agents
  http_request.go       → HTTP request tool. Domain allowlist, auth profiles, SSRF protection.
pkg/bus/                → Message bus. Decouples channels from agent.
pkg/config/             → Config loading. JSON config + .security.yml + env vars + file:// refs
pkg/cron/               → In-process cron scheduler. Single goroutine + timer.
pkg/heartbeat/          → Periodic agent nudge from HEARTBEAT.md
pkg/routing/            → 7-level priority cascade for agent selection
web/backend/            → Go web server (REST API + WebSocket)
web/frontend/           → React 19 + Vite + TypeScript + Jotai + TanStack Router

Read the full file on GitHub · 154 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. 2mo ago First seen · 154 lines · 1,715 tokens per session scan C 1f1ffc7f9b1e

Subscribe to this mod's changes

halfmoon CLAUDE.md is an instructions file published in the GitHub repository halfmoon-labs/halfmoon (11 stars, last pushed 6mo ago), licensed MIT. It adds 1,715 tokens to every session, about $0.0069 per session on Opus 5.5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

halfmoon CLAUDE.md compared with instructions from other repositories

halfmoon CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
halfmoon CLAUDE.mdhalfmoon-labs/halfmoonInstructions file116mo agoMITC1,715Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file275k2d agoMITA4,313Codex, OpenCode