SDK v1.5.2
Highlights
Plugin improvements for Claude Code and Cowork: automatic environment setup via SessionStart hook, API key protection via .env read guard, and clearer plugin names in marketplace listings.
What's New
- CLI Plugin: SessionStart hook (
session-setup.sh) for Cowork bootstrap — installs xaffinity, sets PATH, loads API key from.env - CLI Plugin: PreToolUse/Read guard (
guard-env-read.sh) blocks reading.envfiles to prevent API key exposure in conversation - CLI Plugin: Query command reference (
references/query-guide.md) - MCP Plugin: Query language reference files (
references/filter-operators.md,quantifiers.md,include-expand.md,output-formats.md)
Changes
- Marketplace: Renamed plugins from generic "sdk"/"cli"/"mcp" to "Affinity CRM SDK (unofficial)", "Affinity CRM CLI (xaffinity, unofficial)", "Affinity CRM MCP (unofficial)" for clarity in plugin lists.
- CLI Plugin: Rewrote skill description following Anthropic skills guide formula
- MCP Plugin: Rewrote
query-languageSKILL.md (861→293 lines) with progressive disclosure; extracted detail toreferences/ - MCP Plugin: Updated
affinity-mcp-workflowsskill description following guide formula - SDK Plugin: Updated
affinity-python-sdkskill description following guide formula
Removed
- CLI Plugin: Removed
/affinity-helpcommand (redundant — CLI skill auto-triggers on relevant prompts)
Bug Fixes
- CLI Plugin:
.envparsing now handles quoted values and CRLF line endings - CLI Plugin: SessionStart hook writes to
CLAUDE_ENV_FILEare idempotent (no duplicate lines on re-run)
Quick Install
SDK only:
pip install affinity-sdkSDK + CLI:
pipx install "affinity-sdk[cli]"MCP Server for Claude Desktop (easiest - MCPB bundle):
- Install CLI:
pipx install "affinity-sdk[cli]" - (Optional) Pre-configure API key:
xaffinity config setup-key- If skipped, Claude Desktop will prompt for your API key during install
- Install xaffinity MCP in Claude Desktop (download and double-click)
Other MCP clients (Cursor, Windsurf, VS Code, etc.) require manual configuration - see MCP docs.