laravel-truss: Instructions file for Claude Code

CLAUDE.md

laravel-truss CLAUDE.md is an instructions file for Claude Code from albertoarena/laravel-truss. It costs 1,469 tokens per session, scanned A, original, MIT.

Project instructions for Laravel Truss, a Laravel package that displays a database’s table structure as a zoomable entity-relationship diagram. An entity-relationship diagram shows tables and how they connect, without exposing stored data.

In plain words
What is it for?
Use them when developing the Laravel package, diagram interface, PHP code, JavaScript logic, browser tests, or accessibility tests.
Why use it?
They explain the project’s architecture, supported software versions, and commands, helping agents make compatible changes and run the right checks.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

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

Reuse

Borrowing it

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

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 laravel-truss CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/albertoarena/laravel-truss/claude-md"><img src="https://agentmods.dev/badge/instructions/albertoarena/laravel-truss/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,469 This file is loaded in full into every session.
When invoked 1,469 The same file — it is already loaded in full.
Security scan A 0 findings. 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.01469 $0.01469
Opus 5 $0.00734 $0.00734
Sonnet 5 $0.00294 $0.00294
Haiku 4.5 $0.00147 $0.00147

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

Security

Grade A, and why

laravel-truss 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 11d 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.

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 · 56 lines

How it starts

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

CLAUDE.md — Instructions for Claude Code

Project Overview

Package: albertoarena/laravel-truss Type: Laravel Composer package Purpose: A live database structure viewer. Scans migrations, builds a cached schema snapshot, and renders it as a scrollable, zoomable ER diagram inside the app. Structure only, no data is ever exposed. License: MIT

Stack

  • PHP 8.2+ (lowered from 8.3 in v1.10, matching what Laravel 12 requires; see docs/adr/0001-php-82-minimum.md)
  • Laravel 12+
  • Pest for testing
  • Laravel native schema introspection (Schema::getTables/getColumns/getIndexes/getForeignKeys) — no Doctrine DBAL
  • Mermaid.js for diagram rendering (no build step)
  • spatie/laravel-package-tools for package scaffolding

Commands

  • composer test — run the Pest suite
  • composer lint — Laravel Pint (code style check)
  • composer lint:fix — fix Pint issues automatically
  • npm test — Vitest unit tests for the client-side diagram logic (resources/js)
  • npx playwright test — browser tests for the dashboard (tests/e2e)
  • npm run test:a11y — accessibility specs only (keyboard operation + an axe-core WCAG scan); also its own CI step
  • php artisan truss:show — print the database structure as a terminal table (structure only)
  • php artisan truss:open — open the Truss dashboard in the browser
  • php artisan truss:rebuild — manually rebuild the cached schema snapshot
  • php artisan truss:export — export the structure (dbml/json/csv/markdown/mermaid) for CI and tooling; --check fails on drift

Frontend assets (JS/CSS + a vendored Mermaid) are served from the package via a gated {prefix}/assets/{file} route — no vendor:publish, no CDN. Set TRUSS_MERMAID_URL to load Mermaid from a CDN instead.

Conventions (always true)

  • TDD is mandatory, and it is an ordering rule, not just a coverage rule. For every change (feature, fix, refactor), in this order: (1) write the test, (2) run it and watch it fail for the right reason (red), (3) write the implementation to make it pass (green). Writing production code before its test is a violation even if a passing test is added right afterwards: the test must exist and fail first. Never commit implementation without a corresponding test. No controller, command, class, or function is written before the test that drives it. PHP uses Pest; client-side code under resources/js uses Vitest for pure logic and Playwright for rendering/interaction.
  • No data exposed, ever. Only table, column, index, and foreign key structure. Never row contents. This is the package's core promise, treat it as a hard constraint, not a config default. The boundary is the CREATE TABLE definition vs. table rows: column defaults count as structure and are in scope (see docs/DECISIONS.md).
  • Introspection stays pure. Code under src/Introspection/ must have zero knowledge of HTTP, Blade, or Mermaid. It only builds and returns a schema representation. The detailed layer rules live in .claude/rules/introspection.md, which loads automatically when you touch that layer or its tests.
  • Config is the single source of truth for excluded tables, route path, cache TTL, per-connection settings, diagram styling, focus depth, the large-schema warning threshold, the route middleware stack, and the default viewer allow-list (authorization.allowed_emails). Don't hardcode any of these. Authorization is a fixed viewTruss gate — the ability name is not configurable, and the gate callback is always the app's to override. The allow-list only feeds the default gate; it is not a renamable ability. The gate is consulted only in non-local environments (local is open), and a denial returns 404. See docs/DECISIONS.mdAuthorization: production-gated model.
  • Git commits: type: short subject (max 50 chars), then a body paragraph explaining what and why, not how. Never include "Generated with Claude Code" or "Co-Authored-By: Claude". Use a heredoc for multi-line commit messages.
  • Docs stay in sync. Any change to commands, config, or user-facing behavior must be reflected in README.md and docs/ in the same change. The public docs site is a separate repo, albertoarena/laravel-truss-docs (published at trussphp.com); it tracks this package and must be updated there too, but it reads from the latest package release, so its update lands when the next release ships and the docs site rebuilds.
  • Roadmap check on every release. A release is not done until the public roadmap reflects it. When a release ships, review src/data/roadmap.ts in the laravel-truss-docs repo and move whatever the release delivered into Shipped with its version. A partially delivered item is split: the shipped part moves to Shipped, the remainder stays in Approved next or Exploring (e.g. schema doctor Phase 1 shipped in v1.5.0 while the later phases stayed on the roadmap).

Read the full file on GitHub · 56 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. 11d ago First seen · 56 lines · 1,469 tokens per session scan A a05428e59880

Subscribe to this mod's changes

laravel-truss CLAUDE.md is an instructions file published in the GitHub repository albertoarena/laravel-truss (275 stars, last pushed today), licensed MIT. It adds 1,469 tokens to every session, about $0.0073 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.