The tool line was already written when the login failed. A project file at .claude/agents/reviewer.md set tools: Read. A headless claude --print against that directory exited 1. The JSON result said is_error true, subtype success, terminal_reason api_error, and result Not logged in ยท Please run /login. The session file written before that result already contained this listing line:
- reviewer: Reviews a single file and returns a one-line verdict. Use when asked to review probe.txt. (Tools: Read)
The same name, passed as --agents JSON with a description and a prompt and no tools field, replaced that line with reviewer: JSON reviewer (Tools: All tools). Adding "tools": ["Read"] put Tools: Read back, and a second JSON name appeared beside it as Tools: All tools. --agent reviewer did not print a listing line at all. It made the markdown body the session system prompt, kept Read, and dropped Agent, Bash, Edit, and Write from the request.