Skip to content

docs: use "tmux" as the registration slug throughout - #40

Merged
tony merged 5 commits into
mainfrom
feature/docs-slug-consistency-tmux
May 9, 2026
Merged

tony merged 5 commits into
mainfrom
feature/docs-slug-consistency-tmux

Conversation

@tony

@tony tony commented May 8, 2026

Copy link
Copy Markdown
Member

Summary

docs/clients.md and the install widget were using libtmux as the registration slug while README.md recommends tmux. Followers of either doc would end up with mcp__tmux__* or mcp__libtmux__* tool prefixes depending on which page they read.

This PR aligns every doc to tmux:

  • docs/clients.md — 18 registration-slug libtmux → tmux (in claude mcp add, codex mcp add, gemini mcp add, JSON mcpServers.libtmux keys, TOML [mcp_servers.libtmux] key)
  • docs/_ext/widgets/mcp_install.py — 9 registration-slug occurrences in INSTALL_CMDS
  • tests/docs/test_widgets.py + snapshots — assertions and stored snapshots updated to expect the new tmux slug

The package name libtmux-mcp, the import libtmux_mcp, and the GitHub link are unchanged. Existing user registrations as libtmux keep working — the slug is a per-install user choice, not a property of the package. This change just recommends tmux for new installs.

Test plan

  • uv run ruff check . && uv run mypy && uv run py.test -q (428 passed; widget snapshot tests updated)
  • just build-docs

@codecov-commenter

codecov-commenter commented May 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.91%. Comparing base (390e842) to head (43a2832).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #40   +/-   ##
=======================================
  Coverage   84.91%   84.91%           
=======================================
  Files          40       40           
  Lines        2294     2294           
  Branches      294      294           
=======================================
  Hits         1948     1948           
  Misses        261      261           
  Partials       85       85           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tony
tony force-pushed the feature/docs-slug-consistency-tmux branch from 3f738ff to 27caa70 Compare May 9, 2026 10:35
@tony

tony commented May 9, 2026

Copy link
Copy Markdown
Member Author

Code review

No issues found. Re-checked the latest delta for bugs and AGENTS.md compliance.

Generated with Claude Code

@tony
tony force-pushed the feature/docs-slug-consistency-tmux branch from 27caa70 to b112e5c Compare May 9, 2026 12:02
@tony

tony commented May 9, 2026

Copy link
Copy Markdown
Member Author

Code review

No issues found. Re-checked the latest delta for bugs and AGENTS.md compliance.

Generated with Claude Code

tony added a commit that referenced this pull request May 9, 2026
why: PR #40 renames the recommended registration slug from `libtmux`
to `tmux` (matching `serverInfo.name`). Existing user installations
keep working, but users who want the new `mcp__tmux__*` tool prefix
need clear before/after instructions. Following the libtmux pattern
(~/work/python/libtmux/MIGRATION): a root MIGRATION file (no
extension) is the source of truth, included into the docs build via
docs/migration.md (added in the next commit).

what:
- New `MIGRATION` file at the repo root, no extension. Plain Markdown
  with MyST extensions so the future {include} from docs/migration.md
  renders cleanly under Sphinx.
- Welcome admonition with tracker link, mirroring libtmux's intro.
- Single section under "## libtmux-mcp 0.1.0a6 (unreleased)" for the
  slug rename. Before / After / What's unchanged subsections with
  4-space-indented shell examples (matches libtmux MIGRATION style).
- Confirms `claude mcp remove <name>` auto-detects scope (verified
  against `claude --version 2.1.138`), so migration commands work
  regardless of original registration scope.
@tony

tony commented May 9, 2026

Copy link
Copy Markdown
Member Author

Code review

Found 2 issues in the new `MIGRATION` file:

  1. Shell examples use 4-space-indented blocks instead of fenced `console` blocks (AGENTS.md — Shell Command Formatting: "Use `console` language tag with `$ ` prefix"; the "Bad" example explicitly includes plain indented blocks). When `MIGRATION` is `{include}`d into Sphinx via `docs/migration.md`, the indented blocks won't get the `console` highlighter Furo applies elsewhere.

libtmux-mcp/MIGRATION

Lines 37 to 48 in dfe6507

