Establish Evidence Levels
Distinguish source code, repository docs, official public docs, and local snapshot observations.
The Grok Build side can drill down into source code; the Claude Code side records only publicly documented behavior. The two columns have different resolution, so blanks are kept blank rather than filled with inference.
Distinguish source code, repository docs, official public docs, and local snapshot observations.
Compare public capabilities across runtime, tools, context, security, recovery, and ecosystem.
Reframe "who is better" as a match of constraints, team capability, and delivery scenario.
| Dimension | Grok Build | Claude Code Public Behavior |
|---|---|---|
| Implementation & Distribution | Rust Cargo workspace with functionality split across multiple crates; README provides source build entry point. R1 · S1 | Official entry points include terminal CLI, IDE, Desktop, and Web. Internal language and module boundaries are out of scope for this course's conclusions. P1 |
| State & Concurrency | SessionActor holds session history and tool context, runs on Tokio LocalSet; background tasks can independently send messages back.S2 | Public docs describe user-observable behavior of sessions, background tasks, subagents, and agent teams; no inference is made about the internal concurrency model. P5 |
| Tool Contract | ToolKind enum feeds into capability filtering with compile-time sync assertions for new variants; MCP tools map to Other.S3 | Public permission rules control allow, ask, and deny by tool name and parameter patterns such as Read, Edit, Write, Bash, WebFetch, MCP. P6 |
| Tool Discovery | Built-in tools are registered directly; MCP metadata enters a snapshot and BM25 index, with lazy discovery via search_tool / use_tool.S4 | Official docs state Tool Search can load MCP tools on demand, with support for deferred connection waiting and failure feedback. P3 |
| Context Compaction | Source includes compaction configuration, segmentation, two-pass, full-replace, and recap auxiliary paths; auto-compaction and recovery are testable. S5 | Public behavior includes auto-compaction, /compact, and compact instructions; internal algorithms are out of scope for this course.P4 |
| Long-term Memory | xai-grok-memory implements SQLite storage, FTS, embedding, MMR, and a Dream consolidation workflow, integrated by the session memory state.S6 | Public mechanisms include layered CLAUDE.md instructions and auto memory; scope and loading rules are covered by official docs.P4 |
| Hooks | Source enumerates 15 events; PreToolUse can block. Explicit deny blocks; Hook crashes, timeouts, and failed output go fail-open. Configuration uses JSON.S7 · R2 | Official Hooks reference documents multiple event types, matcher, if conditions, and command, HTTP, MCP tool, prompt, agent handlers; PreToolUse can return a deny.P2 |
| MCP | Source confirms client role; supports stdio and Streamable HTTP, OAuth, server__tool, dynamic capability refresh, state merging, and restart. No general MCP Server entry point confirmed.S8 · R3 | Official docs document remote HTTP, local stdio, WebSocket, OAuth, dynamic list_changed, Tool Search, and connection management.P3 |
| Permissions & Sandbox | ToolKind capability filtering, permission prompts, and platform sandbox code combine into multi-layer control; Hook failure policy does not carry mandatory security guarantees.S3 · S7 | Official documentation covers allow, ask, deny rules, managed settings, sandboxed Bash and filesystem, and network isolation configuration. P6 |
| Subagent | Source includes fork, task, worktree pool, and completed subagent worktree snapshot configuration; branch tasks can be placed in isolated worktrees. S9 | Official subagents have independent context, tools, and permissions; can run foreground or background; worktree isolation configurable. P5 |
| Plugin Ecosystem | Marketplace supports indexing and directory fallback; install registry preserves source; runtime controls components by scope, enabled flag, and plugin-root trust. S10 · R4 | Official plugin and marketplace docs document skills, agents, hooks, MCP servers, LSP servers, and installation scope. P7 |
| Recovery & Observability | Source includes session persistence, MCP status notifications, 50 ms event coalescing, restart backoff, telemetry enums, and structured events. S11 | Publicly visible behavior includes session resume, verbose/debug, Hooks status, MCP panel, and permission diagnostics; internal persistence topology is not inferred. P1 · P3 |
| Source Code & Governance | Repository snapshot makes source public; README notes periodic sync from monorepo, root Cargo.toml is generated, and external contributions are not accepted.R1 · R5 | This column is based on official public product documentation; invisible internal implementation is not used as a comparison fact. P1 |
/// An actor representing an ACP session
/// with its own chat history and tool context.
pub struct SessionActor {
pub(super) agent: RefCell<Agent<ThreadedMvpAgent>>,
...
}crates/codegen/xai-grok-shell/src/session/acp_session.rsconst _: () = assert!(
ALL_TOOL_KINDS.len() == ToolKind::VARIANT_COUNT,
"ALL_TOOL_KINDS is out of sync"
);This kind of assertion turns "add a permission decision after adding a tool" into a compile-time constraint.
crates/codegen/xai-grok-workspace/src/capability.rsThese two sets of conditions can coexist. Real-world solutions can also be combined by project, data classification, or team role.
Deliverable
Two-page selection memo
The lasting skill from this lesson — Lesson 24 of this series — is the ability to separate implementation facts, product behavior, inference, and unknowns. Only when evidence levels are clear do architectural trade-offs have a verifiable foundation.
Source Snapshot Note: The Grok side is based on the local grok-build-main snapshot; the Claude side is based on official public documentation accessible in July 2026, stating only user-visible behavior. Code excerpts are for teaching purposes. Blank cells in the table are intentionally preserved unknowns.