Skip to content

docs(prompting): activation, alwaysLoad, and project-bias template - #39

Merged
tony merged 2 commits into
mainfrom
feature/readme-trigger-prose
May 9, 2026
Merged

tony merged 2 commits into
mainfrom
feature/readme-trigger-prose

Conversation

@tony

@tony tony commented May 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Documents activation/discovery behavior in the existing agent prompting guide (docs/topics/prompting.md):

  • Positive triggers / anti-triggers prose — when the agent reaches for libtmux-mcp on bare "split this pane" / "current window" / "this session" and when it stays out of the way (browser, editor split, i3/Hyprland, Jupyter)
  • Always-on tool listing (Claude Code only) — the alwaysLoad: true JSON snippet at the server-entry level (Claude Code v2.1.121+) for users who want all 51 schemas preloaded; ~3-5K token cost noted
  • Project-level activation-bias template — added to the existing "System prompt fragments" section. Notes that AGENTS.md / CLAUDE.md / equivalent project-instructions files compose into the system prompt at higher priority than the MCP server's instructions= block, making this the highest-leverage user-side lever for "current window" anaphora

The inside-tmux $TMUX_PANE auto-detection note is not duplicated — it's already covered by docs/topics/concepts.md "Agent self-awareness" and is cross-referenced.

The server-side mechanism (alwaysLoad meta hint on three discovery anchors, BM25 description tuning, serverInfo.name="tmux") lives on PR #37 (pane-discoverability). This PR is the user-facing companion documentation; merge after #37 so the prose describes shipped behavior.

Test plan

  • uv run ruff check . && uv run mypy && uv run py.test -q (428 passed)
  • just build-docs (50 warnings — matches origin/main baseline; no new warnings from {ref}concepts or {toolref}... cross-references)

@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 (36eaf35) to head (2ea6203).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #39   +/-   ##
=======================================
  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/readme-trigger-prose branch from 0e9c7c3 to bd8e9c4 Compare May 9, 2026 12:04
@tony

tony commented May 9, 2026 •

Copy link
Copy Markdown
Member Author

Code review

Retracted. This comment was based on a hallucinated finding. The local claude mcp remove --help (CLI v2.1.138) confirms:

-s, --scope <scope> Configuration scope (local, user, or project) — if not specified, removes from whichever scope it exists in.

The CLI auto-detects the scope, so the migration command does not silently no-op. Apologies for the noise.

The migration paragraph the comment referred to has also been removed from the README in the latest fixup; migration content will live in a dedicated MIGRATION.md / docs/migration.md follow-up.

Generated with Claude Code

@tony
tony force-pushed the feature/readme-trigger-prose branch 2 times, most recently from 899ea9c to 38abd46 Compare May 9, 2026 13:00
@tony tony changed the title README: "When does my agent use this?" section docs(prompting): activation, alwaysLoad, and project-bias template May 9, 2026
@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/readme-trigger-prose branch from 38abd46 to c9b4127 Compare May 9, 2026 14:04
@tony
tony changed the base branch from main to feature/docs-slug-consistency-tmux May 9, 2026 14:04
@tony
tony force-pushed the feature/docs-slug-consistency-tmux branch from bb1c635 to d6099d6 Compare May 9, 2026 14:25
@tony
tony force-pushed the feature/readme-trigger-prose branch from c9b4127 to ec74b07 Compare May 9, 2026 14:26
@tony
tony force-pushed the feature/docs-slug-consistency-tmux branch from d6099d6 to 43a2832 Compare May 9, 2026 15:08
@tony
tony force-pushed the feature/readme-trigger-prose branch from ec74b07 to 12e8fce Compare May 9, 2026 15:10
tony added a commit that referenced this pull request May 9, 2026
Earlier docs and the install widget recommended registering this
server as `libtmux`. Going forward the recommended slug is `tmux`,
matching `serverInfo.name` returned in the MCP handshake and the
`mcp__tmux__*` tool prefix that clients namespace tool calls under.
Existing `libtmux` registrations continue to work — the slug is a
per-install user choice.

- **Install widget + {ref}`clients` page**: every CLI snippet and
  JSON example now shows `tmux` as the slug. AGENTS.md examples
  follow.
- **New {ref}`migration` page**: root `MIGRATION` file with a
  Sphinx wrapper at `docs/migration.md`, wired into the toctree.
  Documents the rename and serves as the home for future migration
  notes. {ref}`clients` cross-references it.
