-
-
Notifications
You must be signed in to change notification settings - Fork 8
feat: subagent hooks, wildcards, timeouts, token optimization (v2.0.2) #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: subagent hooks, wildcards, timeouts, token optimization (v2.0.2) #71
Conversation
|
Version files synced to 2.0.2 from CHANGELOG.md |
New Features: - SubagentStart hook: inject Matrix guidance when subagents spawn - SubagentStop hook: track subagent completion - Wildcard support in warning rules (glob patterns) - Hook timeout configuration (default 30s, max 120s) - Index tools accessible from any directory via repoPath - Auto-install file-suggestion.sh script Token Optimization: - ~10-12% reduction in MCP tool definition tokens - Shortened parameter descriptions across all schemas Bug Fixes: - Improved doctor diagnostics for subagent hooks - Better validation for timeout configurations
a4404f2 to
7ce8c35
Compare
|
Version files synced to 2.0.2 from CHANGELOG.md |
Greptile SummaryThis PR introduces v2.0.2 with significant enhancements to Matrix's hook system and token optimization. The implementation adds SubagentStart/Stop hooks that inject Matrix-specific guidance when Claude Code spawns subagents (Explore, Plan agents), ensuring they prefer Matrix index tools and Context7 over generic alternatives. Key Changes:
Code Quality:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant ClaudeCode
participant SessionStart
participant SubagentStart
participant Subagent
participant SubagentStop
participant UserPromptSubmit
User->>ClaudeCode: Start session
ClaudeCode->>SessionStart: Hook: SessionStart
SessionStart->>SessionStart: ensureConfigComplete()
SessionStart->>SessionStart: installFileSuggestion()
SessionStart->>SessionStart: Run migrations & indexing
SessionStart-->>ClaudeCode: Context injected
User->>ClaudeCode: Submit prompt
ClaudeCode->>UserPromptSubmit: Hook: UserPromptSubmit
UserPromptSubmit->>UserPromptSubmit: Check memoryInjection.enabled
alt Memory injection enabled
UserPromptSubmit->>UserPromptSubmit: matrixRecall(query, limit, minScore)
UserPromptSubmit->>UserPromptSubmit: searchFailures(query)
UserPromptSubmit-->>ClaudeCode: Inject memory context
else Memory injection disabled
UserPromptSubmit-->>ClaudeCode: Skip memory, inject other context
end
ClaudeCode->>ClaudeCode: Spawn Explore subagent
ClaudeCode->>SubagentStart: Hook: SubagentStart
SubagentStart->>SubagentStart: Check toolSearch.preferMatrixIndex
SubagentStart->>SubagentStart: Check toolSearch.preferContext7
SubagentStart->>SubagentStart: buildSubagentGuidance(agent_type)
SubagentStart-->>Subagent: Inject Matrix guidance
Subagent->>Subagent: Execute with guidance
Subagent->>Subagent: Prefer matrix_find_definition over Grep
Subagent->>Subagent: Prefer Context7 over WebSearch
Subagent-->>ClaudeCode: Return results
ClaudeCode->>SubagentStop: Hook: SubagentStop
SubagentStop->>SubagentStop: Log completion (if verbose)
SubagentStop-->>ClaudeCode: Complete
ClaudeCode-->>User: Response with subagent results
|
- Add v2.0.2 features to What's New section - Add tip about running reviews in fresh sessions for unbiased results
New Features:
Token Optimization:
Bug Fixes: