SDK v1.7.2
Highlights
The xaffinity CLI plugin's SessionStart hook no longer runs pip install on every container start. Installation is deferred to first actual use via a self-installing wrapper, cutting session startup from ~30s to <1s in ephemeral environments like Cowork. Skill descriptions now display correctly in the Claude Code UI. Also documents two Affinity API limitations discovered via support: interaction entity association and enriched field constraints.
Documentation
- Data model: documented interaction entity association limitation and enriched field constraints (Current Organization, Current Job Title)
CLI Plugin 1.6.0
Added
- Lazy install: SessionStart hook now drops a lightweight self-installing wrapper instead of running
pip installunconditionally. The wrapper defers installation to first actual xaffinity use, with mkdir-based locking for concurrent safety, a marker file for install failure detection, and a 45s wait timeout for concurrent invocations. - PreToolUse hook: Install-failure detection via
$HOME/.xaffinity-install-statusmarker — blocks commands with a clear error when pip install failed, instead of cryptic failures. - PreToolUse hook: Lazy session cache start —
xaffinity session startis triggered on first xaffinity command instead of at session start, withCLAUDE_ENV_FILEpersistence.
Changed
- SessionStart timeout reduced from 60s to 10s (hook is now lightweight)
- PreToolUse Bash timeout increased from 10s to 60s (accommodates pip install via wrapper on first use)
- SessionStart status message updated to "Preparing Affinity CLI environment..."
Fixed
- Skill YAML frontmatter: replaced multi-line
>scalar with single-line description (Claude Code couldn't parse folded scalars, showing>instead of the description) - Skill: updated session cache documentation to reflect lazy initialization
Documentation
- Skill: documented that interactions cannot be associated with companies/opportunities via API (UI's "Also add to" feature has no API equivalent)
- Skill: documented that "Current Organization" is read-only via API and "Current Job Title" requires a separate
field updateafter person creation
SDK Plugin 1.5.5
Fixed
- Skill YAML frontmatter: replaced multi-line
>scalar with single-line description (same parsing fix as CLI plugin)
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.