context-sensitive-cursor — Claude Code rule
context-sensitive-cursor — a rule for typewriter scenes where the caret takes its colour and height from whichever segment of the line is being typed.
AGPL-3.0 ★ 78,316 updated 2026-10-24
.claude/rules/context-sensitive-cursor.mdWhat context-sensitive-cursor does
This rule covers a scene with a typed line where the caret picks up the colour of the segment on screen. Every entry in the sequence holds a time, the visible text, a segment key and a hex colour. A GSAP driver looks up the entry for the current time inside onUpdate and repaints the caret block.
You get the scene markup, CSS with placeholders such as {monoFont} and {cursorGap}, a paused timeline and a few variations: no blink while characters are still being added, a taller caret on the brand segment, a contrast swap when the text renders dark. Blink runs off Math.sin instead of CSS @keyframes because keyframe animation drifts once the scene is seeked.
Use a monospace stack. A proportional face makes the caret slide away mid-segment. Keep the palette to 3-4 colours, or the shifts look random. The example loads [email protected] from a CDN, so the page needs that script before the timeline runs.
What it helps with
- colour the caret to match a brand accent mid-line
- keep blink in sync when the scene is seeked
- highlight a keyword by switching cursor colour
- lay out a terminal scene with a monospace caret on GSAP
- suppress blink while characters are still typing
Example prompts for the agent
- Make the caret switch to the brand accent while the brand name is being typed, then fade back to grey on the placeholder.
- Drive the blink with
Math.sinso seeking does not throw it off. - Add a
successsegment entry toSEQUENCEwith a green caret.
How to install context-sensitive-cursor
Manually: put the files in place
.claude/rules/context-sensitive-cursor.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/context-sensitive-cursor.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/context-sensitive-cursor.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/context-sensitive-cursor.mdManually: put the files in place
.clinerules/context-sensitive-cursor.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about context-sensitive-cursor
How do I install context-sensitive-cursor in Claude Code?
Place the rule file at .claude/rules/context-sensitive-cursor.md.
What does context-sensitive-cursor do?
It describes a typing animation where the caret takes colour and height from the active segment, with a sine-driven blink.
Does the scene need GSAP?
Yes. The example pulls [email protected] from a CDN and builds the timeline on it; without the script the driver never runs.