ScalaSemantic: Instructions file for Claude Code

CLAUDE.md

ScalaSemantic CLAUDE.md is an instructions file for Claude Code from MercurieVV/ScalaSemantic. It costs 1,726 tokens per session, scanned C, original, MIT.

A local server for analysing Scala code using SemanticDB, a structured record of what code symbols mean and how they relate. It provides deeper project information than basic editor features.

In plain words
What is it for?
It helps index Scala project data and run semantic analysis through a local MCP server. The input does not specify the individual analyses available.
Why use it?
It helps developers inspect relationships and meaning across a Scala project instead of relying only on text searches or editor hints.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths.

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/mercurievv/scalasemantic/claude-md"><img src="https://agentmods.dev/badge/instructions/mercurievv/scalasemantic/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,726 This file is loaded in full into every session.
When invoked 1,726 The same file — it is already loaded in full.
Security scan C 1 finding. 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.01726 $0.01726
Opus 5 $0.00863 $0.00863
Sonnet 5 $0.00345 $0.00345
Haiku 4.5 $0.00173 $0.00173

Measured 5d ago against content hash 4f2148fd4418, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade C, and why

ScalaSemantic CLAUDE.md scanned grade C 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 5d 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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

core/ …​.semanticdb SemanticIndex — loads/indexes *.semanticdb (no JSON, no MCP) analysis/ …​.analysis, …​.model Analyzer + upickle result models; dependsOn core mcp/ …​.mcp, Main stdio JSON-RPC server + entrypoint; depe
CLAUDE.md · 107 lines

How it starts

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

ScalaSemantic

MCP server doing deep semantic analysis on Scala projects via SemanticDB — capabilities beyond standard LSP/Metals.

Stack

  • Scala 3.8.4, Mill 1.1.7 (build tool; build.sbt/project/ deleted — Sonatype publish and stryker4s mutation testing are deferred, disabled in CI (if: false) until each has a working Mill path, see docs/MILL_MIGRATION.md)
  • org.scalameta:scalameta:4.13.9 — SemanticDB protobuf API (scala.meta.internal.semanticdb)
  • com.lihaoyi:upickle:4.2.1 — JSON for MCP wire protocol
  • org.scalameta:munit:1.2.3 — tests
  • semanticdbEnabled := true — project emits its own SemanticDB; analyzer dogfoods on this repo.

Layout

Three Mill modules (layer per module), package base com.github.mercurievv.scalasemantic:

core/      …​.semanticdb   SemanticIndex — loads/indexes *.semanticdb (no JSON, no MCP)
analysis/  …​.analysis, …​.model   Analyzer + upickle result models; dependsOn core
mcp/       …​.mcp, Main    stdio JSON-RPC server + entrypoint; dependsOn analysis (test->test too)

SemanticDB is emitted per module under out/<module>/compile.dest/classes/META-INF/semanticdb/**. Dogfood tests load SemanticIndex.fromProject(".") (repo root) so they see every module's output; unforked tests run with cwd = repo root. mcp test-depends on analysis so fixtures compile first.

Architecture

3 layers: MCP stdio JSON-RPCanalysis engineSemanticIndex.

  • No Scala MCP SDK exists — JSON-RPC is hand-rolled over stdin/stdout with upickle.
  • Signature rendering is a custom Type/Signature printer; implicit params detected via SymbolInformation.Property.IMPLICIT bitmask.
  • Call graph: edges from SymbolOccurrence references within a method's definition range; BFS for path-find.

MCP tools (target surface)

find-usages, method-signature, class-hierarchy, resolve-implicits, trait-vs-local-members, type-at-position, cross-file-refs, find-overloads, trace-implicit-chain, call-graph-path, rename-plan, move-plan, extract-method-plan.

Read the full file on GitHub · 107 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. 5d ago Changed · +6 tokens per session 4f2148fd4418
  2. 10d ago First seen · 107 lines · 1,720 tokens per session scan C 5a6de607667a

Subscribe to this mod's changes

ScalaSemantic CLAUDE.md is an instructions file published in the GitHub repository MercurieVV/ScalaSemantic (21 stars, last pushed 2d ago), licensed MIT. It adds 1,726 tokens to every session, about $0.0086 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vibetags com-example-service-NewAnnotationsShowcase-DraftKafkaIntegrationSpike.instructions.md

Instructions for PIsberg/vibetags, covering copilot instructions for draftkafkaintegrationspike and experimental prototype.

PIsberg/vibetags · 93 tokens

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.

vercel/next.js · 7,296 tokens

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.

openai/codex · 5,153 tokens

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).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

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).

microsoft/vscode · 5,001 tokens