Prompting Strategies
Be specific with domain terms
Be specific with domain terms
Use the actual names from your codebase — class names, service names, module names. The more specific you are, the more relevant the results.
| Instead of… | Try… |
|---|---|
| “auth code" | "authentication middleware in the Express API gateway" |
| "database stuff" | "Prisma schema for the User model" |
| "error handling" | "how does OrderService handle payment failures?" |
| "the API" | "the /api/v2/users REST endpoint” |
Ask about patterns, not just code
Ask about patterns, not just code
CodeAlive understands architectural patterns, not just individual files. Ask higher-level questions:
Use follow-up questions
Use follow-up questions
When using
codebase_consultant, pass the conversation_id from a previous response to maintain context. This lets you drill deeper without re-explaining:Combine search and chat
Combine search and chat
Start with This gives the consultant more focused context and produces better answers.
codebase_search to find relevant files, then use codebase_consultant to ask deeper questions about what you found:Search Optimization
Choose the right search mode
Choose the right search mode
codebase_search supports different modes:| Mode | When to use | Speed |
|---|---|---|
auto (default) | Most queries — it picks the best mode automatically | Varies |
fast | Quick lookups: function names, file locations, imports | Fast |
deep | Architectural questions spanning multiple files | Slower |
auto makes the right choice. Use explicit modes when you know what you need.Scope searches to repositories
Scope searches to repositories
If you have multiple repositories indexed, scope your search to avoid noise:Use
get_data_sources to see available repositories and workspaces.Search first, then chat
Search first, then chat
codebase_search is fast and returns file locations with relevant snippets. codebase_consultant is slower and uses more tokens but synthesizes a complete answer.Recommended flow:- Search to find where relevant code lives
- Chat only when you need synthesis, explanation, or analysis
Workspace Organization
Group related repos into workspaces
Group related repos into workspaces
Keep workspaces focused
Keep workspaces focused
Indexing too many unrelated repositories in one workspace adds noise to search results. If you’re getting irrelevant hits, split your workspace or scope your queries to specific repos.
Cost & Token Optimization
Use search before chat
Use search before chat
codebase_search is significantly cheaper and faster than codebase_consultant. Use search for lookups and locating code. Reserve chat for synthesis and analysis.| Tool | Best for | Relative cost |
|---|---|---|
get_data_sources | Listing repos, checking status | Minimal |
codebase_search | Finding code, locating files | Low |
codebase_consultant | Explanations, analysis, reviews | Higher |
Write focused queries
Write focused queries
Shorter, more focused queries return better results and use fewer tokens. Instead of explaining your entire situation, ask a direct question:
| Instead of… | Try… |
|---|---|
| ”I’m working on a feature where users can reset their password and I need to understand how the current password reset flow works so I can modify it" | "How does the password reset flow work?” |
Agent-Specific Tips
Claude Code
Claude Code
- Use
claude mcp addfor the simplest setup — one command, done - Add CodeAlive to your custom instructions so Claude uses it automatically
- Works with both remote MCP and local Docker
Cursor
Cursor
- Composer Agent mode automatically uses MCP tools when relevant
- Use
.cursor/mcp.jsonfor project-specific config (shareable with team) - Add CodeAlive patterns to
.cursorrulesfor consistent AI behavior
Windsurf
Windsurf
- Config uses
serverUrl— noturl— different from other agents - Supports Streamable HTTP transport
- Check Windsurf’s MCP settings page for connection status
Cline
Cline
- Supports auto-approve for MCP tools to reduce confirmation prompts
- Add CodeAlive rules to
.cline/rules.mdfor automatic context usage:
VS Code + GitHub Copilot
VS Code + GitHub Copilot
- Native MCP support is GA in VS Code
- Configure in
.vscode/mcp.jsonfor project-level setup - Agent mode in Copilot Chat automatically discovers MCP tools