Borrowing it
Nothing to install: this file belongs to nonatofabio/luna-agent. 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/nonatofabio/luna-agent/main/CLAUDE.mdgit clone --depth 1 https://github.com/nonatofabio/luna-agentWrote 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/nonatofabio/luna-agent/claude-md)<a href="https://agentmods.dev/instructions/nonatofabio/luna-agent/claude-md"><img src="https://agentmods.dev/badge/instructions/nonatofabio/luna-agent/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/nonatofabio/luna-agent/claude-md"><img src="https://agentmods.dev/badge/instructions/nonatofabio/luna-agent/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.01019 | $0.01019 |
| Opus 5.5 | $0.00408 | $0.00408 |
| Sonnet 5.5 | $0.00204 | $0.00204 |
| Haiku 4.5 | $0.00102 | $0.00102 |
Grade B, and why
luna-agent CLAUDE.md scanned grade B 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 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.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
sudo systemctl start worker-agent # starts llama-server on port 8001 (Qwen3.5-35B-A3B) How it starts
The opening of the file, as written. The whole thing — 68 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.
What This Is
Luna Agent — a minimal AI assistant with persistent memory, MCP tool use, and Discord/CLI interface. It runs on Fabio's homelab (dual RTX 3090s) using a local Qwen3.5-35B-A3B model via llama-server as the LLM backend.
Commands
# Activate venv (required for all commands)
source .venv/bin/activate
# Install dependencies
pip install -e ".[dev]"
# Run the agent (needs DISCORD_TOKEN env var for Discord, otherwise interactive CLI)
python -m luna
# Run all tests
pytest
# Run a single test file or test
pytest tests/test_memory.py
pytest tests/test_agent.py::TestAgent::test_basic_response
# Systemd services (the agent depends on the LLM server)
sudo systemctl start worker-agent # starts llama-server on port 8001 (Qwen3.5-35B-A3B)
sudo systemctl start luna-agent # starts the bot (requires worker-agent)
journalctl -u luna-agent -f # live logs
Architecture
The agent follows a straightforward pipeline: Discord message (or CLI input) → Agent loop → LLM (with tool calls) → Response.
agent.py — The orchestrator. Agent.process() is the main entry point: it saves the user message to memory, retrieves relevant memories via hybrid search, builds a system prompt with memory context, calls the LLM, executes any tool calls in a loop (max 25 rounds), saves the response, and periodically triggers summarization/fact extraction. Accepts an optional tool_callback for real-time tool call observation (used by CLI REPL).
memory.py — Persistent memory using SQLite with three search mechanisms:
- FTS5 for keyword search
- sqlite-vec for vector similarity search (embeddings from
nomic-embed-text-v1.5, 384 dims) - Reciprocal Rank Fusion (RRF) to merge both result sets, plus recency decay and importance weighting
Three tables: memories (long-term facts), messages (conversation history per session), summaries (periodic LLM-generated conversation summaries). The embedding model is lazy-loaded on first search to avoid slow startup.
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 · 68 lines · 1,019 tokens per session scan B 60f740e7dbd9
luna-agent CLAUDE.md is an instructions file published in the GitHub repository nonatofabio/luna-agent (21 stars, last pushed 7mo ago), licensed MIT. It adds 1,019 tokens to every session, about $0.0041 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
luna-agent CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| luna-agent CLAUDE.mdnonatofabio/luna-agent | Instructions file | 21 | 7mo ago | MIT | B | 1,019 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | 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 | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |