InkdownInkdown
Start writing

Claude-Code

62 files·4 subfolders

Shared Workspace

Claude-Code
codex

22-screens

Shared from "Claude-Code" on Inkdown

Screens

The UI surface — REPL, Doctor, and ResumeConversation.


Overview

The screens/ directory contains exactly 3 screen components. Navigation is not router-based — screens are composed conditionally by parent components based on CLI flags, slash commands, and user actions.


REPL (REPL.tsx) — 5000+ lines

The central hub of the entire application. Handles the complete conversation lifecycle.

Internal Screen States
0000_start_here_index_and_recommended_reading_order.md
0100_project_overview_tech_stack_runtime_modes_and_folder_map.md
0200_startup_flow_entry_points_and_cold_start_sequence.md
0300_codebase_modules_layers_state_models_and_schemas.md
0400_system_architecture_and_design_rationale.md
0500_interactive_repl_request_flow_end_to_end.md
0600_headless_sdk_and_print_mode_request_flow_end_to_end.md
0700_mcp_integration_connection_and_tool_call_flow.md
0800_external_services_sdks_storage_and_local_dependencies.md
0900_environment_variables_settings_feature_flags_and_failure_modes.md
1000_non_obvious_patterns_gotchas_and_debugging_traps.md
1100_full_codebase_file_inventory_grouped_by_directory.md
kimi
00-overview.md
01-entrypoints.md
02-state-management.md
03-query-system.md
04-tools-system.md
05-tasks-system.md
06-ui-components.md
07-bridge-remote.md
08-services.md
09-skills-plugins.md
10-commands.md
11-testing-architecture.md
12-permission-system.md
13-build-system.md
14-ink-internals.md
15-git-internals.md
16-context-compaction.md
17-vim-mode.md
18-mailbox-notifications.md
19-session-persistence.md
20-hooks-system.md
21-error-recovery.md
README.md
qwen
00-overview.md
01-entry-points.md
02-query-engine.md
03-tools-and-tasks.md
04-commands-and-skills.md
05-state-management.md
06-ink-rendering.md
07-bridge-remote.md
08-mcp-services.md
09-services-overview.md
10-multi-agent.md
11-system-prompt-constants.md
12-tool-interface.md
13-memory-system.md
14-buddy-companion.md
15-keybindings.md
16-stop-hooks.md
17-vim-mode.md
18-upstreamproxy.md
19-cost-tracking-history.md
20-contexts-styles-onboarding.md
21-hooks.md
22-screens.md
tweets-explain
claude-code-memory-analysis.md
compact
memory-system
agentic-architecture
StateDescription
'prompt'Normal conversation view with input at bottom
'transcript'Read-only scrollable detailed view (like less pager), entered via Ctrl+O
Architecture
Plain text
┌─────────────────────────────────────────────────────────────┐
│                        REPL                                  │
│                                                               │
│  ┌─────────────────────────────────────────────────────────┐ │
│  │  FullscreenLayout                                       │ │
│  │                                                         │ │
│  │  ┌───────────────────────────────────────────────────┐  │ │
│  │  │  scrollable:                                      │  │ │
│  │  │    Messages (conversation transcript)             │  │ │
│  │  │    SpinnerWithVerb (loading indicator)            │  │ │
│  │  │    Tool JSX (tool execution display)              │  │ │
│  │  └───────────────────────────────────────────────────┘  │ │
│  │                                                         │ │
│  │  ┌───────────────────────────────────────────────────┐  │ │
│  │  │  bottom:                                          │  │ │
│  │  │    PromptInput (user input + autocomplete)        │  │ │
│  │  │    CompanionSprite (buddy pet)                    │  │ │
│  │  │    PromptInputQueuedCommands                      │  │ │
│  │  └───────────────────────────────────────────────────┘  │ │
│  │                                                         │ │
│  │  ┌───────────────────────────────────────────────────┐  │ │
│  │  │  modal (centered, stacked by focusedInputDialog): │  │ │
│  │  │    'tool-permission' → PermissionRequest          │  │ │
│  │  │    'sandbox-permission' → SandboxPermissionRequest│  │ │
│  │  │    'prompt' → PromptDialog                        │  │ │
│  │  │    'elicitation' → ElicitationDialog              │  │ │
│  │  │    'cost' → CostThresholdDialog                   │  │ │
│  │  │    'idle-return' → IdleReturnDialog               │  │ │
│  │  │    'worker-sandbox-permission' → SandboxPerm...   │  │ │
│  │  └───────────────────────────────────────────────────┘  │ │
│  │                                                         │ │
│  │  ┌───────────────────────────────────────────────────┐  │ │
│  │  │  overlay: permission requests                     │  │ │
│  │  └───────────────────────────────────────────────────┘  │ │
│  └─────────────────────────────────────────────────────────┘ │
│                                                               │
│  Feature-gated panels:                                        │
│  ├── TaskListV2 (expanded todos)                             │
│  ├── TungstenLiveMonitor (ant-only)                          │
│  ├── WebBrowserPanel (feature-gated)                         │
│  ├── CompanionFloatingBubble (buddy, fullscreen)             │
│  ├── DevBar (ant-only debug)                                 │
│  └── IssueFlagBanner                                         │
└─────────────────────────────────────────────────────────────┘
Key Responsibilities
AreaDetails
User InputPrompt submission, slash commands, autocomplete, vim mode
AI ResponsesStreaming display, tool use rendering, thinking blocks
PermissionsTool use dialogs, sandbox permissions, swarm worker permissions
Session ManagementCost tracking, session titles, background sessions
Multi-AgentTeammate view, worker permissions, swarm communication
Remote Modes--remote, --ssh, --connect
IDE IntegrationVS Code/JetBrains connection, code selection
BridgeMobile/web remote control
FeedbackSurveys, frustration detection (ant-only)
NotificationsRate limits, plugin status, settings errors, MCP connectivity
Transcript Mode (Ctrl+O)

