TRILHA 4

🖥️ The Interface

Domine o rendering engine Ink, o sistema de comandos, dialogs, notificacoes, vim mode, keybindings, fullscreen e o sistema de temas do Claude Code.

8
Modulos
~48
Topicos
~6h
Duracao
Avancado
Nivel

Navegacao Rapida

4.1 ~50 min

Ink Renderer

O pipeline de rendering de 7 estagios que converte arvores de componentes React em output de terminal com performance de microsegundos.

1
🔄 React Reconciler & Virtual DOM
Custom reconciler, ink-virtual-text, dirty flags
2
📐 Yoga Layout Engine
WebAssembly Flexbox, index mismatch
3
🎨 renderNodeToOutput & Output Queue
Blit fast path, command buffer, two-pass replay
4
💾 Packed Screen Buffer
Int32Array, StylePool, wide characters
5
🔍 Cell Diff & Terminal Output
Damage box diff, minimal ANSI sequences
6
💎 Key Design Patterns
7 takeaways do rendering pipeline
Ver Completo
4.2 ~40 min

Commands System

Tres tipos de slash commands, pipeline de registro, processamento de input e integracao com o REPL.

1
📋 Three Command Types
Local, Local JSX, Prompt commands
2
📦 Registration Pipeline
4 skill sources, 2 independent gates
3
🐚 Shell Command Substitution
Embedding de output em prompts
4
🌐 Bridge & Remote Mode
local-jsx blocked, BRIDGE_SAFE_COMMANDS
5
🔑 Visibility Gates & Loading
Auth changes, lazy imports, internal commands
6
💎 Key Takeaways
Resumo do sistema de comandos
Ver Completo
4.3 ~45 min

Dialog UI

Arquitetura de 4 camadas para renderizacao de elementos interativos no terminal usando React e Ink.

1
🏗️ Four-Layer Architecture
Launchers, Helpers, Design System, Feature Components
2
🛡️ Permission Requests
BashPermissionRequest, classifier shimmer
3
🎛️ CustomSelect Widget
TextOption, InputOption, selection list
4
🧙 Wizard Pattern
WizardProvider, useWizard, auto-computed title
5
🔗 showSetupDialog Architecture
AppStateProvider, KeybindingSetup, sole location
6
💎 Key Takeaways
Patterns e decisoes de design
Ver Completo
4.4 ~45 min

Notification System

Dois pipelines completamente separados: Toast Queue no REPL e OS/Terminal Notifier com suporte a iTerm2, Kitty, Ghostty.

1
📢 In-REPL Toast Queue
Priority-based dequeuing, fold merging
2
🏷️ 14 Specialized Hooks
Rate limits, model deprecation, MCP, IDE
3
📱 OS/Terminal Notifier
iTerm2 OSC 9, Kitty OSC 99, Ghostty, BEL
4
📦 Background Task Collapsing
Success collapsing, verbose bypass
5
🔒 MCP Channel Notifications (Kairos)
6-layer security gate
6
💎 Key Takeaways
Dois pipelines, prioridade, tmux compatibility
Ver Completo
4.5 ~60 min

Vim Mode

Implementacao completa de um vim keybinding engine em TypeScript: state machines, funcoes puras, dot-repeat e text objects.

1
📝 Type System as Specification
VimState, CommandState discriminated unions
2
🔄 Transition Table
State machine dispatch, handleNormalInput
3
➡️ Motions - Pure Cursor Math
resolveMotion, inclusive/linewise flags
4
✂️ Operators & Text Objects
delete/change/yank, cw special case, bracket/quote
5
🔄 Dot Repeat & Count Multiplication
RecordedChange, 2d3w = 6 words, MAX_VIM_COUNT
6
🎯 Context Interface - Dependency Inversion
OperatorContext, TransitionContext, zero UI imports
Ver Completo
4.6 ~50 min

Keybindings

Pipeline de 5 estagios: terminal decode, binding config, key matching, chord resolution e React dispatch.

1
📟 Terminal Byte Decode
VT sequences, CSI u (Kitty), modifyOtherKeys
2
⚙️ Binding Config & Key Matching
18 contexts, platform-aware, alt/meta unification
3
🎹 Chord Resolution
5 outcomes, last-wins override, chord prefix
4
⚛️ React Hooks & User Config
useKeybinding, hot-reload, reserved shortcuts
5
🛡️ Validation & Reserved Keys
5 warning types, non-rebindable, platform-specific
6
💎 Full Pipeline Summary
Bytes to handler, 5-stage flow
Ver Completo
4.7 ~45 min

Fullscreen Mode

Alternate screen buffer DEC 1049, deteccao de ambiente, AlternateScreen component e OffscreenFreeze optimization.

1
📟 DEC Private Mode Sequences
Mode 1049, mouse tracking stack, reverse disable
2
🔎 Fullscreen Detection Logic
Env vars, tmux probe sync, caching trick
3
⚛️ AlternateScreen React Component
useInsertionEffect, height constraint
4
🏗️ FullscreenLayout Slots
5 named slots, modal sizing, new messages pill
5
⚡ OffscreenFreeze Optimization
React object-identity bail-out, 'use no memo'
6
💎 Lifecycle & Key Takeaways
Enter to exit, tmux mouse hint
Ver Completo
4.8 ~45 min

Theme & Styling

Do ThemeName string ao output colorido no terminal: 6 palettes, chalk level clamping, daltonized variants e o /color command.

1
🎨 4-Layer Color Architecture
theme.ts, colorize.ts, styles.ts, design-system/color.ts
2
🌈 Six Themes & Daltonized Variants
dark, light, daltonized, ANSI, auto resolution
3
🔧 colorize.ts - Terminal Environment Fixes
VS Code boost, tmux clamp, ordering matters
4
📝 Styles Type System
TextStyles, Color union, noSelect property
5
🎛️ /theme, /color & AgentColorManager
Live preview, swarm teammate guard, 8 agent colors
6
💎 Key Takeaways
3 phases, naming conventions, shimmer pattern
Ver Completo