Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish-npm-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to publish (e.g. v2.3.0)'
description: 'Tag to publish (e.g. v2.4.0)'
required: true
default: 'v2.3.0'
default: 'v2.4.0'

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.3.0"
".": "2.4.0"
}
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

## [2.4.0](https://github.com/PatrickSys/codebase-context/compare/v2.3.0...v2.4.0) (2026-10-06)


### Features

* **analyzers:** recognize NestJS projects ([a8e354e](https://github.com/PatrickSys/codebase-context/commit/a8e354e23826df3edbf4ae4dd50d6c494559d7f9))
* **analyzers:** Recognize NestJS projects ([754130d](https://github.com/PatrickSys/codebase-context/commit/754130dda398b463024de7ea6668c4c849e40d2e))
* **indexing:** Make chunk limits configurable per project ([1612414](https://github.com/PatrickSys/codebase-context/commit/161241480e08ff6e9794f91da1cff28a541edd3b))
* **review:** add bounded review-context packets ([2c56b10](https://github.com/PatrickSys/codebase-context/commit/2c56b10ff32d588d9d660a586c0defee5a3d76d1))


### Bug Fixes

* **analyzers:** Prefer NestJS provider analysis ([6093099](https://github.com/PatrickSys/codebase-context/commit/6093099e02e39d2babff58d26a4f0fff634e0ce5))
* **analyzers:** Recognize current React and Next patterns ([9ed8577](https://github.com/PatrickSys/codebase-context/commit/9ed8577cc930255debaba335b989295c38138b87))
* **analyzers:** Tie React use metadata to imports ([0154f45](https://github.com/PatrickSys/codebase-context/commit/0154f45d0fd5053c6215f6d540b557bc7f2ccefd))
* **eval:** align ContextBench harness evidence contracts ([4513979](https://github.com/PatrickSys/codebase-context/commit/45139796f4e0cc51854de906b0b40b66beb8b4e3))
* **eval:** deduplicate blocked ContextBench rows ([99c9753](https://github.com/PatrickSys/codebase-context/commit/99c975359ef1af300ae4dbe4f430b734802bcdb9))
* **eval:** deduplicate blocked ContextBench rows ([c41e844](https://github.com/PatrickSys/codebase-context/commit/c41e844b6d85318ff9b30b966a84147430e6c7ad))
* **eval:** harden ContextBench fixture verification ([bed5064](https://github.com/PatrickSys/codebase-context/commit/bed5064c6177f202b24f9564b083bf68068641ba))
* **eval:** harden ContextBench manifest checks ([04a6cfb](https://github.com/PatrickSys/codebase-context/commit/04a6cfbc2a66953420645173df3e6e5d19cd50bf))
* **eval:** preserve ContextBench executor model provenance ([867ac70](https://github.com/PatrickSys/codebase-context/commit/867ac700d98ad141ee180f6353784f9dab1f26fc))
* **format:** format ContextBench harness sources ([b2fa208](https://github.com/PatrickSys/codebase-context/commit/b2fa208a4df0579bfdc41d8ffe2a74b2fae6e93e))
Comment on lines +24 to +25

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Duplicate fix entry with identical commit message — eval: deduplicate blocked ContextBench rows appears twice (commits 99c9753 and c41e844). Two separate commits carrying the exact same message suggests the patch was cherry-picked or applied a second time unintentionally. Worth confirming that both commits represent genuinely distinct changes; if one is a duplicate commit in the git history, the extra commit should be dropped before merging the release.

* **git:** scope local artifact ignores ([ef42e53](https://github.com/PatrickSys/codebase-context/commit/ef42e53b99f1deed3a7e2107d8124b554b890860))
* **reranker:** Score passages with the supported tokenizer pair API ([55b97b9](https://github.com/PatrickSys/codebase-context/commit/55b97b9c2261278d3c92ee1f3000d0a80920432d))
* **test:** harden ContextBench schema cleanup ([c5a74af](https://github.com/PatrickSys/codebase-context/commit/c5a74afb64c65b255a363e31974fa7be6d58242d))
* **test:** isolate ContextBench baseline Git env ([6aed9d1](https://github.com/PatrickSys/codebase-context/commit/6aed9d1a93f540f0d4a17142ab4527769b97cecb))
* **test:** isolate ContextBench git fixtures ([62d3110](https://github.com/PatrickSys/codebase-context/commit/62d3110503b4eca3e4ff65a8403bd0644861d61f))
* **test:** relax slow Windows integration timeouts ([5675ebd](https://github.com/PatrickSys/codebase-context/commit/5675ebdd41f2af784d86c1ec3e25c9e756f80d6b))
* **test:** relax slow Windows search timeouts ([cad646d](https://github.com/PatrickSys/codebase-context/commit/cad646d9d940c00ab96baa0ca806070722cced32))
* **test:** relax zombie guard timeout jitter ([5a5bf68](https://github.com/PatrickSys/codebase-context/commit/5a5bf68302745f90b1dbdfba3ab06cfff961d4d5))
* **test:** tolerate ContextBench runner cleanup races ([c027703](https://github.com/PatrickSys/codebase-context/commit/c027703092a81c90b5c19371873858e5a87ec00c))
* **test:** tolerate ContextBench schema cleanup races ([a155d56](https://github.com/PatrickSys/codebase-context/commit/a155d5646dbb283ffac1e71eef7fb26b8a59fa40))
* **test:** tolerate ContextBench temp cleanup races ([0360cb9](https://github.com/PatrickSys/codebase-context/commit/0360cb97d99337438e1922bf52a76833b9d20fd6))

## [2.3.0](https://github.com/PatrickSys/codebase-context/compare/v2.2.0...v2.3.0) (2026-04-30)


Expand Down
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ Codebase Context gives an agent a local view of that information through code se

## Set up your AI client

Choose your coding tool and run its command once. Use Node.js 22 or newer. These commands use published npm `2.2.0` and do not require a project folder in your configuration:
Choose your coding tool and run its command once. Use Node.js 22 or newer. These commands use published npm `2.4.0` and do not require a project folder in your configuration:

```bash
# Claude Code
claude mcp add --scope user --transport stdio codebase-context -- npx -y codebase-context@2.2.0
claude mcp add --scope user --transport stdio codebase-context -- npx -y codebase-context@2.4.0

# Codex CLI
codex mcp add codebase-context -- npx -y codebase-context@2.2.0
codex mcp add codebase-context -- npx -y codebase-context@2.4.0

# OpenCode 1.x (keep the quoted separator on Windows)
opencode mcp add codebase-context '--' npx -y codebase-context@2.2.0
opencode mcp add codebase-context '--' npx -y codebase-context@2.4.0
```

Start a new agent session in your project, then ask:

> Use Codebase Context to find [feature] in this repository. Pass this repository's absolute path as project when checking get_indexing_status and searching. Wait for indexing if needed, read codebase://context, then search_codebase and open a returned source file. Show me the relevant files.

Replace `[feature]` with something you want to find. The agent supplies the repository path in its tool calls, so the registration can serve different projects. Initial indexing may need a local model download. The October 6 isolated checks proved these client registrations and published-package project selection/search; they did not establish a full native agent investigation.
Replace `[feature]` with something you want to find. The agent supplies the repository path in its tool calls, so the registration can serve different projects. Initial indexing may need a local model download. The October 6 isolated checks exercised published `2.2.0` client registrations and project selection/search. They did not verify `2.4.0` or establish a full native agent investigation.

For Codex Desktop, create or merge `.codex/config.toml` in the project you want to search:

```toml
[mcp_servers.codebase-context]
command = "npx"
args = ["-y", "codebase-context@2.2.0"]
args = ["-y", "codebase-context@2.4.0"]
startup_timeout_sec = 120
```

Expand All @@ -44,13 +44,13 @@ Other clients use their own setup commands:

| Client | Shortest current setup |
| --------------------------- | ---------------------------------------------------------------------------- |
| Gemini CLI | `gemini mcp add --scope user codebase-context npx -y codebase-context@2.2.0` |
| Gemini CLI | `gemini mcp add --scope user codebase-context npx -y codebase-context@2.4.0` |
| Cursor | Add `.cursor/mcp.json` |
| VS Code with GitHub Copilot | Add `.vscode/mcp.json` |
| GitHub Copilot CLI | `copilot mcp add codebase-context -- npx -y codebase-context@2.2.0` |
| GitHub Copilot CLI | `copilot mcp add codebase-context -- npx -y codebase-context@2.4.0` |
| Windsurf | Add `~/.codeium/windsurf/mcp_config.json` |

Check an existing same-name entry before replacing it. To give the server a default folder, append that folder's absolute path to the `npx` arguments. The [client setup guide](./docs/client-setup.md) covers scopes, optional fixed-folder configuration, verification limits and the unreleased installer. Published `2.2.0`'s interactive `init` has registration bugs; use the commands above.
Check an existing same-name entry before replacing it. To give the server a default folder, append that folder's absolute path to the `npx` arguments. The [client setup guide](./docs/client-setup.md) covers scopes, optional fixed-folder configuration, the `2.4.0` project installer and its verification limits. The registration bugs found in `2.2.0` are historical.

The [client setup guide](./docs/client-setup.md) has the exact commands and config for every client, plus what was checked locally and what still relies on official instructions.

Expand All @@ -64,12 +64,16 @@ The default connection is `stdio` (standard input/output): your client starts th

### Team patterns and examples

`get_team_patterns` shows the approaches used in the repository and points to representative files. Published `2.2.0` includes dedicated analyzers for Angular, React and Next.js, with a generic analyzer for other stacks. NestJS support belongs to the newer source candidate.
`get_team_patterns` shows the approaches used in the repository and points to representative files. Published `2.4.0` includes dedicated analyzers for Angular, React, Next.js and NestJS, with a generic analyzer for other stacks.

### Project memory

`remember` stores a convention, decision, gotcha, or past failure for the project. `get_memory` retrieves relevant entries in later sessions, including when the agent or editor changes.

### Review context

The `codebase-context-review` CLI creates a bounded context packet from a committed Git diff. It gives a reviewer context; it does not review code or prove review quality. See the [review-context guide](./docs/review-context.md).

## How it works

1. **Index locally.** Codebase Context scans the project, builds a keyword index, and creates local semantic embeddings - numeric representations used to match code by meaning as well as exact words.
Expand All @@ -80,16 +84,16 @@ The same information is available from the terminal. Run these commands from you

```bash
# Build or refresh the local index
npx -y codebase-context@2.2.0 reindex
npx -y codebase-context@2.4.0 reindex

# Repository structure, patterns, and representative files
npx -y codebase-context@2.2.0 map
npx -y codebase-context@2.4.0 map

# Ranked code search
npx -y codebase-context@2.2.0 search --query "auth middleware"
npx -y codebase-context@2.4.0 search --query "auth middleware"

# Current team patterns
npx -y codebase-context@2.2.0 patterns
npx -y codebase-context@2.4.0 patterns
```

One stdio server can route across several repositories. Supply `project` in tool calls to select the intended repository; a successful selection becomes the default for later calls in that process. Some clients also announce workspace roots: one root can auto-select, while an ambiguous selection asks for a project instead of guessing. MCP deprecated Roots in its July 2026 revision, so explicit project selection is the documented default rather than a dependency on client discovery.
Expand Down Expand Up @@ -145,8 +149,8 @@ The method and failures are documented so the measurements can be inspected with
- Retrieval measurements describe expected-file coverage, file precision, and reported `peakPrivateGb`, not patch correctness or end-to-end coding quality.
- The paired token observation covers two frozen investigation tasks and records observed agent behavior; it is not a universal token or time guarantee.
- Setup checks differ by client. The detailed guide distinguishes a written config, a config recognized by the client, a local connection, and instructions checked only against official docs.
- Published `2.2.0` has dedicated Angular, React and Next.js analyzers; NestJS support is in the newer source candidate. Other projects use the generic analyzer and the language parsers available for that stack.
- The default searchable-chunk limit is 5,000 per project. Larger repositories can raise it in `.codebase-context/config.json`.
- Published `2.4.0` has dedicated Angular, React, Next.js and NestJS analyzers. Other projects use the generic analyzer and the language parsers available for that stack.
- The default searchable-chunk limit is 5,000 per project. In `~/.codebase-context/config.json`, set `projects[].parsing.maxChunks` for a project that needs a higher limit.
- The agent must identify its repository in tool calls when no default or unambiguous client root is available. Concurrent HTTP client isolation is not established by the stdio routing checks.

## Reference
Expand Down
21 changes: 11 additions & 10 deletions docs/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ The server supports two transport modes:

| Mode | Command | MCP endpoint |
| ------------------- | ------------------------------------------------- | ---------------------------- |
| **stdio** (default) | `npx -y codebase-context@2.2.0` | Spawned process stdin/stdout |
| **HTTP** | `npx -y codebase-context@2.2.0 --http [--port N]` | `http://127.0.0.1:3100/mcp` |
| **stdio** (default) | `npx -y codebase-context@2.4.0` | Spawned process stdin/stdout |
| **HTTP** | `npx -y codebase-context@2.4.0 --http [--port N]` | `http://127.0.0.1:3100/mcp` |

HTTP defaults to `127.0.0.1:3100`. Override with `--port`, `CODEBASE_CONTEXT_PORT`, or `server.port` in `~/.codebase-context/config.json`.

Expand All @@ -20,13 +20,14 @@ Per-project config overrides supported today:
- `projects[].excludePatterns`: merged with the built-in exclusion set for that project at index time
- `projects[].analyzerHints.analyzer`: prefers a registered analyzer by name for that project and falls back safely when the name is missing or invalid
- `projects[].analyzerHints.extensions`: adds project-local source extensions for indexing and auto-refresh watching without changing defaults for other projects
- `projects[].parsing.maxChunks`: sets the maximum number of searchable chunks indexed for that project

Copy-pasteable client config templates are shipped in the package:

- `templates/mcp/stdio/.mcp.json` — stdio setup for `.mcp.json`-style clients
- `templates/mcp/http/.mcp.json` — HTTP setup for `.mcp.json`-style clients

Use Node.js 22 or newer with the published 2.2.0 commands shown here. For client registration recipes and their verification limits, see the [client setup guide](./client-setup.md).
Use Node.js 22 or newer with the published 2.4.0 commands shown here. For client registration recipes and their verification limits, see the [client setup guide](./client-setup.md).

## CLI Reference

Expand All @@ -49,15 +50,15 @@ For a command gallery with examples, see `docs/cli.md`.
| `memory add` | `--type`, `--category`, `--memory`, `--reason` | `remember` |
| `memory remove <id>` | — | — |

Commands that list `--json` above support raw JSON output. For MCP client registration, follow the [published client setup recipes](./client-setup.md); do not use the broken `init` setup command in published 2.2.0. Errors go to stderr with exit code 1.
Commands that list `--json` above support raw JSON output. For MCP client registration, follow the [published client setup recipes](./client-setup.md). The registration failures documented for `init` apply to published 2.2.0; see that guide for current 2.4.0 setup instructions. Errors go to stderr with exit code 1.

```bash
# Quick examples
npx -y codebase-context@2.2.0 status
npx -y codebase-context@2.2.0 search --query "auth middleware" --intent edit
npx -y codebase-context@2.2.0 refs --symbol "UserService" --limit 10
npx -y codebase-context@2.2.0 cycles --scope src/features
npx -y codebase-context@2.2.0 reindex --incremental
npx -y codebase-context@2.4.0 status
npx -y codebase-context@2.4.0 search --query "auth middleware" --intent edit
npx -y codebase-context@2.4.0 refs --symbol "UserService" --limit 10
npx -y codebase-context@2.4.0 cycles --scope src/features
npx -y codebase-context@2.4.0 reindex --incremental
```

## Tool Surface
Expand Down Expand Up @@ -301,6 +302,6 @@ Reproducible evaluation is shipped as a CLI entrypoint backed by shared scoring

- **Symbol refs are not a call-graph.** `get_symbol_references` counts identifier-node occurrences in the AST (comments/strings excluded via Tree-sitter). It does not distinguish call sites from type annotations, variable assignments, or imports. Full call-site-specific analysis (`call_expression` nodes only) is a roadmap item.
- **Impact is 2-hop max.** `computeImpactCandidates` walks direct importers then their importers. Full BFS reachability is on the roadmap.
- **Published 2.2.0 has dedicated Angular, React, and Next.js analyzers.** NestJS support is in a newer source candidate and is not part of published 2.2.0. Other languages use the Generic analyzer (30+ languages, chunking + import graph, no framework-specific signal extraction).
- **Published 2.4.0 has dedicated Angular, React, Next.js and NestJS analyzers.** Other languages use the Generic analyzer (30+ languages, chunking + import graph, no framework-specific signal extraction).
- **Default embedding model is `bge-small-en-v1.5` (512-token context).** Granite (8192 context) is opt-in via `EMBEDDING_MODEL`. OpenAI is opt-in via `EMBEDDING_PROVIDER=openai` — sends code externally.
- **Patterns are file-level frequency counts.** Not semantic clustering. Rising/Declining trend is derived from git commit recency for files using each pattern, not from usage semantics.
Loading
Loading