Phase 7 complete: Advanced session analysis capabilities
New MCP Tools (3):
1. session_semantic_search - Vector similarity search across all sessions
2. session_productivity_analytics - Metrics (avg duration, tasks, commits, tokens)
3. session_pattern_detection - Detect patterns (tool usage, task types)
Features:
- Semantic search with embedding-based similarity
- Fallback to ILIKE text search if embeddings unavailable
- Analytics over configurable time periods (week/month/quarter)
- Pattern detection with frequency analysis
Use Cases:
- Find similar past work: "sessions about WhatsApp integration"
- Track productivity: avg commits/tasks per session
- Identify tool usage patterns: which tools used most often
- Analyze task type distribution
All 7 phases complete! System ready for testing.
Related: CF-257
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implemented 8 new session management tools:
- session_start: Initialize session with metadata tracking
- session_update: Update session metrics during execution
- session_end: Close session with summary and embedding
- session_list: List sessions with filtering
- session_search: Semantic search across sessions
- session_context: Get complete session context (tasks, commits, builds, memories)
- build_record: Link builds to sessions and versions
- session_commit_link: Link commits to sessions
Enhanced existing tools:
- memory_add: Added session_id and task_id parameters
- Updated all memory queries to use 'memories' table (renamed from session_memories)
Implementation:
- Created src/tools/sessions.ts with all session operations
- Updated src/tools/memories.ts for new schema
- Added 8 session tool definitions to src/tools/index.ts
- Registered all session tools in src/index.ts switch statement
- TypeScript compilation successful
Related: CF-167 (Fix shared session-summary.md file conflict)
- db.ts: Hardcode 10.0.1.1 (infra VM) to prevent env var issues
- index.ts: Start MCP server before DB connection (fixes Claude Code timing)
- run.sh/run.js: Add wrapper scripts with embedded env vars
- start.sh: Update with correct WireGuard config
Fixes task-mcp failing to connect in Claude Code sessions after
WireGuard migration. The server must respond to MCP initialize
before stdin closes, which requires starting before slow DB ops.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New features:
- detectProjectFromCwd(): Maps directory paths to project keys
- project_context: Returns project, tasks, epics, lock status
- Auto-detection for 18 known projects (ST, VPN, OWUI, etc.)
- Falls back to extracting from Apps/X or Infrastructure/X paths
Use project_context at session start to see only relevant tasks.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New MCP tools:
- project_lock: Lock a project for exclusive session access
- project_unlock: Release a project lock
- project_lock_status: Check lock status for project(s)
Features:
- Automatic lock expiration (default 2h)
- Session ownership verification
- Force unlock option for emergencies
- Lock extension on re-lock by same session
Migration 004: project_locks table with expiry tracking
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New epic_close(id) function to mark epics as completed
- Added tool definition and handler
- Usage: epic_close({ id: 'CF-E1' })
Task: CF-258
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Session 374: Task-MCP and Delegation System Integration (Phase 4 & 6)
- Add task_delegations tool: query delegations for a specific task
- Add task_delegation_query tool: query across all tasks by status/backend
- Enhance taskShow() to display recent delegation history
- New delegations.ts module with getRecentDelegations helper
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Combines close + link operations for duplicate issues:
- Closes the duplicate task (sets status to completed)
- Creates bidirectional 'duplicates' link to dominant task
Usage: task_resolve_duplicate(duplicate_id, dominant_id)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>