Skip to content

v0.7.0 — Lean Hook: pay tokens only when there's signal

Latest

Choose a tag to compare

@mertcanaltin mertcanaltin released this 03 May 16:23
· 53 commits to master since this release

TL;DR

A controlled A/B token test on the ada URL parser (Cursor, identical prompt) measured the cost of the v0.6.x integration:

Run A (Composto on) Run B (Composto off) Delta
Tokens 175.6K 118.1K +57.5K (~49%)

That delta was unacceptable. v0.7.0 inverts the contract: pay tokens only when there's something worth saying.

What changed

v0.6.x v0.7.0 (default)
.cursor/rules/composto.mdc (1940 chars, alwaysApply) written not written (--with-rules opt-in)
MCP server registration (5 tool schemas) written not written (--with-mcp opt-in)
Tool description total 1359 chars 313 chars (-77%)
Per-conversation static cost ~800–1000 tokens ~0 tokens

New CLI flags

composto init --client=cursor                    # hook-only (default)
composto init --client=cursor --with-mcp         # add 5 MCP tools
composto init --client=cursor --with-rules       # add the .mdc rules file (cursor only)
composto init --client=cursor --with-mcp --with-rules   # full v0.6.x behavior

Cursor medium-verdict surface trade-off

Medium-verdict files now pass through silently on Cursor (same as low/unknown). The signal is still recorded in .composto/memory.db and queryable via composto stats and composto impact <file>. To get medium signals back into the chat, opt into MCP with --with-mcp and the agent can call composto_blastradius directly. high still denies. Claude Code and Gemini CLI continue to surface medium via additionalContext (silent injection), where the platform supports it.

Migration

Drop-in for existing v0.6.x users:

npm i -g composto-ai@0.7.0
composto init --client=cursor   # picks up the lean default

Re-running composto init does not strip already-registered MCP entries or rules files (the merge path keeps them). To match the new defaults exactly, manually remove .cursor/rules/composto.mdc and the composto entry from .cursor/mcp.json.

Internals

  • src/cli/init.ts: withMcp / withRules options on InitOptions, all three platforms gated
  • src/index.ts: --with-mcp / --with-rules flag parsing + updated help text
  • src/cli/hook/adapters/cursor.ts: docs updated for new architecture (no behavior change — high still denies, others pass through silently)
  • src/mcp/server.ts: all 5 tool descriptions trimmed to ≤80 chars
  • tests/mcp/tool-description-budget.test.ts (new): per-tool ≤80 char and total ≤500 char budget snapshot
  • 14 new tests across tests/init.test.ts and tests/cli/init-hooks.test.ts

Compatibility

  • Hook-only default works on Cursor, Claude Code, and Gemini CLI
  • Existing MCP entries on user's settings.json/mcp.json are preserved on re-init (idempotent merge)
  • Hook adapter signatures, telemetry schema, and composto stats are unchanged

Full Changelog: v0.6.1...v0.7.0