Skip to main content
Glama
kpkhxlgy0

claude-session-title

by kpkhxlgy0
README.md
# Claude Session Title for Claude++

[简体中文](README.zh-CN.md)

Rename a Claude Desktop session only when the user explicitly asks. This Main-only Tweak is for Claude Desktop; it does not add a tool to terminal Claude Code and has no Renderer settings page.

## Requirements

- Windows 10 or newer.
- Claude Desktop with [Claude++](https://github.com/kpkhxlgy0/claude-plusplus) Runtime `0.2.9` or newer.

Tweak Store users do not need Node.js or PowerShell. Source development requires Node.js 24 or newer and
[PowerShell 7](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows) or newer
(`pwsh`).

## Install and uninstall

The preferred installation path is Claude++'s reviewed Tweak Store:

1. Open Claude Desktop **Settings > Tweak Store**.
2. Find **Claude Session Title** and choose **Install**.
3. Restart Claude Desktop.

Use the Store page to update the Tweak. Use **Settings > Tweaks** to enable or disable it. To uninstall a Store copy,
disable it, exit Claude Desktop, choose **Open Tweaks Folder**, remove `com.kpk.claude-session-title`, and restart
Claude Desktop.

### Source development install

For a trusted source checkout, create only this Claude++ Tweak Junction, then restart Claude Desktop:

```powershell
pwsh -NoProfile -File .\Inject-ClaudePlusPlus.ps1 -CheckOnly
pwsh -NoProfile -File .\Inject-ClaudePlusPlus.ps1
```

Remove only this development Junction, then restart Claude Desktop:

```powershell
pwsh -NoProfile -File .\Uninject-ClaudePlusPlus.ps1 -CheckOnly
pwsh -NoProfile -File .\Uninject-ClaudePlusPlus.ps1
```

The scripts refuse to replace a real directory, symbolic link, or unsupported reparse point. Uninstall also refuses
to remove a Junction that points to another source. This path is intended for source development, not normal Store
installation.

## Tool contract

The Tweak registers exactly one Main MCP server and exposes:

```text
mcp__claudepp_session_title__set_session_title(
  session_id: string,
  title: string
)
```

Both arguments are required. `session_id` is always the explicit target. It may be a Desktop `local_*` manager key or
the Claude Code session UUID exposed inside the conversation. The Tweak does not rewrite the ID; it forwards both
strings and the genuine MCP call context to Runtime. Runtime `0.2.9` resolves a Claude Code UUID to its unique live
Desktop session and validates the resulting `local_*` manager key before updating it. Explicit IDs for other sessions
already known to Claude Desktop remain supported. Unknown or ambiguous IDs are rejected. The success response
identifies the requested session ID but never repeats the title text.

## Behavior and compatibility

- Claude Desktop persists the user title in its session metadata. The title remains after restart until it is renamed again.
- The Tweak consumes Claude++'s permission-scoped Main APIs only. It does not read or write Claude MCP configuration,
  `.mcp.json`, Claude settings, routes, hooks, IPC, or Tweak filesystem data. Its MCP server is hosted in memory.
- Runtime `0.2.9` is the exact minimum because it supplies the UUID-to-`local_*` resolution used by this release in
  addition to `api.mcp` and `api.claude.sessionTitles`. If either capability is absent, startup fails with upgrade
  guidance.
- Claude++'s private Claude Desktop adapter is version locked. Runtime `0.2.9` supports only the Desktop versions and
  private-module shapes declared by that Runtime. An unsupported Desktop version or private shape fails closed:
  Claude remains usable, but this tool is not injected and there is no configuration-writing fallback.

## Development

Run the standalone and Junction tests:

```powershell
npm test
npm run test:windows
```

Validate against a Claude++ `0.2.9` or newer source checkout:

```powershell
$TweakRoot = (Get-Location).Path
$ClaudePlusPlusRoot = (Resolve-Path ..\claude-plusplus).Path
Set-Location $ClaudePlusPlusRoot
node --import tsx `
  (Join-Path $TweakRoot "scripts/compatibility/validate-claudeplusplus.mjs") `
  $ClaudePlusPlusRoot $TweakRoot
```

Expected output (`runtime` is the tested source checkout version):

```text
claudeplusplus-compatibility=passed runtime=<host-version> tweak=0.1.2
```

## License

[MIT License](LICENSE)