In a refreshing departure from the bloated abstraction layers that plague modern AI tooling, developer vitalikpi has released "Build Your Own Claude Code," a minimalist implementation that achieves agentic coding functionality in just 300 lines of Python. The project, which gained traction on Hacker News on November 9, 2026, demonstrates that the core mechanics of tools like Claude Code—context management, tool calling, and subagent forking—can be implemented without the 500,000+ lines of TypeScript and React state management found in commercial alternatives. Dubbed "Marvin Code" after the paranoid android from *The Hitchhiker's Guide to the Galaxy*, the tool is explicitly designed to be "brilliant and utterly indifferent," prioritizing functional simplicity over polished UX.
The Architecture of Minimalism
The implementation relies on a standard OpenAI-style API structure, defaulting to anthropic/claude-haiku-5.5 via OpenRouter but allowing for any compatible provider. The author breaks down the construction into seven distinct steps, starting with a basic "Hello, World!" call and progressing to complex agentic loops. By step four, the tool integrates three essential utilities: read_tool, write_tool, and bash_tool. These are defined as JSON manifests passed directly to the model, allowing the LLM to invoke local system commands. The code explicitly handles tool call feedback by appending the execution result back into the message history, creating a tight feedback loop that enables self-correction without external orchestration frameworks.
Context and Skills as Code
Rather than relying on heavy database-driven memory systems, the project treats context as a simple list of message dictionaries appended to every API call. This approach mirrors how humans remember conversation history, though the author notes the non-deterministic nature of LLMs can still lead to divergent contexts. The implementation also introduces a lightweight "skills" system, defined by Markdown files with YAML frontmatter. These skills, such as /code-review or /morning, are expanded via regex substitution before being sent to the model. This allows users to stack commands like /echo /babelfish "Hola, Amigo!", effectively creating a programmable prompt library that resides entirely in the filesystem rather than a proprietary cloud service.
Subagents and the Cost of Context
The final major feature is the implementation of subagents, designed to mimic process forks without the overhead of parallel execution. The author argues that subagents are critical for managing token costs and context pollution. By extracting the agentic loop into a reusable function, the tool can spawn a new context window for specific tasks—such as reviewing an unrelated file—ensuring that irrelevant history does not degrade performance or inflate bills. The subagent receives a restricted toolset (excluding the skill tool itself to prevent infinite recursion) and returns only its final output to the main thread, discarding the intermediate reasoning steps. This architectural choice highlights a growing trend in efficient LLM application design: isolating contexts to preserve signal-to-noise ratios.
Key Takeaways
- Radical Simplicity: The entire agentic loop, including tool handling and context management, is achieved in 300 lines of Python, challenging the necessity of complex frameworks like LangChain or AutoGen for basic coding tasks.
- Cost Efficiency via Isolation: The implementation of subagents with
context: forkdemonstrates a practical method for reducing token usage by preventing context bleed between unrelated tasks. - Filesystem-Native Configuration: By using
AGENTS.mdand Markdown-based skills, the tool remains fully inspectable and version-controllable, avoiding the opacity of black-box configuration systems. - Provider Agnosticism: The use of standard OpenAI-style APIs via OpenRouter ensures compatibility with a wide range of models, from Claude Haiku to future releases, without code changes.
The Bottom Line
Vitalikpi’s project is a stark reminder that we have over-engineered agentic workflows. While commercial tools offer polished UIs and robust error handling, they often obscure the underlying mechanics that make these systems tick. For developers willing to trade comfort for control, 300 lines of Python is all you need to build a competent, indifferent coding assistant.
Disclosure Note
The author explicitly states that while the code and voice are human-generated, AI was used for animations, skills drafting, proofreading, and debugging. This transparency aligns with the project's ethos of being "brilliant and utterly indifferent"—using the tool to build the tool, but keeping the core logic human-readable.