What is topic-guard?
topic-guard is a Claude Code mod by dougcunha that before a prompt enters the session, a small model judges whether it belongs to the session's topic. When it starts a separate topic, the mod holds it in the prompt box: press Enter to keep. It is listed under Security and has 4 GitHub stars.
| Type | Claude code mod |
|---|---|
| Author | dougcunha |
| Repository | dougcunha/claude-mods |
| Popularity | 4 GitHub stars |
| Category | Security |
| Security | High risk (44/100) |
| Rank | #1,517 of 9,397 Claude Code mods; #183 in Security |
| License | MIT |
| Last commit | 2026-11-23 |
| Hooks | 3 events |
| Sees | every prompt |
| Draws on | AbovePrompt |
Is topic-guard safe to install?
topic-guard scores 44/100 on the MCPMods security check: High risk. Things to review: sends data over the network; writes files or config; reads environment variables; watches every prompt or event. It passed 2 of 8 checks.
Mod footprints come from claude plugin validate, which lists every event a mod hooks and every API call it makes without running it.
| Check | Result |
|---|---|
| Sends data over the network | Review |
| Starts no processes | Pass |
| Writes files or config | Review |
| Reads environment variables | Review |
| Watches every prompt or event | Review |
| Drives Claude (model calls, prompts) | Note |
| Validator reported problems | Note |
| Has an open-source license | Pass |
API calls in its code
| Call | What it means |
|---|---|
$.clock.now | |
$.clock.sleep | |
$.command.run | drives Claude |
$.config.set | changes config |
$.env.get | reads env vars |
$.fs.read | reads files |
$.fs.write | writes files |
$.mcp.call | calls MCP servers |
$.model.complete | drives Claude |
$.prompt.fill | writes the prompt box |
$.prompt.read | |
$.session.id | |
$.session.messages | reads the transcript |
$.session.usage | |
$.state.get | |
$.state.set | |
$.tool.check | |
$.tool.list | |
$.ui.invalidate | draws interface |
$.ui.resolve | draws interface |
$.ui.status | draws interface |
$.ui.toast | draws interface |
How do I install topic-guard?
- Check your Claude Code version. Mods need Claude Code 2.1.287 or later and are on by default.
claude --version
- Read its footprint. This lists every event it hooks and every API call it makes, without running it.
git clone https://github.com/dougcunha/claude-mods claude plugin validate ./claude-mods/topic-guard
- Install it. Run this in your terminal, then /reload-plugins in an open session.
claude plugin marketplace add dougcunha/claude-mods && claude plugin install topic-guard@claude-mods
Or ask Claude to set it up
Paste this into Claude Code and it installs topic-guard for you:
Install the "topic-guard" Claude Code mod from https://github.com/dougcunha/claude-mods/tree/main/topic-guard. Run claude plugin validate on it first and show me what it can access before you enable it.
More from dougcunha/claude-mods
This repository has 5 Claude Code mods on MCPMods.
- feature-progress: A tool any spec-driven flow calls to report the progress of a feature and its tasks; a band above the prompt shows the s (Review before installing)
- session-cleanup: The /cleanup command lists the temporary files the session created and the Git items it left (uncommitted changes, chang (Review before installing)
- session-info: Session pane: context, cost and turns, the prompt cache with the time until it expires, keep warm and a guard that holds (High risk)
- visual-review: The /visual-review command shows the design of the changes against a base branch as a diagram in the browser: classes an (Review before installing)