@claudetools/tools 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,7 @@ export const DEFAULT_CONFIG = {
21
21
  defaultProjectId: undefined,
22
22
  defaultUserId: 'default',
23
23
  // Context Injection
24
- autoInjectContext: false, // Disabled by default for backward compatibility
24
+ autoInjectContext: true, // Enabled by default - this is the core value prop
25
25
  contextRelevanceThreshold: 0.5,
26
26
  maxContextFacts: 10,
27
27
  // Logging & Verbosity
package/dist/setup.js CHANGED
@@ -589,7 +589,16 @@ CWD=$(pwd)
589
589
  PROJECT_ID=""
590
590
  PROJECT_NAME=""
591
591
 
592
- if [ -f "$PROJECTS_FILE" ]; then
592
+ # Priority 1: Check .claude/CLAUDE.md for project ID (from claudetools init)
593
+ CLAUDE_MD="$CWD/.claude/CLAUDE.md"
594
+ if [ -f "$CLAUDE_MD" ]; then
595
+ # Extract project ID from format: **Project ID:** \\\`local_xxx\\\` or \\\`proj_xxx\\\`
596
+ # Use sed to extract text between backticks after "Project ID"
597
+ PROJECT_ID=$(grep "Project ID" "$CLAUDE_MD" 2>/dev/null | sed -n "s/.*\\\`\\([a-z0-9_]*\\)\\\`.*/\\1/p" | head -1)
598
+ fi
599
+
600
+ # Priority 2: Fall back to projects.json cache
601
+ if [ -z "$PROJECT_ID" ] && [ -f "$PROJECTS_FILE" ]; then
593
602
  # Find project by path prefix match (use variable binding for jq startswith)
594
603
  # Use -c for compact output so head -1 gets complete JSON object
595
604
  PROJECT_DATA=$(jq -c --arg cwd "$CWD" '
@@ -684,12 +693,19 @@ API_KEY=$(jq -r '.apiKey // empty' "$CONFIG_FILE")
684
693
 
685
694
  if [ -z "$API_KEY" ]; then exit 0; fi
686
695
 
687
- # Get current project from projects.json
696
+ # Get current project - check CLAUDE.md first, then projects.json
688
697
  PROJECT_FILE="$HOME/.claudetools/projects.json"
689
698
  CWD=$(pwd)
690
699
  PROJECT_ID=""
691
700
 
692
- if [ -f "$PROJECT_FILE" ]; then
701
+ # Priority 1: Check .claude/CLAUDE.md for project ID (from claudetools init)
702
+ CLAUDE_MD="$CWD/.claude/CLAUDE.md"
703
+ if [ -f "$CLAUDE_MD" ]; then
704
+ PROJECT_ID=$(grep "Project ID" "$CLAUDE_MD" 2>/dev/null | sed -n "s/.*\\\`\\([a-z0-9_]*\\)\\\`.*/\\1/p" | head -1)
705
+ fi
706
+
707
+ # Priority 2: Fall back to projects.json cache
708
+ if [ -z "$PROJECT_ID" ] && [ -f "$PROJECT_FILE" ]; then
693
709
  # Try to find project by path prefix (use variable binding for jq startswith)
694
710
  PROJECT_ID=$(jq -r --arg cwd "$CWD" '
695
711
  .bindings[]? | select(.local_path) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claudetools/tools",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "Persistent AI memory, task management, and codebase intelligence for Claude Code",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",