When toggled to transcript mode:

Plain text
┌────────────────────────────────────────────────────┐
│  Transcript Mode                    [Search: /]    │
│                                                     │
│  VirtualMessageList (virtualized scroll)            │
│  ├── All messages with full detail                  │
│  ├── Tool inputs/outputs                            │
│  └── Timestamps, token counts                       │
│                                                     │
│  TranscriptSearchBar (optional, triggered by /)     │
│  ├── Incremental search                             │
│  ├── Match counting                                 │
│  └── Index status (3/12)                            │
│                                                     │
│  ─────────────────────────────────────────────────  │
│  TranscriptModeFooter                               │
│  [Ctrl+O] Exit  [g] Top  [G] Bottom  [/] Search    │
└────────────────────────────────────────────────────┘
Major Hook Dependencies (~50 hooks)
CategoryHooks
StateuseAppState, useSetAppState, useAppStateStore
RemoteuseRemoteSession, useDirectConnect, useSSHSession
ModeluseMainLoopModel
MCPuseMergedClients, useMergedTools, useMergedCommands
SwarmuseSwarmInitialization, useInboxPoller
BridgeuseReplBridge
QueueuseQueueProcessor
InputuseTextInput, useVimInput, useTypeahead
IDEuseIDEIntegration, useIdeSelection, useIdeLogging
VoiceuseVoiceIntegration
CostuseCostSummary
NotificationsAll 16 notification hooks
SurveysuseFeedbackSurvey, useMemorySurvey, usePostCompactSurvey
PluginsuseManagePlugins, usePluginRecommendationBase
TasksuseTasksV2, useTaskListWatcher

Doctor (Doctor.tsx) — 575 lines

Diagnostics screen showing installation health and configuration status.

Sections
SectionContent
InstallationType, version, package manager, binary path
SearchRipgrep status
UpdatesAuto-update settings, stable/latest dist tags
SandboxSandbox configuration
MCPParsing warnings
KeybindingsConflict warnings
EnvironmentVariable validation
Version LocksPID-based locking
AgentsDefinitions and parse errors
PluginsPlugin errors
Context UsageUnreachable permission rules, CLAUDE.md warnings, agent warnings, MCP warnings
SettingsInvalid settings
Usage

Invoked via /doctor command. Dismissed with Enter/confirmation keybinding, which injects a system message back into the REPL.


ResumeConversation (ResumeConversation.tsx) — 399 lines

Session picker that lets users browse and resume previous conversations.

Flow
Plain text
┌───────────────────────────────────────────────┐
│  ResumeConversation                           │
│                                               │
│  [Loading] → Spinner + "Loading..."           │
│                                               │
│  LogSelector (searchable, paginated list)     │
│  ├── Session title                            │
│  ├── Last message preview                     │
│  ├── Timestamp                                │
│  └── PR number filter                         │
│                                               │
│  [On select]                                  │
│    ├── Deserializes conversation from disk    │
│    ├── Restores session state:                │
│    │   ├── Costs                              │
│    │   ├── File history                       │
│    │   ├── Agent settings                     │
│    │   └── Worktree                           │
│    └── Renders <REPL> with restored messages  │
│                                               │
│  [Cross-project] → Copy command + exit        │
└───────────────────────────────────────────────┘
Features
  • Progressive loading — loads conversation logs in batches (same-repo or all-projects)
  • PR filtering — filter by PR number
  • Cross-project resume — copies a command to clipboard and exits
  • Forking — creates a new session from an old one
  • AI-powered search — agenticSessionSearch() for semantic session finding

Screen Navigation

Screens are composed conditionally by parent components:

Plain text
main.tsx / cli.tsx
    │
    ├─ [Normal launch] → REPL
    │
    ├─ [--resume flag] → ResumeConversation → REPL
    │
    ├─ [/resume command] → ResumeConversation → REPL
    │
    ├─ [/doctor command] → Doctor → (dismisses back to REPL)
    │
    └─ [Ctrl+O in REPL] → REPL (transcript mode)

No router — just conditional rendering based on:

  • CLI flags
  • Slash command execution
  • User actions

Files

FileLinesPurpose
src/screens/REPL.tsx5006Main conversation interface
src/screens/Doctor.tsx575Diagnostics screen
src/screens/ResumeConversation.tsx399Session picker