Skip to content

Commit 94d4a3d

Browse files
jsbattigclaude
andcommitted
Release v4.3.0: Add --show-only flag and simplify Claude Code integration
- Add --show-only flag to set-claude-prompt command for safe content preview - Replace verbose CIDX prompt content with simplified, actionable requirements - Streamline Claude Code integration with mandatory "CIDX-first" workflow emphasis - Add comprehensive test coverage for new --show-only functionality - Update version to 4.3.0 across all documentation and configuration files - Enhance release notes with detailed feature descriptions and improvements 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0305349 commit 94d4a3d

File tree

15 files changed

+294
-136
lines changed

15 files changed

+294
-136
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
AI-powered semantic code search for your codebase. Find code by meaning, not just keywords.
44

5-
## Version 4.2.0
5+
## Version 4.3.0
66

77
## Two Operating Modes
88

@@ -52,7 +52,7 @@ The code-indexer uses a sophisticated dual-phase parallel processing architectur
5252
### pipx (Recommended)
5353
```bash
5454
# Install the package
55-
pipx install git+https://github.com/jsbattig/code-indexer.git@v4.2.0
55+
pipx install git+https://github.com/jsbattig/code-indexer.git@v4.3.0
5656

5757
# Setup global registry (standalone command - requires sudo)
5858
cidx setup-global-registry
@@ -65,7 +65,7 @@ cidx setup-global-registry
6565
```bash
6666
python3 -m venv code-indexer-env
6767
source code-indexer-env/bin/activate
68-
pip install git+https://github.com/jsbattig/code-indexer.git@v4.2.0
68+
pip install git+https://github.com/jsbattig/code-indexer.git@v4.3.0
6969

7070
# Setup global registry (standalone command - requires sudo)
7171
cidx setup-global-registry
@@ -130,7 +130,7 @@ The CIDX server provides a FastAPI-based multi-user semantic code search service
130130

