
Research
/Security News
Malicious Chrome and Firefox Extensions Steal Crypto Traders’ Session and Wallet Data
Malicious Chrome and Firefox extensions target Axiom Trade and Padre users, stealing session tokens and wallet data.
opencode-codebase-index
Advanced tools
Semantic codebase indexing and search for OpenCode - find code by meaning, not just keywords
Semantic codebase indexing and search for OpenCode. Find code by meaning, not just keywords.
| Scenario | Tool | Why |
|---|---|---|
| Don't know function/class names | codebase_search | Natural language → code |
| Exploring unfamiliar codebase | codebase_search | Finds related code by meaning |
| Know exact identifier | grep | Faster, finds all occurrences |
| Need ALL matches | grep | Semantic returns top N only |
Best workflow: Semantic search for discovery → grep for precision.
npm install opencode-codebase-index
Add to your opencode.json:
{
"plugin": ["opencode-codebase-index"]
}
codebase_searchSearch code by describing what it does. Returns focused results (5-10 files).
"find the user authentication logic"
"code that handles database connections"
"error handling middleware for HTTP requests"
Good queries describe behavior:
Use grep instead for:
validateEmail, UserServiceTODO, FIXME401, errorindex_codebaseCreate or update the semantic index. Incremental indexing is fast (~50ms when nothing changed).
| Parameter | Type | Default | Description |
|---|---|---|---|
force | boolean | false | Reindex from scratch |
estimateOnly | boolean | false | Show cost estimate only |
index_statusCheck if the codebase is indexed and ready for search.
index_health_checkRemove stale entries from deleted files.
Copy the commands from commands/ to your project's .opencode/command/ directory:
cp -r node_modules/opencode-codebase-index/commands/* .opencode/command/
Available commands:
| Command | Description |
|---|---|
/search <query> | Semantic search for code by meaning |
/index | Create or update the semantic index |
/find <query> | Hybrid search (semantic + grep) |
Optional configuration in .opencode/codebase-index.json:
{
"embeddingProvider": "auto",
"scope": "project",
"indexing": {
"autoIndex": false,
"watchFiles": true,
"maxFileSize": 1048576
},
"search": {
"maxResults": 20,
"minScore": 0.1,
"hybridWeight": 0.5,
"contextLines": 0
}
}
| Option | Default | Description |
|---|---|---|
embeddingProvider | "auto" | auto, github-copilot, openai, google, ollama |
scope | "project" | project (local) or global (shared) |
indexing.autoIndex | false | Auto-index on plugin load |
indexing.watchFiles | true | Watch for file changes and re-index |
indexing.maxFileSize | 1048576 | Max file size in bytes (1MB) |
search.maxResults | 20 | Max results to return |
search.minScore | 0.1 | Minimum similarity score |
search.hybridWeight | 0.5 | Keyword vs semantic balance (0=semantic only, 1=keyword only) |
search.contextLines | 0 | Extra lines to include before/after each match |
Uses OpenCode's authentication. Auto-detected in order:
nomic-embed-text or similarIndex stored in .opencode/index/ within your project.
npm run build # Full build (TS + Rust)
npm run build:ts # TypeScript only
npm run test # Run tests
npm run typecheck # TypeScript type checking
To test the plugin locally without publishing to npm:
npm run build
rm -rf ~/.cache/opencode/node_modules/opencode-codebase-index
mkdir -p ~/.cache/opencode/node_modules/opencode-codebase-index
cp -R dist native commands skill package.json ~/.cache/opencode/node_modules/opencode-codebase-index/
mkdir -p .opencode/plugin
echo 'export { default } from "$HOME/.cache/opencode/node_modules/opencode-codebase-index/dist/index.js"' > .opencode/plugin/codebase-index.ts
opencode in your test project.git checkout -b feature/my-featurenpm run buildgit commit -m "feat: add my feature"git push origin feature/my-featureCI will automatically run tests and type checking on your PR.
├── src/
│ ├── index.ts # Plugin entry point
│ ├── config/ # Configuration schema
│ ├── embeddings/ # Embedding provider detection and API
│ ├── indexer/ # Core indexing logic
│ ├── tools/ # OpenCode tool definitions
│ ├── utils/ # File collection, cost estimation
│ ├── native/ # Rust native module wrapper
│ └── watcher/ # File change watcher
├── native/
│ └── src/ # Rust native module (tree-sitter, usearch)
├── tests/ # Unit tests (vitest)
├── commands/ # Slash command definitions
├── skill/ # Agent skill guidance
└── .github/workflows/ # CI/CD (test, build, publish)
The Rust native module handles:
To rebuild the native module:
npm run build:native
Requires Rust toolchain installed.
MIT
FAQs
Host-neutral semantic codebase search with embeddings, symbol discovery, and call-graph tooling
The npm package opencode-codebase-index receives a total of 579 weekly downloads. As such, opencode-codebase-index popularity was classified as not popular.
We found that opencode-codebase-index demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Research
/Security News
Malicious Chrome and Firefox extensions target Axiom Trade and Padre users, stealing session tokens and wallet data.

Security News
GPT-6 Astra hits 100% on ExploitBench and finds zero-days autonomously, while independent tests reveal scope violations and monitoring gaps.

Product
Socket can now send alerts and supply chain attack notifications to Microsoft Teams, with filters that route the right updates to each channel.