dotfiles/agents/backend-hint.sh
mwiegand ba6f7521a1
feat(agents): git and communication rules from memory, backend hint hook
- Git section carries the rules that lived in auto-memory: push and PRs
  without asking, no --amend or stash pop with parallel sessions, absolute
  commit-message path, readable PR branches, push unsandboxed
- External communication: no notice on automated texts, terse PR replies,
  local time in chat
- Model selection: opus for research and judgement work; rule 0 for the
  self-hosted backend, fed by agents/backend-hint.sh as a SessionStart hook
  (prints a context line only when ANTHROPIC_BASE_URL is the vLLM gateway)

Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UH8jPP1zXteddiR9pEd4KE
2026-10-09 22:50:19 +02:00

11 lines
642 B
Bash
Executable file

#!/bin/sh
# SessionStart hook: tell the agent when the session runs against the self-hosted
# vLLM gateway, where model aliases (sonnet, opus, haiku) do not exist.
# Prints nothing on Anthropic/Vertex so the default rules apply.
case "${ANTHROPIC_BASE_URL:-}" in
*vllm*|*seibert.tools*)
model="${ANTHROPIC_MODEL:-${CLAUDE_CODE_SUBAGENT_MODEL:-the configured model}}"
printf '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":"Self-hosted backend (%s): only %s is available. Never pass a model override to Agent calls; all subagents inherit this model."}}\n' "$ANTHROPIC_BASE_URL" "$model"
;;
esac
exit 0