Skip to content

Commit c6b2750

Browse files
committed
Improve Claude Code connection instructions, adding a paragraph on max token efficiency
1 parent c569212 commit c6b2750

1 file changed

Lines changed: 22 additions & 8 deletions

File tree

docs/02-usage/030_clients.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ object, e.g.
7575

7676
Serena is a great way to make Claude Code both cheaper and more powerful!
7777

78-
From your project directory, add serena with a command like this,
78+
**Per-Project Configuration.** To add the Serena MCP server to the current project in the current directory,
79+
use this command:
7980

8081
```shell
8182
claude mcp add serena -- uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context claude-code --project "$(pwd)"
@@ -88,18 +89,31 @@ Note:
8889
that Serena is configured to work on the current project from the get-go, following
8990
Claude Code's mode of operation.
9091

91-
Alternatively, use `--project-from-cwd` for user-level configuration that works across all projects:
92+
**Global Configuration**. Alternatively, use `--project-from-cwd` for user-level configuration that works across all projects:
9293

9394
```shell
9495
claude mcp add --scope user serena -- <serena> start-mcp-server --context=claude-code --project-from-cwd
9596
```
9697

97-
This searches up from the current directory for `.serena/project.yml` or `.git` markers,
98-
falling back to the current directory if neither is found. This makes it suitable for a
99-
single global MCP configuration. The `--project-from-cwd` option is intended for CLI-based agents
100-
(like Claude Code, Gemina or Codex) that invoke Serena from within project directories.
101-
102-
Be sure to use at least `v1.0.52` of Claude Code (as earlier versions do not read MCP server system prompts upon startup).
98+
Whenever you start Claude Code, Serena will search up from the current directory for `.serena/project.yml` or `.git` markers,
99+
activating the current directory as the project if neither is found.
100+
This mechanism makes it suitable for a single global MCP configuration.
101+
102+
**Maximum Token Efficiency.** To maximize token efficiency, you may want to use Claude Code's
103+
*on-demand tool loading* feature, which is supported since at least v2.0.74 of Claude Code.
104+
This feature avoids sending all tool descriptions to Claude upon startup, thus saving tokens.
105+
Instead, Claude will search for tools as needed (but there are no guarantees that it will
106+
search optimally, of course).
107+
To enable this feature, set the environment variable `ENABLE_TOOL_SEARCH=true`.
108+
Depending on your shell, you can also set this on a per-session basis, e.g. using
109+
```shell
110+
ENABLE_TOOL_SEARCH=true claude
111+
```
112+
in bash/zsh, or using
113+
```shell
114+
set ENABLE_TOOL_SEARCH=true && claude
115+
```
116+
in Windows CMD to launch Claude Code.
103117

104118
## VSCode
105119

0 commit comments

Comments
 (0)