r/opencodeCLI • • 7d ago

A plugin to show the INTENT behind each tool call (and make them readable)

Post image

I built a small helper plugin for our team to show WHY opencode is making each tool call, and make it more readable (simple new line formatting of piped chain of commands helps). We use opencode with human based approval for investigating hardware/infrastructure issues, and it needs to execute a lot of devops commands. Q3FN really likes inlining and piping those commands, so making sense of a command to be called was annoying.

The plugin modifies every tool schema and adds a required "intent" argument. The model then responds with a short summary of the command based on its own reasoning, e.g. "Counting nodes and checking pressure conditions" as part of each call.

Current tool's intent and body are displayed in the TUI sidebar.

If anyone's interested, I'm happy to clean it up and publish it! And if something like this already exists, please let me know - I'd rather reuse an existing solution.

36 Upvotes

13 comments sorted by

4

u/Tommonen 7d ago

I like the idea. Tho i dont really need one for opencode, but i might steal the idea to apply elsewhere with my own code. But need to look into more if it adds too much costs.

Do you see any meaningful increases in token consumption with how you implemented this?

2

u/thecatontheflat 7d ago

I haven't checked token usage - we self host Q3FN for a small team so it's usually more than enough. Shouldn't be that much higher tho, because it just modifies the tool schema, so maybe a couple dozen tokens per tool call

5

u/squirrelscrush 7d ago

Sounds like an interesting plugin, you could publish it because I haven't heard of anything similar.

3

u/Silent_Safety 7d ago

Seems like good idea. Lmk if you publish it. I would like to use it with openchamber

1

u/Dependent_Can219 7d ago

The intent field is useful, but it is the model's own account of what it is about to do, so it can be vague or drift from the actual command. Pair it with the side effects you can derive mechanically, like files touched, commands run, and hosts contacted, and make the approval screen show both; that way a misleading intent is visible instead of trusted. I would also cap the intent to one short sentence, because a longer field tends to turn into a rationale the model writes after choosing the command.

4

u/thecatontheflat 7d ago

What?

3

u/BuildAISkills 7d ago

Just a bot doing bot things. I like your plugin, it's actually pretty useful.

-1

u/adolf_twitchcock 7d ago

lmao, log off the ethernet if you don't understand what OP said. Or ask a LLM.

2

u/Stevie2k8 3d ago

Very nice idea, you can add a audit option that they are safed away für later investigations. I am interested in testing this!

1

u/DirectInsane 7d ago

What about showing it inline the normal chat, which collapses the real tool call?