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.
curl -O https://raw.githubusercontent.com/halfmoon-labs/halfmoon/main/CLAUDE.mdgit clone --depth 1 https://github.com/halfmoon-labs/halfmoonWrote 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.
[](https://agentmods.dev/instructions/halfmoon-labs/halfmoon/claude-md)<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.
<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>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.
| Model | Per session | Once 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 |
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` 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:
- Build:
go build ./...— must compile with zero errors - Test:
go test ./pkg/... -count=1— all tests must pass - 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 withmake fmtfirst, then address remaining lint errors manually. - 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
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.
- 2mo ago First seen · 154 lines · 1,715 tokens per session scan C 1f1ffc7f9b1e
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.
halfmoon CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| halfmoon CLAUDE.mdhalfmoon-labs/halfmoon | Instructions file | 11 | 6mo ago | MIT | C | 1,715 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 275k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |