client.py: send() falls back to ResultMessage.result when no TextBlock streams
(the "(no response)" bug) and reconnects+retries once on a closed SDK session.
message_handler.py: per-thread turn lock so messages arriving mid-turn or from a
second user queue in order (nothing dropped); per-session requester-attribution
env (discord_id -> users.json key), pinned to the thread opener; _USER_MAP caches
only on a successful load; final answer posts as a fresh message at the BOTTOM
(no edit-in-place); a <@id> tag goes out as a fresh send so it actually pings.
main.py: allowed_mentions permits user pings, blocks @everyone/@here/roles.
DISCORD_CLAUDE.md: no thread auto-delete; tiered close-out (Q&A -> one-line rolling
log, substantive -> /save); @mention guidance; opener-pinned attribution note.
whoami-block.sh / sync.sh: bot-context attribution (Executed by ClaudeTools Bot /
Requested by <person>; git author = mapped requester, committer = bot). Strict
no-op for interactive sessions.
users.json: discord_id for Mike/Howard; added Winter Williams (bot-only, full trust).
Reviewed by Code Review Agent + Grok + Gemini (Gemini's "malformed email" finding
verified as a false positive).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Add DISCORD_CLAUDE.md as the Discord bot's dedicated system prompt,
replacing the main CLAUDE.md for bot sessions. Covers: no-interactive
rules, Discord user authorization, vault/remediation guidance, /save
after every task, and formatting rules for Discord.
- config.py: add discord_system_prompt field (default: projects/discord-bot/
DISCORD_CLAUDE.md, overridable via env var).
- client.py: _load_system_prompt() now loads discord_system_prompt path
with fallback to CLAUDE.md if file is missing.
- message_handler.py: inject [DISCORD_CONTEXT] header into every agent
message containing Discord username, display name, user ID, channel,
and guild so the agent always knows who is asking.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>