query-listener — Claude Code subagent: capture Power BI DAX
query-listener — a Claude Code subagent that hooks into the local Analysis Services instance and grabs the DAX a Power BI Desktop visual sends. Fire it off when you need to see the query behind a click.
GPL-3.0 ★ 1,104 updated 2026-10-28
.github/agents/query-listener.agent.mdWhat query-listener does
Under the hood the agent loads ADOMD.NET, reads the port of the running msmdsrv process from its command line, and opens a connection to that instance. It then polls DISCOVER_SESSIONS every 500 ms for up to 60 seconds, picking up sessions whose SESSION_LAST_COMMAND begins with DEFINE, EVALUATE or VAR. Duplicates are filtered out by the session timestamp.
Each captured query comes back with elapsed milliseconds, CPU time and the full DAX text. Once the run stops, the agent reports how many queries it caught, which one took longest, and any patterns worth a look — a missing filter context, an oversized TOPN, a pile of VAR blocks. Results land in a text file so they survive the agent finishing.
Its tool set is limited to Bash, Read and Write. ADOMD.NET has to be on the machine; the assembly is loaded from a local path, and without it the agent points you at the connect-pbid skill. Nothing shows up in the first 15 seconds more often than not, since slicers do not always fire a model query — click a regular visual instead.
What it helps with
- see the exact DAX a single visual sends
- time how long a visual's query takes
- trace down why a matrix or chart runs slow
- compare queries from several visuals side by side
- keep captured queries in a file for later reading
Example prompts for the agent
- Capture the DAX query my bar chart is sending
- Start listening for visual queries while I click around the report
- Grab the query and timing for my slow matrix
How to install query-listener
Manually: put the files in place
.github/agents/query-listener.agent.md1Plugin marketplace
/plugin marketplace add data-goblin/power-bi-agentic-development/plugin install pbi-desktop@power-bi-agentic-development2Manually: put the files in place
.claude/agents/query-listener.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention. Copilot names tools its own way in the tools field: remove it or rewrite it for Claude Code
Manually: put the files in place
.codex/agents/query-listener.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/query-listener.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about query-listener
How do I install query-listener in Claude Code?
Add the marketplace with /plugin marketplace add data-goblin/power-bi-agentic-development, then install the plugin: /plugin install pbi-desktop@power-bi-agentic-development. The subagent ends up at .claude/agents/query-listener.md.
What does query-listener do?
It connects to the local Analysis Services instance behind Power BI Desktop and captures DAX queries from visuals as they happen. Every query comes back with elapsed time and CPU time.
What does query-listener need to run?
ADOMD.NET installed — the connection to Analysis Services cannot be built without it. The assembly loads from a local path, and if it is missing the agent sends you to the connect-pbid skill.