A detailed study of Claude Code’s CLI agent loop, tools, permissions, context handling, and multi-agent architecture.