Skip to main content

Quick Overview

This video is a feature demonstration and tutorial presented by developer Lydia Hallie for Claude Code. It introduces the newly added modding system and explains how developers can build plugins to customize the application's interface and runtime behavior.

Key Points

  • 1.Mods in Claude Code allow developers to alter the internal behavior, user interface, tool calls, and prompt processing of the application.
  • 2.A mod functions as a standard plugin configured through hooks.json with a modules field pointing to a TypeScript file.
  • 3.Mod functions operate like middleware by receiving a Claude Code interface object, an event object, and a next callback.
  • 4.Changes made to rendered output in UI events alter only what is displayed on screen, leaving underlying text intact for Claude Code model operations.
  • 5.Mods can be loaded via the plugin directory command line flag or defined in settings.json with live file watching enabled.
  • 6.Mods can be packaged and distributed through marketplace repositories and installed using standard plugin commands.

Summary

Claude Code includes a modding system that allows developers to customize how the application functions, what it renders, and how it handles internal operations. Mods can modify prompt payloads, intercept tool calls, add custom commands, and render custom user interface components.

Three concrete examples demonstrate the scope of what mods can achieve. The first is a context bar rendered above the terminal input that provides a live visual breakdown of token allocation across system prompts, tools, Model Context Protocol tools, agents, skills, and memory files. The second is an agents panel that lists all declared agents in a project sidebar, enabling users to run any agent with a single click. The third is an email masking tool designed for screen recording, which redacts email addresses appearing in output until a user hovers over them.

Architecturally, a mod is a Claude Code plugin with a plugin.json file and a hooks.json configuration file. The hooks.json file includes a modules key that specifies a TypeScript file, such as register.tsx, containing the mod logic. Within this script, developers register handlers against dozens of internal Claude Code lifecycle events, including ui.render, prompt.submit, session.start, engine.create, and tool execution checks.

Every event handler receives three parameters: a dollar sign helper object, an event payload, and a next function. The dollar sign helper provides access to core Claude Code operations such as rendering UI components, issuing model queries, and reading files. The event payload delivers the incoming data for that specific lifecycle stage, which can be modified before being passed forward. The next function works as a standard middleware callback. If the mod invokes next, Claude Code proceeds with the modified or original data. If the mod returns a custom component or value without calling next, it handles the event entirely and bypasses the default behavior.

Mods run inside an isolated sandbox and only interact with the application through the provided event parameters and helpers. For instance, modifying rendered text in a ui.render handler alters only the display presentation on screen, ensuring the underlying language model continues to receive unmodified text during subsequent tool runs or message generation.

To run mods in the terminal, users start Claude Code with the plugin directory flag pointing to the mod folder. In desktop applications, the folder path can be configured within the settings.json file using environment variables alongside a watcher flag that reloads mods automatically on file save. Mods can also be registered in a marketplace manifest and installed across environments with the plugin install command.

Introduction to Claude Code Mods

Claude Code mods are extensions that directly alter how the tool operates, including user interface rendering, prompt construction, tool execution, and custom commands. Demonstrated examples include a real-time context window usage bar displayed above the prompt, a sidebar listing all defined project agents for one-click launching, and a privacy mod that redacts email addresses on screen until hovered over.

Mod Structure and Middleware Mechanics

A mod is structured as a plugin containing a plugin.json manifest and a hooks.json file pointing to a TypeScript registration module. The module registers handler functions for internal events such as ui.render, prompt.submit, or session.start. Every handler receives three arguments: a dollar sign object for invoking Claude Code capabilities, an event object containing current execution data, and a next function that controls whether execution continues down the standard pipeline or returns custom UI elements directly.

Configuration, Live Reloading, and Distribution

Users can launch Claude Code with mods using the plugin directory flag in the terminal or by setting plugin directory environment variables inside settings.json for desktop environments. Mod directories support active file watching, triggering automatic live reloads whenever a script is saved. Because mods follow the standard plugin specification, they can be cataloged in a marketplace repository and installed using the plugin install command.

The Bottom Line

The video demonstrates how to extend and customize Claude Code using its native TypeScript modding architecture. It establishes the middleware-style event execution model, custom UI rendering capabilities, and methods for local loading and marketplace distribution. The presentation focuses on UI modifications and event hooks, leaving advanced multi-plugin conflict resolution and complex state persistence patterns unaddressed.

FAQ

What is Claude Code and what are Claude Code mods?

Claude Code is an AI coding tool, and Claude Code mods are plugins written in TypeScript that intercept internal events to customize its interface, tool execution, and prompt handling.

How does the middleware architecture work in Claude Code mods?

Mod functions receive a helper object, an event object, and a next callback. Calling next passes data along the default execution chain, while returning a custom response bypasses default handling.

What internal events can developers hook into within Claude Code?

Developers can register hooks for events such as ui.render, ui.press, prompt.submit, session.start, engine.create, and tool execution permission checks.

How do developers load and test mods in Claude Code?

Mods can be loaded via the --plugin-dir command line flag or configured in settings.json using CLAUDE_CODE_PLUGIN_DIRS with file watching enabled for automatic reloads.

Does modifying rendered UI text in a mod alter model inputs?

No. Rendering hooks only change what is shown visually on screen, while Claude Code and the underlying model continue to access the original unmasked data.

Worth watching for

Software developers and engineers using Claude Code who want to customize its user interface, inspect internal context usage, or build automated workflows.

  • claude-code
  • developer-tools
  • plugins
  • typescript
  • terminal-ui
  • middleware