- **`mcp_swap.py` retains `libtmux` as default**: existing local-
  development users keep `mcp_swap use-local` working in place.
  Pass `--server tmux` to target a fresh-install registration.
  Behavior is documented in `resolve_repo_meta`'s docstring and
  in `test_resolve_repo_meta_strips_mcp_suffix`.

What's unchanged: PyPI package name (`libtmux-mcp`), Python module
(`libtmux_mcp`), and existing `mcp__libtmux__*` references in
template files / agent histories — all continue to work for users
who keep the `libtmux` slug.

See also: #37 (the `serverInfo.name="tmux"` change this slug
recommendation aligns with), #39 (prompting-guide companion docs).
tony added 2 commits May 9, 2026 10:29
why: the most-frequent question this server gets is "when does the
agent actually pick libtmux-mcp on bare 'pane' / 'window' / 'session'
without me saying tmux?". The existing docs/topics/prompting.md
covers server-injected instructions and prompt patterns but didn't
explicitly answer the activation/discovery question or document the
Claude Code-specific `alwaysLoad` lever.

This belongs alongside the other prompting guidance, not in the
README. The README stays focused on quickstart + setup; the agent
prompting guide is where activation mechanics, alwaysLoad opt-in,
and project-instructions templates live.

what:
- New "## Activation and discovery" section in docs/topics/prompting.md
  with positive/anti-trigger prose and an "Always-on tool listing"
  subsection covering the Claude Code v2.1.121+ `alwaysLoad: true`
  JSON snippet and its ~3-5K token cost.
- New "### To bias activation on bare 'pane' / 'window' / 'session'"
  template under the existing "## System prompt fragments" section.
  Notes that AGENTS.md / CLAUDE.md / equivalent project-instructions
  files compose into the system prompt at higher priority than the
  MCP server's `instructions` block.
- Cross-reference to the existing concepts.md "Agent self-awareness"
  section for the inside-tmux $TMUX_PANE auto-detection note —
  avoids duplicating content already in the docs.
- {toolref}`...` markers used for tool references so they resolve to
  rendered tool docs in Sphinx.
Adds an unreleased "Documentation" bullet for the new
"Activation and discovery" section in docs/topics/prompting.md
and the project-bias template under "System prompt fragments".
@tony
tony force-pushed the feature/readme-trigger-prose branch from 12e8fce to 2ea6203 Compare May 9, 2026 15:29
@tony
tony changed the base branch from feature/docs-slug-consistency-tmux to main May 9, 2026 15:29
@tony
tony merged commit 5730d12 into main May 9, 2026
11 checks passed
tony added a commit that referenced this pull request Aug 22, 2026
why: pygments 2.21.0 makes HtmlFormatter render `"` and `'` literally
instead of `&quot;` and `&#39;` (pygments#3185), so the recorded
fragment for the uvx MCP config stopped matching. This lands as its own
commit because the dev-package refresh that raised pygments does not
mention it: the failure surfaced after that commit was already pushed.

Comparing the two revisions line by line, every difference is exactly
that one substitution - same tokens, same span classes, same
whitespace, four lines. Rendered output is unchanged, since inside
element text content `"` and `&quot;` are equivalent; the escaping was
only ever required inside attribute values.

Verified by pinning pygments back to 2.20.0, where the old snapshot
passes, and forward to 2.21.0, where only this substitution differs.

what:
- Re-record highlight_json-mcp-config-uvx against pygments 2.21.0

See also: pygments/pygments#3185
tony added a commit that referenced this pull request Aug 27, 2026
why: pygments 2.21.0 makes HtmlFormatter render `"` and `'` literally
instead of `&quot;` and `&#39;` (pygments#3185), so the recorded
fragment for the uvx MCP config stopped matching. This lands as its own
commit because the dev-package refresh that raised pygments does not
mention it: the failure surfaced after that commit was already pushed.

Comparing the two revisions line by line, every difference is exactly
that one substitution - same tokens, same span classes, same
whitespace, four lines. Rendered output is unchanged, since inside
element text content `"` and `&quot;` are equivalent; the escaping was
only ever required inside attribute values.

Verified by pinning pygments back to 2.20.0, where the old snapshot
passes, and forward to 2.21.0, where only this substitution differs.

what:
- Re-record highlight_json-mcp-config-uvx against pygments 2.21.0

See also: pygments/pygments#3185
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