originally registered at `local`, `user`, or `project` scope.
#### Before
$ claude mcp add libtmux -- uvx libtmux-mcp
→ tools surface as `mcp__libtmux__list_panes`, `mcp__libtmux__send_keys`, …
#### After
$ claude mcp remove libtmux
$ claude mcp add tmux -- uvx libtmux-mcp

  1. The "After" section places two sequential commands in a single block (AGENTS.md — "One command per code block. This makes commands individually copyable."). `claude mcp remove libtmux` and `claude mcp add tmux -- uvx libtmux-mcp` are distinct commands and should each be in their own `console` block.

libtmux-mcp/MIGRATION

Lines 43 to 48 in dfe6507

→ tools surface as `mcp__libtmux__list_panes`, `mcp__libtmux__send_keys`, …
#### After
$ claude mcp remove libtmux
$ claude mcp add tmux -- uvx libtmux-mcp

Generated with Claude Code

If this code review was useful, please react with thumbs-up. Otherwise, react with thumbs-down.

tony added a commit that referenced this pull request May 9, 2026
why: PR #40 renames the recommended registration slug from `libtmux`
to `tmux` (matching `serverInfo.name`). Existing user installations
keep working, but users who want the new `mcp__tmux__*` tool prefix
need clear before/after instructions. Following the libtmux pattern
(~/work/python/libtmux/MIGRATION): a root MIGRATION file (no
extension) is the source of truth, included into the docs build via
docs/migration.md (added in the next commit).

what:
- New `MIGRATION` file at the repo root, no extension. Plain Markdown
  with MyST extensions so the future {include} from docs/migration.md
  renders cleanly under Sphinx.
- Welcome admonition with tracker link, mirroring libtmux's intro.
- Single section under "## libtmux-mcp 0.1.0a6 (unreleased)" for the
  slug rename. Before / After / What's unchanged subsections with
  4-space-indented shell examples (matches libtmux MIGRATION style).
- Confirms `claude mcp remove <name>` auto-detects scope (verified
  against `claude --version 2.1.138`), so migration commands work
  regardless of original registration scope.
@tony
tony force-pushed the feature/docs-slug-consistency-tmux branch from dfe6507 to ec304da Compare May 9, 2026 13:42
tony added a commit that referenced this pull request May 9, 2026
why: PR #40 renames the recommended registration slug from `libtmux`
to `tmux` (matching `serverInfo.name`). Existing user installations
keep working, but users who want the new `mcp__tmux__*` tool prefix
need clear before/after instructions. Following the libtmux pattern
(~/work/python/libtmux/MIGRATION): a root MIGRATION file (no
extension) is the source of truth, included into the docs build via
docs/migration.md (added in the next commit).

what:
- New `MIGRATION` file at the repo root, no extension. Plain Markdown
  with MyST extensions so the future {include} from docs/migration.md
  renders cleanly under Sphinx.
- Welcome admonition with tracker link, mirroring libtmux's intro.
- Single section under "## libtmux-mcp 0.1.0a6 (unreleased)" for the
  slug rename. Before / After / What's unchanged subsections with
  4-space-indented shell examples (matches libtmux MIGRATION style).
- Confirms `claude mcp remove <name>` auto-detects scope (verified
  against `claude --version 2.1.138`), so migration commands work
  regardless of original registration scope.
@tony
tony force-pushed the feature/docs-slug-consistency-tmux branch from ec304da to bb1c635 Compare May 9, 2026 14:03
@tony
tony changed the base branch from main to pane-discoverability May 9, 2026 14:03
tony added a commit that referenced this pull request May 9, 2026
Bare *"pane"* / *"window"* / *"session"* prompts now reliably
activate libtmux-mcp without the user having to say "tmux". This
ships three orthogonal activation levers: a `_INSTR_SCOPE`
instruction segment that names positive triggers and explicit
anti-triggers, a buried-synonym pass on six discovery-anchor
docstrings so the BM25 corpus indexes terminal-vocabulary, and
per-tool `anthropic/alwaysLoad: true` meta hints on the three
high-traffic read-only anchors.

