Score-CAM: Instructions file for Claude Code

CLAUDE.md

Score-CAM CLAUDE.md is an instructions file for Claude Code from tabayashi0117/Score-CAM. It costs 1,091 tokens per session, scanned A, original, MIT.

A project guide for a readable Keras implementation of Score-CAM and Faster-Score-CAM, methods that show which parts of an image influenced a neural-network prediction.

In plain words
What is it for?
Use it when modifying the Score-CAM implementation, its tests, demonstration notebook, or generated result figures.
Why use it?
It keeps the implementation clear and faithful to the accompanying paper and prevents algorithm code, compatibility logic, and tests from drifting apart.

Instructions file for Claude Code

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

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

Reuse

Borrowing it

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

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 Score-CAM CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/tabayashi0117/score-cam/claude-md"><img src="https://agentmods.dev/badge/instructions/tabayashi0117/score-cam/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,091 This file is loaded in full into every session.
When invoked 1,091 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.01091 $0.01091
Opus 5.5 $0.00436 $0.00436
Sonnet 5.5 $0.00218 $0.00218
Haiku 4.5 $0.00109 $0.00109

Measured 2mo ago against content hash a95ab099d2cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

Score-CAM 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.

CLAUDE.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 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 this repository is

A readable reference implementation of Score-CAM (and Faster-Score-CAM) in Keras, accompanying a Qiita article.

It is not a general-purpose saliency library. Maintained alternatives for that are tf-keras-vis and pytorch-grad-cam. Optimise this repo for clarity and correctness, not for feature coverage. When in doubt, prefer the simpler, more legible implementation.

Layout

Path Role
scorecam/ The implementation. Single source of truth.
gradcamutils.py Backwards-compatible shim re-exporting scorecam. The article and older forks import this name — do not delete or add logic here.
tests/ pytest suite. Runs on CPU with a tiny randomly-initialised model; no downloads, no ImageNet weights.
scripts/regenerate_results.py Rebuilds the VGG16 figures in result/.
Score-CAM.ipynb Demo notebook.
image/, result/ Inputs and rendered outputs used by the README.

Non-negotiable rules

  1. No algorithm logic in the notebook. The notebook imports from scorecam and displays results. If you find yourself pasting a function body into a cell, put it in scorecam/ and import it instead.
  2. Notebook outputs are stripped on commit. Install the git filter once with uv run nbstripout --install; CI fails the build otherwise. Figures shown in the README live in result/ as PNGs, regenerated by scripts/regenerate_results.py. Never commit a notebook whose diff is megabytes of base64 — that is what made this one 7.2 MB and unreviewable.
  3. Eager only. Never call tf.compat.v1.disable_eager_execution(). Never use tf.gradients, keras.backend.function, or tf.compat.v1.*. Gradients come from tf.GradientTape; custom gradients from @tf.custom_gradient.
  4. No private APIs. tensorflow.python.* and anything with a leading underscore is off limits — that is what broke this repo for five years.
  5. Do not add dependencies. TensorFlow, NumPy, Pillow and Matplotlib cover everything here. Resize with tf.image.resize (scorecam._common.resize_2d), load images with keras.utils.load_img, colour with matplotlib.colormaps. OpenCV was removed in v0.2: 120 MB of wheel for four function calls, all of which the existing dependencies already did — tf.image.resize agrees with cv2.resize to float32 rounding error. A test asserts cv2 never gets imported.
  6. Every CAM function returns a 2-D float32 numpy array with the spatial shape of the target layer, values scaled to [0, 1], no NaN/Inf. tests/test_cam.py enforces this; keep it that way.

Read the full file on GitHub · 85 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. 2mo ago First seen · 85 lines · 1,091 tokens per session scan A a95ab099d2cc

Subscribe to this mod's changes

Score-CAM CLAUDE.md is an instructions file published in the GitHub repository tabayashi0117/Score-CAM (58 stars, last pushed 5d ago), licensed MIT. It adds 1,091 tokens to every session, about $0.0044 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.

Related

Score-CAM CLAUDE.md compared with instructions from other repositories

Score-CAM CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
Score-CAM CLAUDE.mdtabayashi0117/Score-CAMInstructions file585d agoMITA1,091Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode