Open Source Semantic Search for your AI Agent
> /plugin marketplace add Ryandonofrio3/osgrep> /plugin install osgrep@osgrep
Repo: Ryandonofrio3/osgrep
What's inside
Natural-language search that works like grep. Fast, local, and built for coding agents.
trace to see who calls what.ORCHESTRATION (high-level logic) from DEFINITION (types/classes).onnxruntime-node.Install
npm install -g osgrep
Setup (Recommended)
osgrep setup
Downloads embedding models (~150MB) upfront. If you skip this, models download automatically on first use.
Search
cd my-repo
osgrep "where do we handle authentication?"
Your first search will automatically index the repository. Each repository is automatically isolated with its own index. Switching between repos "just works" โ no manual configuration needed. If the background server is running (osgrep serve), search goes through the hot daemon; otherwise it falls back to on-demand indexing.
Trace (Call Graph)
osgrep trace "function_name"
See who calls a function (upstream dependencies) and what it calls (downstream dependencies). Perfect for impact analysis and understanding code flow.
To find the symbols in your code base:
bash osgrep symbols
In our public benchmarks, osgrep can save about 20% of your LLM tokens and deliver a 30% speedup.
osgrep install-claude-codeclaude) and ask it questions about your codebase.osgrep serve in the background and shut it down on session end. Claude will use osgrep for semantic searches automatically but can be encouraged to do so.osgrep install-opencodeopencode) and ask it questions about your codebase.osgrep serve in the background and shut it down on session end. OC will use osgrep for semantic searches automatically but can be encouraged to do so.osgrep searchThe default command. Searches the current directory using semantic meaning.
osgrep "how is the database connection pooled?"
Options:
| Flag | Description | Default |
|---|---|---|
-m <n> | Max total results to return. | 25 |
--per-file <n> | Max matches to show per file. | 1 |
-c, --content | Show full chunk content instead of snippets. | false |
--scores | Show relevance scores (0-1) for each result. | false |
--min-score <n> | Filter out results below this score threshold. | 0 |
--compact | Show file paths only (like grep -l). | false |
-s, --sync | Force re-index changed files before searching. | false |
-r, --reset | Reset the index and re-index from scratch. | false |
| Examples: |
# General concept search
osgrep "API rate limiting logic"
# Deep dive (show more matches per file)
osgrep "error handling" --per-file 5
# Just give me the files
osgrep "user validation" --compact
# Show relevance scores and filter low-confidence matches
osgrep "authentication" --scores --min-score 0.5
osgrep indexManually indexes the repository. Useful if you want to pre-warm the cache or if you've made massive changes outside of the editor.
.gitignore and .osgrepignore (see Configuration section).Options:
| Flag | Description | Default |
|---|---|---|
-d, --dry-run | See what would be indexed without making changes. | false |
-p, --path <dir> | Path to index (defaults to current directory). | . |
-r, --reset | Remove existing index and re-index from scratch. | false |
-v, --verbose | Show detailed progress with file names. | false |
--allow-fallback | Also index files without TreeSitter grammar support. | false |
Examples:
osgrep index # Index current dir
osgrep index --dry-run # See what would be indexed
osgrep index --verbose # Watch detailed progress (useful for debugging)
osgrep index --allow-fallback # Include files without grammar support
osgrep index --reset # Full re-index from scratch
osgrep serveRuns a lightweight HTTP server with live file watching so searches stay hot in RAM.
GET /healthPOST /search with { query, limit, path, rerank }.osgrep/server.json with port/pidOptions:
| Flag | Description |
|---|---|
-p, --port <port> | Port to listen on (auto-increments if not specified) |
-b, --background | Run server in background and exit immediately |
Port Selection (priority order):
-p <port> flagOSGREP_PORT environment variableUsage:
osgrep serve # Foreground, port 4444 (or next available)
osgrep serve --background # Background mode, auto port
osgrep serve -b -p 5000 # Background on specific port
Subcommands:
osgrep serve status # Show server status for current directory
osgrep serve stop # Stop server in current directory
osgrep serve stop --all # Stop all running osgrep servers
Example workflow:
# Start servers in multiple projects
cd ~/project-a && osgrep serve -b # Starts on port 4444
cd ~/project-b && osgrep serve -b # Starts on port 4445 (auto-increment)
# Check status
osgrep serve status
# Stop all when done
osgrep serve stop --all
Claude Code hooks start/stop this automatically; you rarely need to run it manually.
osgrep listLists all indexed repositories (stores) and their metadata.
osgrep list
Shows store names, sizes, and last modified times. Useful for seeing what's indexed and cleaning up old stores.
osgrep skeletonGenerates a compressed "skeleton" of a file, showing only signatures, types, and class structures while eliding function bodies.
osgrep skeleton src/lib/auth.ts
Output:
class AuthService {
validate(token: string): boolean {
// โ jwt.verify, checkScope, .. | C:5 | ORCH
}
}
Modes:
osgrep skeleton <file>: Skeletonize specific file.osgrep skeleton <Symbol>: Find symbol in index and skeletonize its file.osgrep skeleton "query": Search for query and skeletonize top matches.Supported Languages: TypeScript, JavaScript, Python, Go, Rust, Java, C#, C++, C, Ruby, PHP.
osgrep doctorChecks installation health, model paths, and database integrity.
osgrep doctor
osgrep is designed to be a "good citizen" on your machine:
tree-sitter to split code by function/class boundaries, ensuring embeddings capture complete logical blocks.IN delete to minimize I/O.ORCHESTRATION functions (high complexity, many calls) vs DEFINITION (types/classes) to help agents prioritize where to read.osgrep automatically creates a unique index for each repository based on:
github.com/facebook/react โ facebook-react)utils-7f8a2b3c)Examples:
cd ~/work/myproject # Auto-detected: owner-myproject
osgrep "API handlers"
cd ~/personal/utils # Auto-detected: utils-abc12345
osgrep "helper functions"
Stores are isolated automatically โ no manual --store flags needed!
osgrep respects both .gitignore and .osgrepignore files when indexing. Create a .osgrepignore file in your repository root to exclude additional files or patterns from indexing.
.osgrepignore syntax:
.gitignore!), and directory patterns (/)osgrep listosgrep --store custom-name "query"rm -rf ~/.osgrep/data/store-name~/.osgrep/datapnpm install
pnpm build # or pnpm dev
pnpm format # biome check
osgrep index to refresh.osgrep doctor to verify models.osgrep index --verbose to see which file is being processed.~/.osgrep/data and ~/.osgrep/meta.json and run osgrep index.osgrep is built upon the foundation of mgrep by MixedBread. We acknowledge and appreciate the original architectural concepts and design decisions that informed this work.
See the NOTICE file for detailed attribution information.
Licensed under the Apache License, Version 2.0. See LICENSE and Apache-2.0 for details.
.claude-plugin/
marketplace.json
.github/
workflows/
ci.yml
release.yml
.gitignore
benchmark/
benchmark_opencode.csv
output/
benchmark-results.html
plot.ts
raw_responses/
baseline/
1.txt
10.txt
2.txt
3.txt
4.txt
5.txt
6.txt
7.txt
8.txt
9.txt
with_osgrep/
1.txt
10.txt
2.txt
3.txt
4.txt
5.txt
6.txt
7.txt
8.txt
9.txt
results/
.gitignore
biome.json
experiments/
mrr-sweep.ts
quick_check.ts
ranking-test.ts
verify-fix.ts
LICENSE
NOTICE
package.json
plugins/
osgrep/
.claude-plugin/
plugin.json
hooks/
hooks.json
start.js
stop.js
skills/
osgrep/
SKILL.md
pnpm-lock.yaml
public/
bench.png
README.md
scripts/
compare-engines.ts
index-bench.sh
sync-eval-cases.ts
verify_skeleton.ts
src/
commands/
claude-code.ts
codex.ts
doctor.ts
droid.ts
index.ts
list.ts
mcp.ts
opencode.ts
search.ts
serve.ts
setup.ts
skeleton.ts
symbols.ts
trace.ts
verify.ts
config.ts
eval.ts
index.ts
lib/
core/
languages.ts
graph/
graph-builder.ts
index/
chunker.ts
grammar-loader.ts
ignore-patterns.ts
sync-helpers.ts
syncer.ts
walker.ts
output/
formatter.ts
json-formatter.ts
search/
intent.ts
searcher.ts
setup/
model-loader.ts
setup-helpers.ts
skeleton/
body-fields.ts
index.ts
retriever.ts
skeletonizer.ts
summary-formatter.ts
store/
meta-cache.ts
types.ts
vector-db.ts
utils/
cleanup.ts
exit.ts
file-utils.ts
filter-builder.ts
formatter.ts
git.ts
lock.ts
project-root.ts
server-registry.ts
workers/
colbert-math.ts
colbert-tokenizer.ts
download-worker.ts
embeddings/
colbert.ts
granite.ts
orchestrator.ts
pool.ts
process-child.ts
worker.ts
test_skeleton.py
tests/
chunking.large_json.test.ts
chunking.test.ts
index-command.test.ts
search-command.test.ts
serve-command.test.ts
setup.ts
test-graph.ts
test-structural-boosting.ts
watcher-ignore.test.ts
tsconfig.json
vitest.config.mtsFAQ
osgrep is a Claude Code plugin with 1 hand-picked skill for development work, indexed on Flowy. Install it with the command on its page. It includes osgrep. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.