**Activation rule** — `_INSTR_SCOPE` names positive triggers
(`pane`, `split`, `scrollback`, `%`/`@`/`$` IDs) and explicit
anti-triggers (browser windows/tabs, editor panes, GUI
workspaces, Jupyter cells, login/HTTP sessions). The full
transmitted `instructions=` re-fits Claude Code's 2KB ceiling
across all safety tiers and both `$TMUX_PANE` configurations.

**BM25 corpus widening** — six discovery-anchor docstrings
(`list_panes`, `list_windows`, `list_sessions`, `snapshot_pane`,
`search_panes`, `capture_pane`) gain tmux-vocabulary synonyms
(terminal, shell, scrollback, multiplexer, workspace) plus
inline anti-triggers. Both sentences land in the indexed corpus
via FastMCP's griffe parser.

**Per-tool alwaysLoad** — `list_panes`, `list_windows`, and
`snapshot_pane` carry `anthropic/alwaysLoad: true` per-tool
hints (Claude Code v2.1.121+). Best-effort, opaque pass-through
in FastMCP; safe no-op for clients that don't honor the field.

**Server identity** — `serverInfo.name` is now `tmux` (was
`libtmux`), aligning with the recommended registration slug
from PR #40.

**HOOKS_GAP rationale** — `_INSTR_HOOKS_GAP` restores the
"survive process death" causal phrase so the read-only-hooks
rule reads as a correctness boundary rather than a soft
preference.

**Tests** — transmitted `instructions=` length is gated across
all (tier × tmux_pane) combinations including a variable-length
stress case (longer socket name + multi-digit pane id); SCOPE,
HOOKS, and discovery-anchor substrings pinned to their
respective `_INSTR_*` segments to catch refactor drift.
Base automatically changed from pane-discoverability to main May 9, 2026 14:22
tony added a commit that referenced this pull request May 9, 2026
why: PR #40 renames the recommended registration slug from `libtmux`
to `tmux` (matching `serverInfo.name`). Existing user installations
keep working, but users who want the new `mcp__tmux__*` tool prefix
need clear before/after instructions. Following the libtmux pattern
(~/work/python/libtmux/MIGRATION): a root MIGRATION file (no
extension) is the source of truth, included into the docs build via
docs/migration.md (added in the next commit).

what:
- New `MIGRATION` file at the repo root, no extension. Plain Markdown
  with MyST extensions so the future {include} from docs/migration.md
  renders cleanly under Sphinx.
- Welcome admonition with tracker link, mirroring libtmux's intro.
- Single section under "## libtmux-mcp 0.1.0a6 (unreleased)" for the
  slug rename. Before / After / What's unchanged subsections with
  4-space-indented shell examples (matches libtmux MIGRATION style).
- Confirms `claude mcp remove <name>` auto-detects scope (verified
  against `claude --version 2.1.138`), so migration commands work
  regardless of original registration scope.
@tony
tony force-pushed the feature/docs-slug-consistency-tmux branch from bb1c635 to d6099d6 Compare May 9, 2026 14:25
tony added 5 commits May 9, 2026 10:07
why: README's recommended registration slug is `tmux` (matches what
users actually think — "the tmux MCP"), but `docs/clients.md` and the
install-widget were using `libtmux`. Followers of either doc would end
up with `mcp__tmux__*` or `mcp__libtmux__*` tool prefixes depending on
which page they read. Aligning every doc to `tmux` removes the
papercut.

what:
- docs/clients.md: 18 registration-slug `libtmux` -> `tmux` (in
  `claude mcp add ...`, `codex mcp add ...`, `gemini mcp add ...`,
  JSON `mcpServers.libtmux` keys, TOML `[mcp_servers.libtmux]` key).
  Package name `libtmux-mcp`, module `libtmux_mcp`, and GitHub link
  unchanged.
- docs/_ext/widgets/mcp_install.py: 9 registration-slug occurrences
  in INSTALL_CMDS dict updated to `tmux`. `pip install libtmux-mcp`
  lines unchanged.
- tests/docs/test_widgets.py + snapshots: assertions and stored
  snapshots updated to expect the new `tmux` slug.

note: existing user registrations as `libtmux` keep working — the
slug is a per-install user choice, not a property of the package.
This change recommends `tmux` for new installs.
why: PR #40 renames the recommended registration slug from `libtmux`
to `tmux` (matching `serverInfo.name`). Existing user installations
keep working, but users who want the new `mcp__tmux__*` tool prefix
need clear before/after instructions. Following the libtmux pattern
(~/work/python/libtmux/MIGRATION): a root MIGRATION file (no
extension) is the source of truth, included into the docs build via
docs/migration.md (added in the next commit).

