macro-engine CLAUDE.md

A set of instructions for Macro Engine, a local food database and MCP server for conversational nutrition tracking. It explains the project structure, tests, data loading, stable food IDs, and rules for keeping historical records correct.

In plain words
What is it for?
Use it when changing food imports from the USDA FoodData Central database, nutrition logging, database behavior, MCP tools, or project tests.
Why use it?
It prevents changes from breaking food references or altering past nutrition logs, and keeps the server’s tool instructions clear for the AI that uses it.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/rockitdev/macro-engine/claude-md
Clone the repo
git clone --depth 1 https://github.com/rockitdev/macro-engine
Per session 246 This file is loaded in full into every session.
When invoked 246 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00246 $0.00246
Opus 5 $0.00123 $0.00123
Sonnet 5 $0.00049 $0.00049
Haiku 4.5 $0.00025 $0.00025

Measured yesterday against content hash a124877697de, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

macro-engine CLAUDE.md scanned grade A with 0 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 24 lines

What it actually says

CLAUDE.md

Macro Engine: local food DB (USDA FDC) + MCP server for conversational macro tracking. See README.md for architecture and setup.

Commands

.venv/bin/python -m unittest discover tests -v     # tests (stdlib unittest only)
.venv/bin/python -m macro_engine.etl_fdc           # reload USDA data (idempotent)

Rules

  • Runtime state: ~/.local/share/macro-engine/macros.db. Never commit DBs.
  • Stdlib-only except the mcp package (server layer). Keep it that way.
  • Log rows keep denormalized macros — never "fix" history by mutating foods.
  • Food ids must stay stable across ETL re-runs (upsert on source+source_id); aliases and log history depend on it.
  • The consumer is an LLM (fleet proxy). Tool docstrings in mcp_server.py are prompt surface — keep them precise about item shapes and correction flow.
  • Daily-note/vault writes are the proxy's job (agent-fleet assistant skill), not this server's. Keep the server vault-free.
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. yesterday First seen · 24 lines · 246 tokens per session scan A a124877697de

Subscribe to this mod's changes

macro-engine CLAUDE.md is an instructions file published in the GitHub repository rockitdev/macro-engine (0 stars, last pushed 1mo ago), licensed MIT. It adds 246 tokens to every session, about $0.0012 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.