Getting started with Claude Code mods: building a context-window forecast
Claude Code mods are small JavaScript or TypeScript files that run inside a session as hooks shipped in plugins, and can observe events, rewrite behavior or draw custom UI in the terminal or desktop app. The guide builds Token Weather, an roughly 80-line mod that reads $.session.usage() after each turn and draws a weather-style context-window band above the prompt, then tours Blast Radius, which holds risky Bash commands, and Replay Theater, which steps through a turn's edits. Mods require Claude Code 2.1.287 or later and are on by default; finished code for all three is in anthropics/claude-code-playground.
Why it matters: A hands-on walkthrough of Claude Code mods that builds a working context-window meter in about 80 lines, showing how hooks, state and custom UI fit together.