How getasterisk/claudia works
1. Overall shape
- opcode is a desktop application built with Tauri 2: a React + TypeScript frontend in src/ and a Rust backend in src-tauri/.
- The app is a local “control center” for Claude Code: it manages projects, interactive sessions, custom agents, MCP servers, usage analytics, and session checkpoints.
2. Frontend shell and composition
- The UI entrypoints are src/main.tsx and src/App.tsx, with most of the application assembled from src/components/.
- State is split across React contexts and stores (src/contexts, src/stores) plus a set of hooks and utility libraries in src/hooks and src/lib.
- The frontend is a feature-rich shell, not just a thin view layer: it owns most of the user interaction flow, navigation, persistence of UI state, and rendering of session/agent outputs.
3. Claude Code session workspace
- The core user-facing experience is session/project management around Claude Code data under ~/.claude/projects/.
- Components such as ProjectList, SessionList, ClaudeCodeSession, SessionOutputViewer, and RunningClaudeSessions indicate a workflow where users browse projects, inspect session history, resume or continue work, and view live output.
- The data shown in the UI comes from local filesystem state and backend commands rather than a remote service.
4. Agent subsystem
- CCAgents, CreateAgent, Agents, AgentExecution, AgentRunsList, and related components implement a custom-agent layer on top of Claude Code.
- Agents have configurable prompts, model selection, permissions, and execution history.
- The backend supports this through Rust command handlers in src-tauri/src/commands/agents.rs and process-management code, which suggests agents can run as isolated background processes instead of inside the main UI process.
5. Checkpoint / timeline subsystem
- The checkpoint/ backend module (manager.rs, state.rs, storage.rs) and UI pieces like CheckpointSettings, TimelineNavigator, and the checkpoint hooks indicate a versioning system for Claude sessions.
- This subsystem stores checkpoint state locally, lets the UI navigate timelines/branches, and supports restore/fork behavior for sessions.
- Architecturally, this is a distinct persistence and recovery boundary layered over session history.
6. MCP server management
- MCPManager, MCPServerList, MCPAddServer, and MCPImportExport implement management of Model Context Protocol servers.
- Backend command handlers in src-tauri/src/commands/mcp.rs likely broker local configuration, validation, and import/export of server definitions.
- This is another local configuration boundary: the app acts as a registry and editor for external tool integrations used by Claude Code.
7. Claude binary and command orchestration
- src-tauri/src/claude_binary.rs and src-tauri/src/commands/claude.rs suggest the app shells out to the Claude Code CLI and wraps it in a safer, structured interface.
- Additional command modules like slash_commands.rs, proxy.rs, and usage.rs indicate the backend mediates several Claude-facing operations: command invocation, proxying, and usage collection.
- The Rust backend therefore acts as the orchestration layer between the UI and the external Claude CLI/runtime.
8. Process isolation and execution registry
- src-tauri/src/process/registry.rs and the process/ module point to explicit lifecycle management for child processes.
- This matters architecturally because background agents and session operations are not assumed to be in-process UI tasks; they are supervised, tracked, and isolated by the Rust layer.
- The README’s security model aligns with this: the app emphasizes separate processes and permission control per agent.
9. Persistence and local data model
- Local persistence is split between frontend and backend responsibilities.
- Frontend services like sessionPersistence.ts and tabPersistence.ts preserve UI/session navigation state, while backend storage commands and checkpoint storage handle app/domain data.
- src/stores/sessionStore.ts and agentStore.ts likely provide the in-memory app state that sits on top of these persisted sources.
10. Usage analytics and monitoring
- The UsageDashboard UI and src/lib/analytics/* form a local analytics subsystem for cost/token tracking.
- This appears to be a client-side analytics pipeline with consent handling, event types, and resource monitoring, not a cloud analytics service.
- It is a distinct reporting layer fed by usage data from Claude sessions and/or backend command output.
11. UI feature modules and editing tools
- Several UI subsystems support the main workflows: CLAUDE.md editing, file picking, markdown preview, prompt composition, top-level tab management, and session output visualization.
- These are mostly presentational and interaction-heavy components, but they matter architecturally because they define the user’s route through the app: discover projects, inspect sessions, edit instructions, run agents, review outputs.
12. Optional web-server / alternate runtime boundary
- The presence of src-tauri/src/web_server.rs, web_main.rs, and web_server.design.md suggests a secondary serving/runtime path beyond the standard Tauri desktop shell.
- This likely exists to support a local web-hosted mode, embedded preview, or shared backend serving architecture.
- For a diagram, treat it as an alternate entrypoint around the same backend domain logic rather than a separate product.
13. Build, packaging, and platform concerns
- The repo is cross-platform and ships through Tauri packaging, with Rust/Cargo on the backend and Bun/Vite on the frontend.
- GitHub Actions workflows cover Linux, macOS, tests, and releases; platform-specific native dependencies are documented in the README.
- The repository boundary is therefore “desktop app + local services + packaged installers,” not a web deployment.
14. Key architectural boundary to diagram
- The most important boundary is between:
- React UI state and views
- Tauri Rust commands / local orchestration
- External local dependencies: Claude Code CLI, filesystem (~/.claude), child processes, and local storage.
- Most feature flows follow the same pattern: the UI invokes a Tauri command, the Rust backend reads/writes local state or launches a process, and results are streamed back into React components for display.
Main entry points: mod.rs Command layer · App.tsx Root app · ClaudeCodeSession.tsx Session workspace · claude.rs Claude cmds
Components 22
React UI
Desktop shell, feature views, and client-side state.
- App shell · Bootstraps the desktop UI and top-level layout.
src/main.tsx - Root app · Assembles navigation, panels, and feature modules.
src/App.tsx - Session workspace · Project/session browsing, live output, and session history views.
src/components/ClaudeCodeSession.tsx - Project browser · Lists Claude Code projects and sessions from local data.
src/components/ProjectList.tsx - Session history · Selects and navigates session records and replayable output.
src/components/SessionList.tsx - Live output · Renders streamed messages and session output.
src/components/SessionOutputViewer.tsx - Agent workspace · Creates, runs, and inspects custom Claude Code agents.
src/components/Agents.tsx - Agent runs · Shows agent execution state and run history.
src/components/AgentRunsList.tsx - Checkpoint UI · Timeline navigation and checkpoint controls for sessions.
src/components/TimelineNavigator.tsx - MCP manager · Edits, imports, and lists local MCP server definitions.
src/components/MCPManager.tsx - Usage dashboard · Shows local token and cost analytics.
src/components/UsageDashboard.tsx - Client state · Shared stores, contexts, and hooks for UI behavior and persistence.
src/stores/sessionStore.ts
Tauri Rust
Local orchestration, commands, storage, and process supervision.
- Command layer · Entry point for the Rust command handlers exposed to the UI.
src-tauri/src/commands/mod.rs - Claude cmds · Wraps Claude CLI invocation, proxying, slash commands, and usage queries.
src-tauri/src/commands/claude.rs - Agent cmds · Handles agent lifecycle, execution, and process-mediated runs.
src-tauri/src/commands/agents.rs - MCP cmds · Validates and persists MCP server configuration.
src-tauri/src/commands/mcp.rs - Checkpoint core · Manages checkpoint state, storage, and restore/fork logic.
src-tauri/src/checkpoint/manager.rs - Process registry · Tracks and isolates child processes started by the app.
src-tauri/src/process/registry.rs - Claude binary · Resolves and shells out to the Claude Code CLI.
src-tauri/src/claude_binary.rs - Storage cmds · Backend storage entry point for local app data.
src-tauri/src/commands/storage.rs
Local Runtime
External tools and filesystem boundaries the app controls.
- Claude files · Local Claude project data, checkpoints, config, and persisted state.
- Claude Code · External CLI/runtime used for sessions and agent execution.
Connections 32
- App shell → Root app: mounts · Bootstraps the main application shell.
- Root app → Session workspace: composes · Surfaces the primary session workflow.
- Root app → Agent workspace: composes · Surfaces agent management and execution.
- Root app → MCP manager: composes · Surfaces MCP configuration tools.
- Root app → Usage dashboard: composes · Surfaces analytics and usage reporting.
- Root app → Checkpoint UI: composes · Exposes timeline and checkpoint controls.
- Session workspace → Project browser: shows · Browses local Claude projects.
- Session workspace → Session history: shows · Lists session history for a selected project.
- Session workspace → Live output: renders · Displays streamed and archived session output.
- Session workspace → Client state: reads state · Uses shared client state and persistence hooks.
- Agent workspace → Agent runs: shows · Displays execution history and current runs.
- Agent workspace → Client state: reads state · Uses shared client state and settings.
- MCP manager → Command layer: calls · Invokes backend command handlers through Tauri.
- Checkpoint UI → Command layer: calls · Requests checkpoint operations from the backend.
- Usage dashboard → Command layer: calls · Fetches usage data and analytics summaries.
- Command layer → Claude cmds: routes · Dispatches Claude-facing operations.
- Command layer → Agent cmds: routes · Dispatches agent lifecycle operations.
- Command layer → MCP cmds: routes · Dispatches MCP configuration operations.
- Command layer → Checkpoint core: routes · Dispatches checkpoint and timeline operations.
- Command layer → Storage cmds: routes · Dispatches local storage operations.
- Claude cmds → Claude binary: wraps · Uses the CLI wrapper to invoke Claude Code.
- Claude cmds → Process registry: supervises · Tracks spawned work and long-lived tasks.
- Agent cmds → Process registry: supervises · Runs agents as isolated child processes.
- Agent cmds → Claude binary: invokes · Uses Claude Code as the execution backend.
- Checkpoint core → Claude files: stores · Persists checkpoint state and timeline data locally.
- MCP cmds → Claude files: persists · Reads and writes MCP server definitions locally.
- Storage cmds → Claude files: reads/writes · Accesses local app data and session artifacts.
- Claude binary → Claude Code: executes · Shells out to the external Claude Code CLI.
- Project browser → Claude files: reads · Loads project/session listings from local files.
- Session history → Claude files: reads · Reads session history and checkpoint metadata.
- Live output → Claude cmds: subscribes · Consumes backend-delivered session output and events.
- Agent runs → Process registry: observes · Displays tracked agent process state.