Skip to content

Add next-step hints to guide users through command chains#241

Open
jancurn wants to merge 7 commits into
mainfrom
claude/setup-mcp-servers-RTwDl
Open

Add next-step hints to guide users through command chains#241
jancurn wants to merge 7 commits into
mainfrom
claude/setup-mcp-servers-RTwDl

Conversation

@jancurn
Copy link
Copy Markdown
Member

@jancurn jancurn commented May 20, 2026

Summary

This PR adds contextual "next-step hints" to command output, helping users and AI agents discover the natural next command to run without consulting --help. Hints are printed as dim text with an arrow prefix and only appear in human-readable mode (not in --json output).

Changes

  • CLAUDE.md: Added new guideline ExperimentalWarning: Importing JSON modules is an experimental feature #2 "Next-step hints" documenting the pattern and rationale. Renumbered subsequent guidelines accordingly.
  • src/cli/commands/sessions.ts:
    • Added hint after listing sessions: ↳ view a session: mcpc @sessionname
    • Added hint after skipping stdio servers during connect: ↳ run: mcpc connect --stdio
    • Removed redundant inline text "pass --stdio to include" from the skip message, replacing it with the structured hint
  • README.md: Added runtime requirement note clarifying that Node.js ≥18 or Bun ≥1 is required.

Implementation Details

  • Hints use chalk.dim() for subtle styling and the arrow prefix for visual consistency
  • Hints are only emitted in human-readable mode; --json output remains strictly machine-readable
  • The pattern makes it easy for both users and AI agents to chain commands naturally without external documentation

https://claude.ai/code/session_015wCgMKyoa4kMuvHiqdo5JY

claude and others added 7 commits May 20, 2026 20:16
- Add `↳ view a session: mcpc @sessionname` hint after listing sessions
  in `mcpc` (no args), so users and agents see what to do next.
- Move `pass --stdio to include` out of the `mcpc connect` summary line
  into a dedicated `↳ run: mcpc connect --stdio` hint, matching the
  unauthorized/expired-session hint style.
- Document the convention as a new "Next-step hints" principle in
  CLAUDE.md.
Adds a one-liner before the install snippet pointing newbies to
nodejs.org and bun.sh so they don't have to figure out where to get
the runtime first.
Previously the hint was placed directly after the sessions list,
where its 2-space indent collided visually with the 4-space recovery
hints under each session (e.g. `↳ run: mcpc @test restart`), making
it look like a per-session hint rather than a global one.

Now `listSessionsAndAuthProfiles` returns `hasSessions`, and the
caller prints the view-session hint immediately above the existing
`Run "mcpc --help"...` line — visually grouped with the global
footer instead of nested inside the session list.
- Rephrase the view-session hint to match the existing `Run "..."`
  footer line: `Run "mcpc @sessionname" to view session details.`
  sits naturally next to `Run "mcpc --help" for usage information.`
- Fix `formatTimeAgo` to use singular form when the count is 1:
  `1 week ago` / `1 month ago` instead of `1 weeks ago` /
  `1 months ago`.
Aligns the two footer lines with the existing `To X, run: ...` /
`For X, run: ...` pattern used in tasks.ts, helpers.ts,
bridge-manager.ts, and errors.ts:

  To view server info and capabilities, run: mcpc @session
  For usage information, run: mcpc --help
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.

3 participants