Borrowing it
Nothing to install: this file belongs to MotleyAI/slayer. 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/MotleyAI/slayer/main/CLAUDE.mdgit clone --depth 1 https://github.com/MotleyAI/slayerWrote 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/motleyai/slayer/claude-md)<a href="https://agentmods.dev/instructions/motleyai/slayer/claude-md"><img src="https://agentmods.dev/badge/instructions/motleyai/slayer/claude-md.svg" alt="Measured on agentmods" 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.01627 | $0.01627 |
| Opus 5 | $0.00813 | $0.00813 |
| Sonnet 5 | $0.00325 | $0.00325 |
| Haiku 4.5 | $0.00163 | $0.00163 |
Grade A, and why
slayer 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
Guidance for Claude Code when working in this repository.
What is SLayer?
SLayer (Semantic Layer) is a lightweight, open-source (MIT) semantic layer for AI agents, built by MotleyAI. Instead of writing raw SQL, agents describe what data they want — measures, dimensions, filters — and SLayer generates and executes the query.
Server ports: REST API 5143, Flight SQL 5144, Postgres facade 5145.
When writing SLayer query examples or answering questions about syntax and capabilities,
read docs/ first — especially docs/concepts/queries.md, docs/concepts/formulas.md,
docs/concepts/models.md, and docs/examples/.
Layout
slayer/core domain models & errors; slayer/engine query engine; slayer/sql SQL
generation + dialects; slayer/storage YAML/SQLite backends + migrations; slayer/api
REST; slayer/mcp MCP server; slayer/flight / slayer/pg_facade / slayer/facade
BI wire protocols; slayer/memories + slayer/search agent memory & semantic search;
slayer/cli.py CLI.
Cross-cutting structure and principles live in architecture/ (LikeC4 model + arc42 +
index.yaml); enforcement bundle: poetry run lint-imports, poetry run python tools/arch_check.py, npx -y [email protected] validate architecture, poetry run basedpyright.
Common Commands
poetry install -E all # install with all extras
poetry run pytest -m "not integration" # unit tests (excludes integration)
poetry run pytest tests/integration/ -m integration # all integration tests
poetry run pytest tests/test_sql_generator.py -v # one file
poetry run slayer serve # REST API server
poetry run slayer mcp # MCP server
poetry run ruff check slayer/ tests/ # lint
All CLI commands accept --storage (YAML dir or .db file); defaults to the platform
data dir, override with $SLAYER_STORAGE.
Key Conventions
- Python 3.11+, Pydantic v2 for all models
- NEVER use dataclasses — use Pydantic classes instead
- Use
poetry runfor all Python commands - Use keyword arguments for functions with more than 1 parameter
- Imports at the top of files
- SQL generation uses sqlglot AST building, not string concatenation
- Async-first: engine and storage methods are async;
execute_sync()/run_sync()bridge for CLI/scripts - Core principle: adding a measure/field must never change result cardinality or other fields' values
- Two expression layers — Mode A: free SQL in
Column.sql/ modelfilters(dotted join paths); Mode B: Python-AST DSL in formulas and query fields (dotted paths, colon aggregations, scalar-allowlist functions only). Rules:docs/concepts/references.md - Aggregations are query-time, colon syntax:
revenue:sum,*:countfor COUNT(*),price:percentile(p=0.9) - Result column keys are
model.column:revenue:sum→orders.revenue_sum,*:count→orders._count; joined dimensions keep the full path (orders.customers.regions.name) - Dots denote join paths in BOTH queries and model SQL (
customers.regions.name, dotted-canonical); the legacy__split-alias input form is a hard error.__stays only as an internal generated-SQL join alias, and is a legal (exact-match) character in model/query/column names (__slayer_prefix reserved) - Models are keyed by
(data_source, name); joins resolve within the parent model's datasource - Models/queries/datasource configs carry a
versionfield; storage migrations run automatically on load (slayer/storage/migrations.py) - Filters support
{variable}placeholders fromquery.variables(scalars, plus lists → auto-quotedIN-list body:region IN ({regions})). Values are trusted input; string escaping IS dialect-aware (DEV-1727) but only applies to quoted literals. Datasource configs support${ENV_VAR} - Mode-A raw-SQL surfaces also support optional blocks
{? pred ?}— render parenthesised when every inner{var}is supplied, else collapse to(1=1)(CubeFILTER_PARAMSoptional-pushdown form, DEV-1730).extract_model_variables(model)classifies placeholders required vs optional; surfaced in the inspect skeleton slayer import-cubereads Cube.yml/.yamland.js(cube()/view()via esprima); FILTER_PARAMS →{var}/{? ?}, requiredness from membermeta.required(--ignore-required-metato force optional). Seedocs/cube/cube_import.md- A model may declare a variable
list_valuedinmeta.cube_variables(importers do this for generatedcol IN ({var})templates); the engine then wraps a bare scalar into a one-element list. Hand-written model SQL keeps the author-writes-the-quotes convention — a scalar string substitutes unquoted
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.
- today Changed · +4 lines · +74 tokens per session 96386fa54553
- 8d ago First seen · 101 lines · 1,553 tokens per session scan A 35d750945f7a
slayer CLAUDE.md is an instructions file published in the GitHub repository MotleyAI/slayer (167 stars, last pushed today), licensed MIT. It adds 1,627 tokens to every session, about $0.0081 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-30.
Other instructions, from other repositories
plan-forge caching.instructions.md
Caching patterns for .NET — IDistributedCache, Redis, in-memory, cache-aside, TTL strategies.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
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).
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.
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.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).