Implements identity mapping to allow linking WhatsApp, Telegram, and Twilio
identities for shared Claude conversation sessions across providers.
Core Features:
- Identity mapping storage in ~/.clawdis/identity-map.json
- Session ID normalization for unified sessions
- CLI commands for managing identity mappings
- Full backwards compatibility (opt-in feature)
New Identity Module (src/identity/):
- types.ts: Type definitions for identity mappings
- storage.ts: CRUD operations for identity persistence
- normalize.ts: Session ID normalization logic
- Comprehensive test coverage (29 tests passing)
CLI Commands (src/commands/identity.ts):
- identity link: Link multiple provider identities
- identity list: Show all identity mappings
- identity show: Display specific mapping details
- identity unlink: Remove identity mapping
- Input validation for E.164 phone numbers and Telegram usernames
- JSON output support for list/show commands
Session Integration:
- Made deriveSessionKey() async to support identity lookups
- Updated all callers: auto-reply, agent command, web provider
- Group conversations excluded from identity mapping
- Provider detection based on ID format
Documentation:
- docs/session-sharing.md: Comprehensive user documentation
- Architecture overview and use cases
- CLI usage examples and troubleshooting guide
Test Coverage:
- src/identity/normalize.test.ts: 11 tests for normalization
- src/identity/storage.test.ts: 18 tests for storage operations
- 100% coverage of identity module functionality
Files Changed:
- 10 new files (identity module, CLI, docs, tests)
- 5 modified files (sessions, CLI integration, auto-reply)
Build Status:
- All tests passing (29/29)
- Zero TypeScript errors
- Ready for production use
- Added Twitter automation patterns using Peekaboo + AppleScript
- Documented JS injection for reliable button clicks on Twitter's dynamic UI
- Added audd.io music recognition API example
- These are the techniques Clawd uses to reply to tweets autonomously
- Added browser-tools to CLI tools table (lightweight DevTools CLI)
- Added browser-tools usage section for web scraping
- Added "See It In Action" section with 3 example tweets
- Links to agent-scripts repo
- Wrap Baileys connection.update listeners in try-catch to prevent
unhandled exceptions from crashing the relay process
- Add WebSocket-level error handlers in session.ts
- Add global unhandledRejection/uncaughtException handlers in index.ts
- Make listener.onClose error-safe with .catch() in auto-reply.ts
- Change default heartbeat from 30min to 10min
- Rewrite claude-config.md with personality, better explain personal
assistant features, add recommended MCPs section