omrylcn

Claude Code Workflow — Productivity skill for Claude Code

Productivity community

Deep technical analysis of Claude Code CLI internals — how the agentic loop, tool execution, sub-agents, and 50+ tools work under the hood.

How to install Claude Code Workflow

This entry records only its repository, not the path inside it, so there is no exact command to give. Open omrylcn/claude-code-workflow and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Code Workflow does

Deep technical analysis of Claude Code CLI internals — how the agentic loop, tool execution, sub-agents, and 50+ tools work under the hood. Based on the publicly available source code.

Alternatives in Productivity

  • Getting Help — career-ops is an open source project maintained in limited time 32.5k ★
  • P7 — PUA P7 骨干模式 — 方案驱动执行 19.5k ★
  • Cs2 Technical Analysis — You are an Expert 3D Technical Director specialized in CS2 (Counter-Strike 2) weapon and item pipelines 14.1k ★

README

Claude Code Workflow — Deep Source Code Analysis

A comprehensive, line-by-line technical analysis of [nirholas/claude-code](https://github.com/nirholas/claude-code) — the publicly available source code of Anthropic's Claude Code CLI. From the moment you type `claude` in your terminal to the final response — every function call, every design decision, every architectural pattern documented.

sequenceDiagram
    participant U as User
    participant R as REPL
    participant QG as QueryGuard
    participant CTX as Context (memoized)
    participant Q as queryLoop()
    participant API as Anthropic API
    participant STE as StreamingToolExecutor
    participant T as Tool (Read/Edit/Bash)
    participant INK as Ink Terminal

    U->>R: Enter (sends message)
    R->>R: onSubmit() — slash command? empty?
    R->>R: processUserInput() — String → Message[]
    R->>QG: tryStart()
    
    alt Busy
        QG-->>R: null → enqueue
    else Available
        QG-->>R: generation (OK)
    end

    R->>CTX: Promise.all([systemPrompt, userContext, systemContext])
    CTX-->>R: Memoized results (computed on first query)

    rect rgb(66, 133, 244)
        Note over Q,API: while(true) — Agentic Loop

        R->>Q: query({ messages, systemPrompt, tools })
        Q->>Q: Compaction: snip → micro → collapse → auto
        Q->>API: HTTP POST (stream: true, 50+ tool, thinking)
    end

    rect rgb(52, 168, 83)
        Note over API,INK: Streaming — Tokens flow

        loop Token stream
            API-->>Q: thinking/text/tool_use chunk
            Q-->>R: yield event
            R-->>INK: setMessages → re-render
            INK-->>U: Terminal updates
        end
    end

    rect rgb(234, 67, 53)
        Note over STE,T: Tool Execution — Starts while model is writing

        opt If model sent tool_use
            Q->>STE: addTool(block) — start immediately
            STE->>STE: canUseTool() — permission check
            STE->>T: tool.call(input)
            T-->>STE: