I was trying to understand how Claude Code tells the difference between normal human use and things like claude -p, Agent SDK, or automated agent runs. My current understanding is that it is not just the same flow with a different UI. Claude Code likely marks the run type internally: normal interactive terminal use, print/headless mode, SDK usage, web/delegated tasks, etc. That may be how different limits and usage buckets are applied. I also looked into how tools fit into this: shell, files, MCP, permissions, sessions, and web search all seem to go through the runtime rather than the model directly doing things. I wrote a short breakdown here: https://threatfrontier.com/articles/how-claude-code-works-internally-cli-startup-agentic-tool-execution Would love feedback from people who understand Claude Code deeply. Did I get the mental model right? submitted by /u/DetailPrestigious511
Originally posted by u/DetailPrestigious511 on r/ClaudeCode
