animation-derived-value — Claude Code rule: what it does
animation-derived-value is a Claude Code rule for computing one animated shared value from another. It applies to React Native Reanimated code that derives values.
AGPL-3.0 ★ 88 updated 2026-11-17
.claude/rules/animation-derived-value.mdWhat animation-derived-value does
The rule directs the agent to use useDerivedValue for a value calculated from another shared value. The hook follows the values used in its calculation and exposes the result for use elsewhere.
Reserve useAnimatedReaction for effects such as logging or calling runOnJS. It is not the rule’s choice for producing a derived value. The guidance concerns animations built with React Native Reanimated.
What it helps with
- calculate opacity from animation progress
- replace a reaction that computes a value with a derived value
- separate animated calculations from side effects
Example prompts for the agent
- Calculate opacity from animation progress with the appropriate Reanimated hook.
- Check whether
useAnimatedReactionis being used correctly to compute this value. - Rewrite this shared-value calculation as a derived value.
How to install animation-derived-value
Manually: put the files in place
.claude/rules/animation-derived-value.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/animation-derived-value.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/animation-derived-value.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/animation-derived-value.mdManually: put the files in place
.clinerules/animation-derived-value.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about animation-derived-value
How do I install animation-derived-value in Claude Code?
Add the rule file at .claude/rules/animation-derived-value.md.
What does animation-derived-value do?
It recommends useDerivedValue when one shared value is calculated from another. It reserves useAnimatedReaction for side effects.
When should I use useAnimatedReaction rather than useDerivedValue?
Use useDerivedValue for a value calculated from other values. useAnimatedReaction is for effects such as logging or calling runOnJS.