How to Test Slash Commands Locally Before Production Deployment in Claude Financial Services
You can test slash commands locally by installing vertical plugins via the Claude CLI, creating temporary sessions, and invoking command triggers like /comps or /tlh without pushing code to production.
The anthropics/financial-services repository defines slash commands as plain-text markdown files within a hierarchical plugin structure. Because these commands require no compilation or build step, you can validate their behavior immediately on your local machine by installing plugins into a development environment and exercising the triggers through temporary Claude sessions.
Understanding the Slash Command Architecture
Slash commands in this repository are not compiled executables but structured metadata that Claude interprets at runtime.
Where Commands Are Defined
Each vertical plugin stores its commands in plugins/vertical-plugins/<vertical>/commands/. For example, the tax-loss-harvesting command resides at plugins/vertical-plugins/wealth-management/commands/tlh.md, while comparative analysis commands live in the financial-analysis vertical. These markdown files contain descriptions and exact trigger strings (e.g., /comps, /dcf, /earnings) that Claude registers automatically when the plugin loads.
The Plugin Manifest Structure
Every vertical requires a manifest at .claude-plugin/plugin.json that registers the commands directory with Claude Cowork. The file plugins/vertical-plugins/wealth-management/.claude-plugin/plugin.json resolves the commands/ folder, while plugins/vertical-plugins/financial-analysis/.claude-plugin/plugin.json declares skills like comps-analysis and their associated triggers. The manifest also references an optional system.file entry that provides the system prompt context for command execution.
Setting Up Your Local Development Environment
Before testing commands, configure your machine to access the Claude development platform. You need the Claude CLI installed and a valid Anthropic API key with permissions to create sessions and install plugins from the marketplace.
Export your development credentials:
export ANTHROPIC_API_KEY=sk-ant-…
Add the financial-services marketplace entry once per development machine:
claude plugin marketplace add anthropics/claude-for-financial-services
Installing Vertical Plugins for Local Testing
Install the specific vertical containing the slash commands you want to validate. Most commands depend on the core financial-analysis skill bundle, which provides the underlying MCP connectors and data-fetching capabilities.
Install the core modeling skills:
claude plugin install financial-analysis@claude-for-financial-services
Then install the target vertical. For equity research commands like /comps:
claude plugin install equity-research@claude-for-financial-services
For wealth management commands like /tlh (tax-loss-harvesting):
claude plugin install wealth-management@claude-for-financial-services
Creating Temporary Claude Sessions and Testing Commands
With plugins installed, spawn an isolated session to exercise commands without affecting production data. The CLI provides the fastest feedback loop for iterative development.
Create a temporary session:
SESSION_ID=$(claude session create demo | jq -r .session_id)
Send a slash command directly in the session:
claude session chat $SESSION_ID "/comps AAPL MSFT GOOG"
The model invokes the comps-analysis skill, fetches data via the MCP connectors defined in financial-analysis/.mcp.json, and returns a formatted comparable-company analysis table. If the command fails, error messages typically indicate missing skills, unresolved system.file references, or malformed manifest entries.
Validating Configurations with Dry-Run Scripts
Before installing plugins or deploying to production, verify that your manifest resolves correctly. The repository ships a validation script that checks the entire pipeline without making live API calls.
Run the linting script from the repository root:
scripts/test-cookbooks.sh
This script exits with status 0 only if all manifests are valid. Internally, it calls scripts/deploy-managed-agent.sh <slug> --dry-run, which resolves all system.file, skills, and callable_agents references. Because slash commands populate the manifest's commands section, a successful dry-run guarantees that registration will succeed during actual deployment.
Python API Alternative for Automated Testing
For programmatic validation or CI/CD pipelines, use the Anthropic Python SDK to test commands without interactive CLI sessions.
import anthropic
import os
client = anthropic.Anthropic(api_key=os.environ["ANTHROPIC_API_KEY"])
session = client.beta.sessions.create(
model="claude-3-5-sonnet-20240620",
system="You are a financial-analysis assistant."
)
response = client.beta.sessions.messages.create(
session_id=session.id,
messages=[{"role": "user", "content": "/comps AAPL MSFT"}]
)
print(response.content[0].text)
This approach treats slash commands as plain text inputs, allowing automated assertions against the structured output formats expected from commands like /dcf or /earnings.
Summary
- Slash commands are markdown files in
plugins/vertical-plugins/<vertical>/commands/requiring no build step. - Install vertical plugins locally using
claude plugin install <vertical>@claude-for-financial-servicesto enable command triggers. - Create temporary sessions with
claude session createand test commands viaclaude session chat. - Run
scripts/test-cookbooks.shto dry-run manifest validation before deployment. - Use the Anthropic Python SDK for automated testing in continuous integration environments.
Frequently Asked Questions
Do I need to compile code to test slash commands locally?
No compilation is required. Slash commands are pure markdown definitions parsed at runtime. You only need to ensure the plugin.json manifest and optional system.file entries are correctly resolved, which the repository's helper scripts verify automatically.
What files define the slash command triggers?
Each command trigger is defined in a markdown file within the vertical's commands/ directory. For example, /tlh is defined in plugins/vertical-plugins/wealth-management/commands/tlh.md. The manifest at .claude-plugin/plugin.json registers these files with the Claude platform.
How do I verify my plugin manifest is valid before deployment?
Execute scripts/test-cookbooks.sh from the repository root. This script runs deploy-managed-agent.sh with --dry-run to resolve all references and validate JSON syntax. A successful exit code indicates that slash-command registration data is well-formed and ready for production deployment.
Can I test commands without using the Claude CLI?
Yes. Use the Anthropic Python SDK to create sessions programmatically and send slash commands as message content. This method is ideal for automated testing in CI/CD pipelines where interactive CLI tooling is unavailable.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →