Borrowing it
Nothing to install: this file belongs to rootstrap/rails_api_base. 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/rootstrap/rails_api_base/main/CLAUDE.mdgit clone --depth 1 https://github.com/rootstrap/rails_api_baseWrote 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/rootstrap/rails_api_base/claude-md)<a href="https://agentmods.dev/instructions/rootstrap/rails_api_base/claude-md"><img src="https://agentmods.dev/badge/instructions/rootstrap/rails_api_base/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/rootstrap/rails_api_base/claude-md"><img src="https://agentmods.dev/badge/instructions/rootstrap/rails_api_base/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.02081 | $0.02081 |
| Opus 5.5 | $0.00832 | $0.00832 |
| Sonnet 5.5 | $0.00416 | $0.00416 |
| Haiku 4.5 | $0.00208 | $0.00208 |
Grade A, and why
rails_api_base 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 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.
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 — 108 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 repo is
Rootstrap's Rails API template — a Rails 8.1 / Ruby 4.0 boilerplate for JSON APIs. It is meant to be cloned and renamed via bin/bootstrap.sh --name=<project>, which seds rails_api_base to your project name across the codebase. The template ships with two parallel surfaces:
- A JSON API under
/api/v1/*(devise_token_auth, Pundit, Jbuilder, OpenAPI docs). - An admin web surface built on ActiveAdmin at
/admin/*, with sub-mounts for Flipper (/admin/feature-flags) and GoodJob (/admin/background-jobs).
Common commands
The bin/* wrappers transparently dispatch to Docker (docker compose) when DOCKER_ENABLED=true in .env, otherwise run locally. Use them rather than calling bundle/rails/rspec directly so the same invocation works in both modes.
bin/dev— start Rails + JS/CSS bundling watchers (foreman /Procfile.dev). Defaults to port 3000.bin/rspec [path]— run specs.bin/rspec .runs everything.bin/rspec spec/path/to_spec.rb:42runs a single example. Pass-rm/--remove-containersto tear down docker test services after the run.bin/rails …— any Rails command (bin/rails console,bin/rails db:migrate, …).bin/bundle …— bundler commands.bin/web <cmd>— arbitrary shell command inside the app container/environment.bundle exec rails code:analysis— runs the full lint suite: Brakeman, RuboCop, Reek, rails_best_practices, i18n-tasks (seelib/tasks/code_analysis.rake). Use this before opening a PR.bundle exec annotaterb models— refresh schema annotations on models (config in.annotaterb.yml).yarn build:js --watch/yarn build:css --watch— JS/CSS bundling for ActiveAdmin assets (already wired intobin/dev).
Testing notes
- Specs require a running Postgres (see
docker-compose.yml/docker-compose.test.yml)..env.testprovides test DB config. bin/rspecheaded by default; setHEADLESS=truefor headless feature specs.spec/rails_helper.rbwires several behaviors that affect how to write specs:- Prosopite scans every example for N+1 queries — fix the query, don't silence it.
- rspec-retry retries failed examples (2x in CI via
ENV['CI'], 1x locally). Don't paper over flakes by adding retries. - SimpleCov is started before Rails loads; coverage lands in
coverage/. - Flipper resets to a memory adapter before each test, so feature-flag state is per-example. Enable in a
beforeblock. - Files under
spec/forms/are auto-taggedtype: :formand get Shoulda matchers. - Files under
spec/requests/api/are picked up byrspec-openapifor API doc generation; other request specs are taggedopenapi: false.
- OpenAPI doc generation is triggered by
OPENAPI=1(CI only onmain/ changes tospec/requests/api/**). Docs are served at/api-docs(basic auth:SWAGGER_USERNAME/SWAGGER_PASSWORD).
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 · 108 lines · 2,081 tokens per session scan A f62052b3efd0
rails_api_base CLAUDE.md is an instructions file published in the GitHub repository rootstrap/rails_api_base (634 stars, last pushed 2d ago), licensed MIT. It adds 2,081 tokens to every session, about $0.0083 per session on Opus 5.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.
rails_api_base CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| rails_api_base CLAUDE.mdrootstrap/rails_api_base | Instructions file | 634 | 2d ago | MIT | A | 2,081 | Claude Code |
| graftcode graftcode-ruby.instructions.mdgrft-dev/graftcode | Instructions file | 967 | 1mo ago | none | A | 4,609 | GitHub Copilot |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | 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 |