Every power user of large language models eventually hits the same wall: the repetitive vocabulary of the machine. You spend an hour crafting the perfect system prompt, instructing the AI to be concise, professional, and human-like, yet the output remains haunted by the same predictable linguistic tics. In the case of Claude, this often manifests as a stubborn insistence on phrases like honest takes or load-bearing seams. It is a specific kind of friction where the AI's intelligence is evident, but its personality feels like a loop, creating a cognitive fatigue that no amount of prompt tweaking seems to cure.

The Mechanics of the MessageDisplay Hook

To solve this, developers are moving away from the prompt and toward the interface. The solution lies in the MessageDisplay hook, a local interception tool that captures Claude's generated text immediately before it is rendered on the user's screen. Unlike prompt engineering, which asks the model to change its behavior, a hook acts as a filter. It allows the user to define a set of rules that automatically swap out unwanted AI-isms for preferred terminology in real-time. This process does not alter the model's weights or the underlying logic of the response; it simply cleans the output at the final stage of the pipeline.

Implementing this requires a specific local configuration. The user must navigate to their home directory and locate the `~/.claude/settings.json` file. Within this file, there is a hooks block designed to link the user interface with external scripts. By adding the appropriate reference to this block, the user creates a bridge that forces every outgoing message from the AI to pass through a custom script before it becomes visible. This architectural approach ensures that the filtering happens locally, giving the user total control over the final presentation of the text.

Shifting Control from Model to Machine

This method represents a fundamental shift in how we interact with LLMs. For years, the industry standard for controlling AI persona has been prompt engineering, but prompting is essentially a request that the model can choose to ignore or forget mid-conversation. By using a local hook, the user is no longer requesting a change; they are enforcing a rule. The tension here is between the model's trained patterns and the user's physical control over the UI. When a user replaces a phrase like honest takes through a script, they are effectively overriding the model's probabilistic output with a deterministic command.

To achieve this, the user must set up a specific script at `~/.claude/hooks/wordswap.sh`. This shell script contains the list of words to be replaced and their corresponding substitutes. Once the script is written and saved to that path, it must be granted execution permissions via the terminal. The required command is:

bash
chmod +x ~/.claude/hooks/wordswap.sh

This technical workaround, highlighted by developer Johanna Larsson via her Bluesky account (@jola.dev), bypasses the need for official patches or model updates. However, there is a critical technical constraint: because the hook is loaded at the start of the program, changes to the `wordswap.sh` script or the `settings.json` file do not apply to active conversations. To see the effects of a new word-swap rule, the user must terminate the current session and start a new one. This restart is the final step in flushing the AI's repetitive habits out of the interface.

By moving the point of control from the input prompt to the output display, the user regains agency over the AI's persona. The burden of linguistic variety is shifted from the model's training to a simple local script, turning a frustrating AI habit into a manageable configuration task.