131131
```bash
132132
# 1. Install and setup (same as CLI)
133-
pipx install git+https://github.com/jsbattig/code-indexer.git@v4.2.0
133+
pipx install git+https://github.com/jsbattig/code-indexer.git@v4.3.0
134134
cidx setup-global-registry
135135

136136
# 2. Install and configure the server

RELEASE_NOTES.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Release Notes
22

3+
## Version 4.3.0 - Simplified Claude Code Integration & --show-only Flag
4+
5+
**Release Date**: September 12, 2025
6+
7+
### 🎯 Claude Code Integration Enhancement
8+
9+
- **Simplified CIDX Prompt Content**: Replaced verbose Claude Code integration prompt with concise, focused content emphasizing the mandatory "CIDX-first" workflow
10+
- **Streamlined Instructions**: New prompt content focuses on the absolute requirement to use `cidx query` before any grep/find operations
11+
- **Clear Examples**: Practical bash examples showing proper cidx usage patterns with --quiet flags and filtering options
12+
- **Mandatory Use Cases**: Clearly defined scenarios where cidx must be used (NO EXCEPTIONS)
13+
14+
### 🔧 New CLI Feature
15+
16+
- **--show-only Flag**: Added `cidx set-claude-prompt --show-only` flag to preview generated prompt content without modifying files
17+
- **Rich Display**: Prompt content displayed with markdown syntax highlighting for better readability
18+
- **Safe Preview**: Allows users to see exactly what content would be injected before committing to file changes
19+
- **No File Requirements**: Works without existing CLAUDE.md files, making it safe for exploration
20+
21+
### 📝 Content Simplification
22+
23+
- **Reduced Complexity**: Eliminated verbose "🎯 SEMANTIC SEARCH TOOL" section in favor of direct, actionable requirements
24+
- **Focused Workflow**: Simplified from multi-mode complex instructions to single, clear workflow emphasis
25+
- **Practical Examples**: Replaced theoretical examples with real command examples users will actually use
26+
- **Violation Consequences**: Clear warning about semantic-first mandate violations
27+
28+
### 🏗️ Architecture Improvements
29+
30+
- **Unified Output**: All instruction levels (minimal, balanced, comprehensive) now return the same focused content
31+
- **Simplified Logic**: Eliminated complex mode-based instruction building in favor of consistent output
32+
- **Test Coverage**: Updated all tests to validate new simplified content expectations
33+
- **Backward Compatibility**: Existing set-claude-prompt functionality preserved with enhanced --show-only option
34+
35+
### 🐛 Bug Fixes & Quality
36+
37+
- **Test Suite Updates**: Fixed 17+ failing tests to align with new simplified prompt content
38+
- **Linting Compliance**: All code passes ruff, black, and mypy quality checks
39+
- **Import Cleanup**: Removed unused imports and cleaned up test dependencies
40+
41+
---
42+
343
## Version 4.2.0 - VoyageAI Batch Processing & Enhanced Progress Reporting
444

545
**Release Date**: September 11, 2025

src/code_indexer/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
to provide code search capabilities.
66
"""
77

8-
__version__ = "4.2.0"
8+
__version__ = "4.3.0"
99
__author__ = "Seba Battig"

src/code_indexer/cli.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4587,8 +4587,13 @@ def fix_config(ctx, dry_run: bool, verbose: bool, force: bool):
45874587
is_flag=True,
45884588
help="Set prompt in user's global ~/.claude/CLAUDE.md file instead of project file",
45894589
)
4590+
@click.option(
4591+
"--show-only",
4592+
is_flag=True,
4593+
help="Display the generated prompt content without modifying any files",
4594+
)
45904595
@click.pass_context
4591-
def set_claude_prompt(ctx, user_prompt: bool):
4596+
def set_claude_prompt(ctx, user_prompt: bool, show_only: bool):
45924597
"""Set CIDX semantic search instructions in CLAUDE.md files.
45934598
45944599
This command injects comprehensive CIDX semantic search instructions into
@@ -4597,6 +4602,7 @@ def set_claude_prompt(ctx, user_prompt: bool):
45974602
\b
45984603
BEHAVIOR:
45994604
• --user-prompt: Sets prompt in ~/.claude/CLAUDE.md (global for all projects)
4605+
• --show-only: Displays prompt content without modifying files
46004606
• Default: Sets prompt in project CLAUDE.md (walks up directory tree to find it)
46014607
46024608
\b
@@ -4610,19 +4616,48 @@ def set_claude_prompt(ctx, user_prompt: bool):
46104616
EXAMPLES:
46114617
cidx set-claude-prompt # Set in project CLAUDE.md
46124618
cidx set-claude-prompt --user-prompt # Set in user's global CLAUDE.md
4619+
cidx set-claude-prompt --show-only # Display content without writing files
46134620
46144621
\b
46154622
REQUIREMENTS:
46164623
• For project mode: CLAUDE.md must exist in current directory or parent directories
46174624
• For user mode: ~/.claude/ directory will be created if needed
4625+
• For show-only mode: No file requirements
46184626
"""
46194627
from .services.claude_prompt_setter import ClaudePromptSetter
46204628

46214629
try:
4630+
# Check for conflicting flags
4631+
if show_only and user_prompt:
4632+
console.print("❌ Cannot use --show-only with --user-prompt", style="red")
4633+
console.print(
4634+
" --show-only displays content without specifying target file",
4635+
style="dim",
4636+
)
4637+
sys.exit(1)
4638+
46224639
# Get current directory for codebase context
46234640
current_dir = Path.cwd()
46244641
setter = ClaudePromptSetter(current_dir)
46254642

4643+
# Handle --show-only mode
4644+
if show_only:
4645+
console.print("📖 Generated CIDX prompt content:\n", style="blue")
4646+
prompt_content = setter._generate_cidx_prompt()
4647+
4648+
# Add section header as it would appear in CLAUDE.md
4649+
section_header = "- CIDX SEMANTIC CODE SEARCH INTEGRATION\n\n"
4650+
full_content = section_header + prompt_content
4651+
4652+
# Display with syntax highlighting for better readability
4653+
from rich.syntax import Syntax
4654+
4655+
syntax = Syntax(
4656+
full_content, "markdown", theme="github-dark", line_numbers=False
4657+
)
4658+
console.print(syntax)
4659+
return
4660+
46264661
if user_prompt:
46274662
# Set in user's global CLAUDE.md
46284663
console.print("🔧 Setting CIDX prompt in user's global CLAUDE.md...")

src/code_indexer/services/cidx_instruction_builder.py

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -38,50 +38,37 @@ def build_instructions(
3838
Returns:
3939
Formatted instruction string
4040
"""
41-
sections = []
41+
# Always return the simplified version - just the core introduction
42+
return self._build_core_introduction()
4243

43-
# Core CIDX introduction
44-
sections.append(self._build_core_introduction())
45-
46-
if include_help_output:
47-
sections.append(self._build_help_output())
48-
49-
# Strategic usage based on level
50-
if instruction_level in ["balanced", "comprehensive"]:
51-
sections.append(self._build_strategic_usage())
52-
53-
if include_examples:
54-
sections.append(self._build_examples())
44+
def _build_core_introduction(self) -> str:
45+
"""Build the core CIDX introduction."""
46+
return """**ABSOLUTE REQUIREMENT**: ALWAYS use `cidx query` FIRST before any grep/find/search operations when exploring code by purpose or functionality.
47+
48+
### Mandatory CIDX-First Workflow
49+
**STEP 1 - ALWAYS**: Start with semantic search using cidx
50+
```bash
51+
cidx query "authentication function" --quiet
52+
cidx query "error handling patterns" --language python --quiet
53+
cidx query "database connection" --path */services/* --quiet
54+
cidx query "authentication system login" --limit 10
55+
cidx query "caching engine documentation" --language md
56+
```
5557
56-
if include_advanced_patterns:
57-
sections.append(self._build_advanced_patterns())
58+
**STEP 2 - ONLY IF NEEDED**: Use traditional tools for exact string matches or when cidx fails
5859
59-
# Evidence requirements removed - now handled by Claude integration service
60+
### CIDX Mandatory Use Cases - NO EXCEPTIONS
61+
- **ABSOLUTELY REQUIRED** when user asks to "explore [functionality]" - use cidx IMMEDIATELY
62+
- **ABSOLUTELY REQUIRED** for finding functions/classes by purpose: "user authentication", "data validation"
63+
- **ABSOLUTELY REQUIRED** for locating implementation patterns: "async database queries", "error handling"
64+
- **ABSOLUTELY REQUIRED** for discovering related code: "similar to login function", "authentication middleware"
6065
61-
return "\n\n".join(sections)
66+
### Traditional Tools - LIMITED EXCEPTIONS ONLY
67+
- Exact literal string matches needed (specific variable names, exact text)
68+
- Simple file listing operations (ls, find by filename)
69+
- When cidx index unavailable or corrupted (fallback only)
6270
63-
def _build_core_introduction(self) -> str:
64-
"""Build the core CIDX introduction."""
65-
return """🎯 SEMANTIC SEARCH TOOL - YOUR PRIMARY CODE DISCOVERY METHOD
66-
67-
CRITICAL: You have access to a powerful semantic search tool `cidx query` that can find relevant code across the entire codebase. Use it liberally - it's much more effective than guessing or making assumptions.
68-
69-
**🧠 WHAT MAKES CIDX QUERY UNIQUE**:
70-
- **Semantic Understanding**: Finds code related to concepts even when exact words don't match
71-
- **Context Awareness**: Understands relationships between functions, classes, and modules
72-
- **Relevance Scoring**: Returns results ranked by semantic similarity (0.0-1.0 scale)
73-
- **Git-Aware**: Searches within current project/branch context
74-
- **Cross-Language**: Finds similar patterns across different programming languages
75-
76-
**WHEN TO USE CIDX QUERY**:
77-
✅ "Where is X implemented?" → Search immediately with `cidx query "X implementation" --quiet`
78-
✅ "How does Y work?" → Search for Y-related code first: `cidx query "Y functionality" --quiet`
79-
✅ "What files contain Z?" → Use semantic search: `cidx query "Z" --quiet`
80-
✅ "Show me examples of..." → Search for examples: `cidx query "examples of..." --quiet`
81-
✅ "Is there any code that..." → Search to verify: `cidx query "code that..." --quiet`
82-
❌ "What is dependency injection?" → Can answer directly (general concept)
83-
84-
**ALWAYS USE --quiet FLAG**: This provides cleaner output without headers, making it easier to process results."""
71+
**VIOLATION CONSEQUENCE**: Using grep/find BEFORE attempting cidx for semantic searches violates the semantic-first mandate."""
8572

8673
def _build_help_output(self) -> str:
8774
"""Build the complete CIDX help output section."""

tests/e2e/claude_integration/infrastructure.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
from pathlib import Path
1010
from typing import Dict, Any
1111

12-
# Import EmbeddingProvider enum from unit test infrastructure
12+
from tests.unit.infrastructure.infrastructure import EmbeddingProvider
13+
14+
# Re-export EmbeddingProvider for test files
15+
__all__ = [
16+
"EmbeddingProvider",
17+
"TestProjectInventory",
18+
"create_test_project_with_inventory",
19+
]
1320

1421

1522
class TestProjectInventory(Enum):

tests/e2e/display/infrastructure.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
from pathlib import Path
1010
from typing import Dict, Any
1111

12-
# Import EmbeddingProvider enum from unit test infrastructure
12+
from tests.unit.infrastructure.infrastructure import EmbeddingProvider
13+
14+
# Re-export EmbeddingProvider for test files
15+
__all__ = [
16+
"EmbeddingProvider",
17+
"TestProjectInventory",
18+
"create_test_project_with_inventory",
19+
]
1320

1421

1522
class TestProjectInventory(Enum):

tests/e2e/git_workflows/infrastructure.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
from pathlib import Path
1010
from typing import Dict, Any
1111

12-
# Import EmbeddingProvider enum from unit test infrastructure
12+
from tests.unit.infrastructure.infrastructure import EmbeddingProvider
13+
14+
# Re-export EmbeddingProvider for test files
15+
__all__ = [
16+
"EmbeddingProvider",
17+
"TestProjectInventory",
18+
"create_test_project_with_inventory",
19+
]
1320

1421

1522
class TestProjectInventory(Enum):

tests/e2e/misc/infrastructure.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
from pathlib import Path
1010
from typing import Dict, Any
1111

12-
# Import EmbeddingProvider enum from unit test infrastructure
12+
from tests.unit.infrastructure.infrastructure import EmbeddingProvider
13+
14+
# Re-export EmbeddingProvider for test files
15+
__all__ = [
16+
"EmbeddingProvider",
17+
"TestProjectInventory",
18+
"create_test_project_with_inventory",
19+
]
1320

1421

1522
class TestProjectInventory(Enum):

tests/e2e/payload_indexes/infrastructure.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
from pathlib import Path
1010
from typing import Dict, Any
1111

12-
# Import EmbeddingProvider enum from unit test infrastructure
12+
from tests.unit.infrastructure.infrastructure import EmbeddingProvider
13+
14+
# Re-export EmbeddingProvider for test files
15+
__all__ = [
16+
"EmbeddingProvider",
17+
"TestProjectInventory",
18+
"create_test_project_with_inventory",
19+
]
1320

1421

1522
class TestProjectInventory(Enum):

0 commit comments

Comments
 (0)