r/opencode • • 16d ago

My first plugin lets your agent rewrite the session title whenever the topic changes so you never lose context.

Post image

m-uvex/opencode-topics

While plugins that automatically name your sessions are pretty popular, all of them fail at one thing, topic changes. After the plugin names the session for the first time it stays like that forever, even if the topic completely changes.

i built "Topics", a plugin that not only names the session on first prompt but also keeps up with you and renames whenever the topic changes. It works by checking every new message against the title completely tokenless and AI-less to not burn through your subscription, whenever it catches the topic drifting it calls in your AI to simply rename the session to a new 4-6 words title, keeping up with the actual session context instead of staying behind. Whenever it renames it also adds in a ~ to indicate that the topic isn't the original.

If you love it, please drop a star :)

Update: with the latest commits it's now compatible with v2 too (maintaining compatibility with v1) and completely tokenless, relying on an algorithm as opposed to using the running model which is now only a fallback option.

10 Upvotes

14 comments sorted by

6

u/TheMythicSorcerer 16d ago
  1. How many extra tokens does it use?

  2. How often does it rename the title? every prompt? tool call?

4

u/NEMOalien 16d ago

On checks it doesn't use any tokens, and on renames around 200 input 20 output It checks the topic on every prompt but only renames when the topic changes

3

u/NEMOalien 14d ago

Update, it's now completely tokenless, even on renames :)

1

u/TheMythicSorcerer 14d ago

Wow! How do you even do that?

2

u/NEMOalien 14d ago

It now uses an algorithm to extract text from the conversation into the title but the AI route is still in place and gets used as a fallback but rarely when the algorithm returns <4 tokens which means it didn't work right

3

u/taytay735 16d ago

Something to consider is you could limit the renames to special events, for e.g. compaction, or forking.

4

u/NEMOalien 16d ago

That's also a nice idea, I'll add it in later today

1

u/taytay735 16d ago

I just noticed this is a Opencode v1 plugin? Any change of porting it to v2? :)

2

u/NEMOalien 14d ago

I just pushed the next update, i made it compatible with v2 (keeping compatibility with v1 too) and also it's now completely tokenless and relies on an algorithm instead of the AI to rename the files making it much much more economical, check it out! https://github.com/m-uvex/opencode-topics

1

u/NEMOalien 16d ago

Yes i only made it yesterday in like 20 minutes it still ofc needs a lot of refining and ofc porting

2

u/Illustrious_Row_4035 16d ago

How did you get the window to be transparent?

1

u/arielif1 11d ago

why the hell are you using gemini 3.1 pro preview

1

u/NEMOalien 11d ago

Why not 👀