This project uses codei for efficient, reasoning-based codebase exploration. Always use codei first before reading files manually or making assumptions about the codebase.
Before answering any question about the codebase, you MUST query the index first.
# Quick query
codei query "your question"
# Or use HTTP API (faster if server running)
curl -s -X POST http://localhost:3131/query \
-H "Content-Type: application/json" \
-d '{"query": "YOUR_QUESTION", "maxTokens": 4000}' \
| jq -r '.context'This guide is designed to work with ANY AI agent that supports external tool execution:
# Add to ~/.claude/tools/codei.sh
curl -s -X POST http://localhost:3131/query \
-H "Content-Type: application/json" \
-d "{\"query\": \"$1\", \"maxTokens\": 3000}" | jq -r '.context'Create .cursorrules or .windsurfrules:
# Codei Context Retrieval
When you need to understand the codebase or follow dependency chains:
1. Run: curl -s -X POST http://localhost:3131/query -d '{"query": "YOUR_QUERY"}' | jq -r '.context'
2. Use the output to base your reasoning and implementation.In Plan Mode or custom instructions:
Use codei query "<your question>" to get relevant code context.
Start server with: codei serve . --port 3131
Load the codei skill from .trae/skills/codei/SKILL.md for full integration.
| DON'T | DO |
|---|---|
| Read files manually to understand code | Use codei query |
| Make assumptions about function signatures | Query to get accurate context |
| Use grep/find for code patterns | Use HTTP API or CLI query |
| Dump entire files into prompts | Let codei extract only relevant symbols |
- Query first:
codei query "<your question>" - Get context: Review the returned code fragments and dependency info
- If needed: Only then read specific files for more details
- Update index: After making changes, run
codei update
# Update after file changes
codei update
# Or via HTTP
curl -s -X POST http://localhost:3131/update
# Check status
codei status| Issue | Solution |
|---|---|
| No index found | Run codei index . |
| Outdated context | Run codei update |
| API Key issues | Check codei setup |
| Server not running | Run codei serve . --port 3131 |
See CODERULES.md for:
- Full list of query patterns
- Detailed command options
- Troubleshooting guide