[FEATURE] Add YAML Frontmatter Flag to Enforce No-Read for items in scripts folder.
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Skills support a scripts/ folder for executables intended for execution without loading contents into context (e.g., for token efficiency and determinism). However, this is not enforced—Claude may still read script contents for patching or adjustments, causing context clutter, token waste, and potential security risks.
Example Illustration
In Anthropic’s webapp-testing, scripts are annotated with “DO NOT read the source until you try running the script first” but this relies on advisory guidelines. Users must explicitly instruct avoidance in markdown, which is not a hard control and can be overlooked or ignored.
Proposed Solution
Introduce a YAML frontmatter flag, e.g.:
---
name: my-skill
description: skill-description
no_read_scripts:
- scripts/script.sh
- scripts/somebinary
---
When enabled:
- Prevent Claude from reading or loading the contents from scripts/<script_name> into context.
- Allow only direct execution to capture output.
Benefits
- Enforces hard preventive control, eliminating need for manual instructions in SKILL.md.
- Reduces context pollution and token usage for large/complex scripts or binaries.
- Enhances security by avoiding unnecessary exposure of script internals.
Downsides
- Limits Claude’s ability to patch or adjust scripts during execution. However, this is a trade-off that can be managed by users based on their specific needs and security considerations.
Alternative Solutions
Currently people work around this by writing specific instructions within the SKILL.md markdown section.
These instructions clutter context and does not allow Claude Code to enforce the rule.
Priority
Medium - Would be very helpful
Feature Category
Developer tools/SDK
Use Case Example
Running tools/skills that frequently used and are robust and well tested. Examples are:
- Unit tests
- Compilation steps
- Formatters
- Benchmarks
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