-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Current session hooks use static CLAUDE.md files for project context. This means:
- Context gets stale over time
- No semantic relevance - just dumps entire file
- Can't auto-discover patterns from knowledge base
- No ranking by usage/recency/confidence
Proposed Solution
Add ./know context command that semantically searches Qdrant for relevant project context.
Features
- Auto-detect project from git repo or directory name
- Smart search for:
- Recent decisions (
updated_at DESC) - High-usage patterns (
usage_count DESC) - Project-specific architecture (
module=<project>) - Common gotchas (
category=gotcha)
- Recent decisions (
- Rank by relevance:
- Recently accessed = still relevant
- High confidence = vetted knowledge
- Frequently used = proven patterns
- Format for Claude:
- Concise summaries with links to full details
- Grouped by category (architecture, patterns, decisions, gotchas)
- Token-aware (max-tokens flag to fit context window)
Usage
# Auto-detect project and generate context
./know context
# Specify project explicitly
./know context --project=conduit-ui
# Limit output tokens for session hooks
./know context --max-tokens=2000
# Filter by specific categories
./know context --categories=architecture,patternsSession Hook Integration
#!/bin/bash
# ~/.claude/hooks/session-start.sh
./know context --project="$(basename "$PWD")" --max-tokens=2000Implementation Notes
- Use QdrantService search with filters
- Group results by category
- Format as markdown with summary sections
- Track which entries are used (increment usage_count)
- Consider caching recent context lookups
Acceptance Criteria
-
./know contextcommand exists and works - Auto-detects project from pwd/git
- Searches Qdrant with smart ranking
- Formats output for Claude consumption
- Respects --max-tokens limit
- Increments usage_count for accessed entries
- Has comprehensive tests
- Documentation in README
Benefits
- Dynamic context that evolves with your knowledge base
- Semantic relevance instead of static dumps
- Token-efficient - only includes what matters
- Self-improving - tracks what context is actually useful (usage_count)
- Multi-project - works across all your projects automatically
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request