Skip to content

Claude Code

Intent-lens spells out Claude Code calls before they run

5 min read

Written by an AI model from the linked sources and checked against them by a second model. How we work

All about: Claude Code versions and changes →
Image: emergent.sh

Intent-lens, a plugin from the claude-mods marketplace published on GitHub on November 2, writes a one-sentence summary of each Claude Code tool call above the prompt while the call is still pending, and turns that line red when a shell command looks destructive. In the default auto mode the line is built locally from the tool’s own arguments, and Claude is called only for edits, unknown tools, MCP tools and shell commands Claude didn’t describe; if you want no tokens spent and nothing sent over the network, local mode does exactly that.

The README on GitHub is written with auto mode in mind, where Claude Code moves faster than you can read. A find | xargs | awk pipeline tells you little at a glance, and once it runs it folds into a summary like “Ran 2 shell commands”. The band sits just above the prompt, where you are already looking. The full command stays in Claude Code’s own tool row.

Which engine to run

The local engine is a pure function of the tool name and arguments, with no I/O, no network and no latency. Auto, the default, draws that local line immediately and then has Claude rewrite it for the calls whose local version reads worst. The README puts that at a few hundred tokens per edit. Model mode does the same for every call, which adds up to 1.5 seconds of latency per call. You switch with /intent mode local, auto or model, and the choice persists.

The model in question is haiku. It gets the tool name, up to 900 characters of the arguments and the local draft, and it is asked for at most 12 words. Its answer is hard-capped at 110 characters, and each call costs at most 60 output tokens, plus the prompt. Intent-lens waits at most 1.5 seconds, and a failure, a refusal or a slow reply silently keeps the local line. The calls use your own Claude Code credentials and go through $.model.complete like any other request in the session. Headless runs (claude -p, the Agent SDK) draw nothing, so they spend nothing.

What the line actually says

For Bash, the line is mostly something Claude has already written. Claude Code’s Bash tool requires a description for each command, and intent-lens lifts that description out of the tool row. Pipelines of three or more stages get a second, dimmer line that decodes them stage by stage, for example 6 steps · fetch → extract values → sort → count repeats → sort by number → top 5. The mapping is literal (curl becomes fetch, uniq -c becomes count repeats). It is also quote-aware, so a pipe inside a jq program doesn’t start a new stage. /intent words terse switches to a shorter vocabulary.

Other tools get a compact rendering of their arguments. An Edit shows the file and the size change, such as 12 lines → 24 lines. MCP calls show server:tool, and a tool intent-lens doesn’t recognize shows its first two string arguments. The README adds a caveat about the model-written version: it is a hint about what Claude says it is doing, and the arguments are the ground truth.

What turns the line red

Risk detection always runs locally, and a destructive command is never sent to the model. The patterns cover recursive rm, git reset --hard, git clean -fd, force-pushes, DROP/TRUNCATE, mkfs/dd, fork bombs, curl … | sh, sudo, chmod -R 777 and package publishes. A match turns the marker red and raises a toast in every mode, even when the band is hidden with /intent off. The README calls it “a reminder, not a sandbox: it matches the text of the command.”

Blocking a call happens in another layer. The permission rules are enforced by Claude Code itself, and deny rules are checked before ask and allow rules, Anomity explains. A PreToolUse hook that exits with code 2 stops a call before any of those rules are evaluated. A red line from intent-lens has no effect on whether the call is allowed; that still depends on the deny rules and hooks you already have.

The band shows only the call in flight and clears the moment the call returns. With parallel calls, the newest one takes the line. Calls made by subagents are skipped, so the line always belongs to the main thread. /intent log keeps just the last 20 calls, each with its ✓ or ✗ outcome and the engine that described it. For a record that outlasts the session, Toolog writes every Claude Code tool call into a local SQLite file on macOS. The band sits above whatever other mods draw, and Ctrl+X Ctrl+A collapses it.

Installing it

Intent-lens is listed in the claude-mods marketplace rather than Anthropic’s official one, so you have to register that catalog first with /plugin marketplace add Dhananjay-JSR/claude-mods and then run /plugin install intent-lens@claude-mods. From a shell, or in non-interactive setups where /plugin isn’t available, the same steps are claude plugin marketplace add and claude plugin install. To load it for a single session without installing, point claude --plugin-dir at the plugin folder.

A plugin you install can run code on your machine with your user privileges, and a marketplace name only tells you who publishes the catalog, DEV Community notes. In intent-lens, the hooks, both engines and the risk rules all live in one file, hooks/register.js. Its 62 tests run in plain Node with no session, network or credentials. CI also runs claude plugin validate --strict on every push, and the license is MIT.

To check that it loaded, open /plugin and Tab to Installed, or run /intent, which shows the current state and usage.

No comments yet. Be the first.

Join the conversation

Sign in to leave a comment. It appears after moderation.