intercepting-commands

Community

Intercept commands to customize VS behavior.

Authormadskristensen
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Intercept existing Visual Studio commands to run custom logic before, after, or instead of the default handler. Use when you need to cancel, replace, or augment command behavior such as Save or Build, or to react to command execution across different extension approaches.

Core Features & Use Cases

  • VisualStudio.Extensibility: the out-of-process model does not support command interception; consider event-based approaches like IDocumentEventsListener for related scenarios.
  • VSIX Community Toolkit: use VS.Commands.InterceptAsync to attach before/after handlers to known commands.
  • VSSDK: implement IOleCommandTarget and register via IVsRegisterPriorityCommandTarget for in-process interception; for after-execution logic, hook into DTE.CommandEvents.AfterExecute or use post-exec patterns.

Quick Start

Initialize the interception in the extension package and test with a sample command to verify before/after behavior.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: intercepting-commands
Download link: https://github.com/madskristensen/vs-agent-plugins/archive/main.zip#intercepting-commands

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.