Files
nanoclaw/container/agent-runner/src/mcp-tools/core.instructions.md
gavrielc d2f53048f2 docs(module-fragments): add instructions for create_agent, interactive, and remaining core tools
Three MCP tool groups were orphaned from the ambient CLAUDE.md context
because they shipped no `*.instructions.md` alongside their source.
Backfill them so the composer picks them up as fragments on next spawn:

- core.instructions.md: add `send_file` (artifact delivery, path relative
  to /workspace/agent/) and `add_reaction` (by `#N` id with emoji
  shortcode name).
- interactive.instructions.md: `ask_user_question` (blocking
  multiple-choice with selectedLabel/value option objects, 300s default
  timeout) and `send_card` (non-blocking structured render with
  fallbackText). Opens with a one-line framing of the contrast between
  the two.
- agents.instructions.md: `create_agent` with how-it-works, when-to-use
  (companions vs collaborators — persistent memory vs independent
  parallel work), when-NOT-to-use (short tasks should use the SDK `Agent`
  tool instead), and guidance for writing the seed instructions string.

No composer changes — scan in `src/claude-md-compose.ts` already picks up
any file matching `*.instructions.md` in the mcp-tools directory.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 18:05:50 +03:00

2.3 KiB

Sending messages

Your final response is delivered via the ## Sending messages rules in your runtime system prompt (single-destination: just write; multi-destination: use <message to="name">...</message> blocks). See that section for the current destination list.

Mid-turn updates (send_message)

Use the mcp__nanoclaw__send_message tool to send a message while you're still working (before your final output). If you have one destination, to is optional; with multiple, specify it. Pace your updates to the length of the work:

  • Short turn (≤2 quick tool calls): Don't narrate. Output any response.
  • Longer turn (multiple tool calls, web searches, installs, sub-agents): Send a short acknowledgment right away ("On it, checking the logs now") so the user knows you got the message.
  • Long-running turns (long-running tasks with many stages): Send periodic updates at natural milestones, and especially before slow operations like spinning up an explore sub-agent, downloading large files, or installing packages.

Never narrate micro-steps. "I'm going to read the file now… okay, I'm reading it… now I'm parsing it…" is noise. Updates should mark meaningful transitions, not every tool call.

Outcomes, not play-by-play. When the turn is done, the final message should be about the result, not a transcript of what you did.

Sending files (send_file)

Use mcp__nanoclaw__send_file({ path, text?, filename?, to? }) to deliver a file from your workspace. path is absolute or relative to /workspace/agent/; filename overrides the display name shown in chat (defaults to the file's basename); text is an optional accompanying message. Use this for artifacts you produce (charts, PDFs, generated images, reports) rather than dumping contents into chat.

Reacting to messages (add_reaction)

Use mcp__nanoclaw__add_reaction({ messageId, emoji }) to react to a specific inbound message by its #N id — pass messageId as an integer (e.g. 22, not "22"). Good for lightweight acknowledgment (eyes = seen, white_check_mark = done) when a full reply would be noise. emoji is the shortcode name (e.g. thumbs_up, heart), not the raw character.

Internal thoughts

Wrap reasoning in <internal>...</internal> tags to mark it as scratchpad — logged but not sent.