topic-guard

by Douglas Cunha · ★ 4 · updated today

BandsStatus linePromptvalidates

0

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 here, or New session to clear the session and send it there.

install topic-guard

Install

/plugin marketplace add dougcunha/claude-mods
/plugin install topic-guard@claude-mods

Then run /reload-plugins or start a new session. Requires Claude Code 2.1.287+.

View source on GitHub

What it hooks into

From an automated scan with claude plugin validate, not a security review. Mods run with your permissions; read the code before installing.

Events
session.startprompt.submitui.render
API calls
$.clock.now$.clock.sleep$.command.run$.config.set$.env.get$.fs.read$.fs.write$.mcp.call$.model.complete$.prompt.fill$.prompt.read$.session.id$.session.messages$.session.usage$.state.get$.state.set$.tool.check$.tool.list$.ui.invalidate$.ui.resolve$.ui.status$.ui.toast
Draws
AbovePrompt
Can see
every prompt
Reach
level 3 of 3 MCP serverswrites fileschanges configdrives Claudewrites the prompt boxreads filesreads env varsreads the transcriptreads the prompt boxreads mod statedraws

Origin

How it got here
Automated scan of public GitHub repos, via the CC0 dataset awesome-claude-code-mods (scan of ).
Repository
github.com/dougcunha/claude-mods
Path in repo
topic-guard
Source commit
2e8ca05 the exact code the scan read
Author
Douglas Cunha @dougcunha
License
MIT
First published
Last pushed
First listed here

Name and description come from the mod's own manifest. We link to the code; we don't host it, and it stays under its author's license.

More from dougcunha/claude-mods

session-info

dougcunha/claude-mods

Session pane: context, cost and turns, the prompt cache with the time until it expires, keep warm and a guard that holds a prompt that would write an expired cache again, the last turn's tokens, cache, tools and refused calls, a task list Claude keeps with a switch that keeps Claude working while tasks remain open, an autopick switch that answers a question left unanswered with its recommended...

★ 4PanesBandsGuards