<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/codesage-when-grep-just-isn-t-enough-anymore-vym8yehhv" -->

---
title: CodeSage: When grep Just Isn't Enough Anymore | daily.dev
description: CodeSage is a local-first code intelligence CLI that combines vector search, graph traversal, and developer pattern learning to enable natural language code...
canonical: https://daily.dev/posts/codesage-when-grep-just-isn-t-enough-anymore-vym8yehhv
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: CodeSage: When grep Just Isn't Enough Anymore | daily.dev
og:description: CodeSage is a local-first code intelligence CLI that combines vector search, graph traversal, and developer pattern learning to enable natural language code...
og:url: https://daily.dev/posts/codesage-when-grep-just-isn-t-enough-anymore-vym8yehhv
og:image: https://api.daily.dev/og/posts/VYM8yehhV.png
og:image:alt: CodeSage: When grep Just Isn't Enough Anymore
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CodeSage: When grep Just Isn't Enough Anymore

**[Keshav Ashiya](https://daily.dev/sources/c8e54637d3ee4126a9c503737169de61)** · [@keshavashiya](https://daily.dev/keshavashiya) · 4 min read · 1 upvotes · 0 comments

## Summary

CodeSage is a local-first code intelligence CLI that combines vector search, graph traversal, and developer pattern learning to enable natural language code search. It indexes codebases locally using Ollama for embeddings, LanceDB for vector storage, and KuzuDB for relationship graphs. The tool offers three chat modes (Brainstorm, Implement, Review) with specialized commands for semantic search, impact analysis, and code review. It integrates with AI IDEs through the Model Context Protocol, allowing assistants like Claude and Cursor to access intelligent code search. Everything runs on your machine without cloud services or API keys, supporting Python natively and JavaScript, TypeScript, Go, and Rust with additional setup.

## Content

CodeSage is a local-first code intelligence CLI. You index your codebase once, and then you can search it using natural language. No cloud. No API keys. Everything runs on your machine.

```bash
codesage init
codesage index
codesage chat 
```

But semantic search is just the beginning.

---

## The Three Pillars of Code Understanding

Most code search tools do one thing: match text. CodeSage takes a fundamentally different approach by combining three complementary techniques:

### 1. Vector Search: Find Code by Meaning

"Authentication middleware" and "JWT token validator" mean similar things, even though they share no words. Vector embeddings capture this semantic relationship, letting you find code by *what it does*, not just what it's called.

### 2. Graph Traversal: Understand Relationships

Code doesn't exist in isolation. Functions call other functions. Classes inherit from base classes. Modules import dependencies. CodeSage builds a knowledge graph of these relationships using KuzuDB, so you can ask questions like:

- "What functions call this method?"
- "What would break if I changed this class?"
- "How does data flow from the API endpoint to the database?"

### 3. Developer Memory: Learn Your Patterns

Here's where it gets interesting. CodeSage doesn't just index *what* your code does—it learns *how* you write it.

It tracks your naming conventions, your preferred patterns, your common approaches to recurring problems. This memory persists globally across all your projects, so insights from one codebase help with others.

The result? Suggestions that feel idiomatic to *your* style, not generic best practices from Stack Overflow.

---

## Interactive Chat with Specialized Modes

Not all work is the same, and neither is how you interact with your code.

CodeSage offers three chat modes, each optimized for a different workflow:

- **Brainstorm** — Exploring ideas, asking open-ended questions
- **Implement** — Focused task execution, generating code and plans
- **Review** — Code review, security analysis, quality checks

Switch anytime with `/mode implement` or let CodeSage detect your intent from context.

The chat commands go deep:

```
/search <query>    Semantic code search
/deep <query>      Multi-agent analysis (runs parallel search strategies)
/plan <task>       Implementation plan using your existing patterns
/review [file]     Code review with security awareness
/impact <element>  Blast radius analysis—what breaks if this changes?
/similar <code>    Find similar patterns across your codebase
/patterns          Show what CodeSage has learned about your style
```

---

## Smart Query Expansion

**Intent Detection**: It understands if you're explaining, debugging, implementing, or reviewing—and adjusts its response accordingly.

**Synonym Expansion**: Search for "auth" and it automatically includes authentication, authorization, JWT, OAuth, and related terms.

**Context Memory**: It remembers what you discussed earlier in the session. "What about the other handler?" just works.

---

## Works with Your AI IDE

CodeSage isn't just a standalone tool. It integrates with Claude Desktop, Cursor, and Windsurf via the Model Context Protocol (MCP).

To start the MCP server manually:

```bash
codesage mcp serve --global
```

Or add this to your MCP client configuration:

```json
{
  "mcpServers": {
    "codesage": {
      "command": "codesage",
      "args": ["mcp", "serve", "--global"]
    }
  }
}
```

Now your AI assistant has access to intelligent code search across all your indexed projects:

- `search_code` — Semantic search with graph context
- `get_file_context` — File content with its dependencies and relationships
- `get_task_context` — Implementation guidance grounded in your patterns
- `review_code` — Code review using learned conventions
- `analyze_security` — Security scan with project-specific context

Your AI assistant stops giving generic answers and starts giving *grounded* answers based on your actual codebase.

---

## The Technical Stack

Everything runs locally. No exceptions.

- **Ollama** handles embeddings and LLM responses
- **LanceDB** provides vector storage with fast similarity search
- **KuzuDB** powers the code relationship graph
- **SQLite** stores metadata and developer memory

You need Ollama running with a few models:

```bash
ollama pull qwen2.5-coder:7b
ollama pull mxbai-embed-large
ollama serve
```

That's it. No cloud accounts, no API keys, no data leaving your machine.

---

## Getting Started

Installation takes one command:

```bash
pipx install pycodesage
```

Then index your first project:

```bash
cd your-project
codesage init
codesage index
```

Start searching:

```bash
codesage chat
```

### Language Support

Python works out of the box. For JavaScript, TypeScript, Go, and Rust:

```bash
pipx inject pycodesage "pycodesage[multi-language]"
```

---

## What's Next

We're actively developing:

- **More language parsers** — expanding beyond the current set
- **Cross-project learning** — enhanced pattern sharing between codebases
- **Documentation generation** — auto-generate docs that match your style

---

## Try It

```bash
pipx install pycodesage
```

**GitHub**: [github.com/keshavashiya/codesage](https://github.com/keshavashiya/codesage)

Contributions, feedback, and feature requests are all welcome.

---

*CodeSage: Stop searching. Start asking.*

## Similar posts on daily.dev

- [The Surprising Way AI Agents Search Code: Two Unix Commands From the ‘70s](https://daily.dev/posts/the-surprising-way-ai-agents-search-code-two-unix-commands-from-the-70s-lysyasslq) · Medium · 0 upvotes · 0 comments
- [Local Indexing to reduce tool calling and token usage](https://daily.dev/posts/local-indexing-to-reduce-tool-calling-and-token-usage-kpftxf4qx) · Hacker News · 1 upvotes · 0 comments
- [Codebase Indexing Is Back in Kilo Code](https://daily.dev/posts/codebase-indexing-is-back-in-kilo-code-v6xslrcd1) · Kilo Blog · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#llm](https://daily.dev/tags/llm), [#cli](https://daily.dev/tags/cli), [#vector-search](https://daily.dev/tags/vector-search)

[View this post on daily.dev](https://daily.dev/posts/codesage-when-grep-just-isn-t-enough-anymore-vym8yehhv)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/codesage-when-grep-just-isn-t-enough-anymore-vym8yehhv","headline":"CodeSage: When grep Just Isn't Enough Anymore","text":"CodeSage is a local-first code intelligence CLI that combines vector search, graph traversal, and developer pattern learning to enable natural language code search. It indexes codebases locally using Ollama for embeddings, LanceDB for vector storage, and KuzuDB for relationship graphs. The tool offers three chat modes (Brainstorm, Implement, Review) with specialized commands for semantic search, impact analysis, and code review. It integrates with AI IDEs through the Model Context Protocol, allowing assistants like Claude and Cursor to access intelligent code search. Everything runs on your machine without cloud services or API keys, supporting Python natively and JavaScript, TypeScript, Go, and Rust with additional setup.","url":"https://daily.dev/posts/codesage-when-grep-just-isn-t-enough-anymore-vym8yehhv","datePublished":"2026-02-05T19:02:25.533Z","dateModified":"2026-02-07T11:13:25.569Z","author":{"@type":"Person","name":"Keshav Ashiya","url":"https://daily.dev/keshavashiya","image":"https://avatars0.githubusercontent.com/u/20239068?v=4","description":"Engineering, Data & Scaling","worksFor":{"@type":"Organization","name":"Popular Digital AI","logo":"https://media.daily.dev/image/upload/s--mFFwtqv4--/f_auto/v1745576484/companies/populardigital"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":1440}},"image":"https://media.daily.dev/image/upload/s--Dm33Mt3A--/f_auto/v1770318147/posts/VYM8yehhV?_a=BAMAMiiu0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/sources/c8e54637d3ee4126a9c503737169de61","name":"Keshav Ashiya"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Keshav Ashiya","item":"https://daily.dev/sources/c8e54637d3ee4126a9c503737169de61"},{"@type":"ListItem","position":3,"name":"CodeSage: When grep Just Isn't Enough Anymore"}]}
```