what:
- New `MIGRATION` file at the repo root, no extension. Plain Markdown
  with MyST extensions so the future {include} from docs/migration.md
  renders cleanly under Sphinx.
- Welcome admonition with tracker link, mirroring libtmux's intro.
- Single section under "## libtmux-mcp 0.1.0a6 (unreleased)" for the
  slug rename. Before / After / What's unchanged subsections with
  4-space-indented shell examples (matches libtmux MIGRATION style).
- Confirms `claude mcp remove <name>` auto-detects scope (verified
  against `claude --version 2.1.138`), so migration commands work
  regardless of original registration scope.
why: the root MIGRATION file is the source of truth, but it needs a
docs entry point so users can navigate to it from the docs sidebar.
Mirrors libtmux's two-file pattern (~/work/python/libtmux/docs/migration.md):
a thin MyST wrapper that {include}s the root file. The (migration)=
anchor is what other docs pages cross-reference to.

what:
- New `docs/migration.md` (5 lines): MyST anchor + ``{include}``
  directive pulling in `../MIGRATION`. No content of its own; the
  authoritative source is the root MIGRATION file.
- Sphinx warns "document isn't included in any toctree" until the
  next commit wires it in. Build still succeeds.
why: Commit 2's docs/migration.md page is unreachable until it lives
in the docs sidebar nav. And the migration {note} I added earlier in
docs/clients.md duplicates content that now lives on the dedicated
migration page. Replace the inline admonition with a one-line
cross-reference so docs/clients.md stays focused on setup
instructions and migration content lives in one place.

what:
- docs/index.md: add `migration` to the "Project" caption toctree
  between `history` and the GitHub link, mirroring libtmux's
  placement (~/work/python/libtmux/docs/index.md). The Sphinx
  toc.not_included warning from Commit 2 clears.
- docs/clients.md: replace the 9-line {note} admonition with a
  one-line ``{ref}``-style cross-reference: "See {ref}`migration`
  for the recommended `tmux` registration slug (existing `libtmux`
  registrations keep working)." The migration anchor was added in
  Commit 2.
Adds an unreleased "What's new" bullet covering the
libtmux→tmux registration slug recommendation across docs
and the new MIGRATION root file + docs/migration.md wrapper.
@tony
tony force-pushed the feature/docs-slug-consistency-tmux branch from d6099d6 to 43a2832 Compare May 9, 2026 15:08
@tony
tony merged commit 36eaf35 into main May 9, 2026
9 checks passed
tony added a commit that referenced this pull request May 9, 2026
User-facing companion documentation for the activation work shipped
by #37 and the slug rename shipped by #40. The mechanism (`alwaysLoad`
meta on three discovery anchors, BM25 description tuning,
`serverInfo.name="tmux"`, the `libtmux` → `tmux` slug recommendation)
already lives on main; this PR adds the prose that explains how to
leverage it.

- **Activation and discovery section** in {ref}`prompting`: positive
  triggers (*"split this pane"*, *"current window"*, *"this session"*)
  vs. anti-triggers (browser, editor split, i3/Hyprland, Jupyter),
  with the agent asking when phrasing is ambiguous.
- **Always-on tool listing (Claude Code only)**: the `alwaysLoad:
  true` JSON snippet at server-entry level for users who want every
  schema preloaded (Claude Code v2.1.121+). ~3-5K token permanent
  context cost noted — recommended only if libtmux-mcp is among
  your top-3 most-used MCPs.
- **Project-bias template** under the existing "System prompt
  fragments" section. `AGENTS.md` / `CLAUDE.md` / equivalent project
  files compose into the system prompt above the server's
  `instructions=` block, making this the highest-leverage user-side
  lever for *"current window"* / *"this session"* anaphora.

The inside-tmux \`\$TMUX_PANE\` auto-detection note is not duplicated —
{ref}\`concepts\` "Agent self-awareness" already covers it and is
cross-referenced.

See also: #37 (activation mechanism), #40 (slug rename to \`tmux\`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants