Claude Code – Everything You Can Configure That the Docs Don't Tell You
A deep dive into Claude Code's source code reveals a treasure trove of undocumented features, offering developers powerful new ways to configure and extend the AI's capabilities. These hidden functionalities enable advanced automation, self-improvement, and fine-grained control, pushing the boundaries of AI-assisted development. The article is popular because it gives HN readers a peek behind the curtain and practical, cutting-edge techniques not found in official documentation.
The Lowdown
This article dissects the source code of Anthropic's Claude Code, uncovering numerous powerful, undocumented configuration options and features. While official documentation covers the basics, the author's investigation reveals a sophisticated underlying system that allows for unprecedented customization and autonomous behavior within the AI development environment.
- YOLO Classifier for Auto-Mode: Claude Code's internal permission system, named the "YOLO Classifier," can be configured with plain English descriptions of the environment (e.g., "this is a staging server"), influencing its auto-approval decisions for operations.
- Advanced Hook Capabilities: Beyond basic hook definitions, the source code reveals that
PreToolUse,SessionStart,PostToolUse, andPermissionRequesthooks can return specific JSON fields to modify behavior, such asupdatedInput(rewriting commands),permissionDecision(forcing approval/denial),additionalContext(injecting conversation context), andwatchPaths(setting up file monitoring). - Undocumented Hook Fields: Hooks support
once: truefor single execution,async: truefor non-blocking background runs, andasyncRewake: truefor background execution that blocks only on error (exit code 2). - Expanded Skill Configuration: Skills offer hidden fields like
model(to specify 'haiku' or 'opus' for a skill),effort(controlling reasoning depth),hooks(scoped hooks active only when the skill runs),agent(delegating to a custom agent),disable-model-invocation(preventing auto-invocation), andshell(specifying execution shell). - Agent Memory and Behavior Customization: Custom agents can be defined with
colorfor UI distinction,memory(global, project, or local) for persistent learning,omitClaudeMd: trueto ignore project-specific instructions for unbiased reviews, andcriticalSystemReminder_EXPERIMENTALfor persistent system messages. They can also definerequiredMcpServersfor dependency checks. - Self-Improvement Systems: Enabling
autoMemoryEnabledallows Claude Code to automatically extract and store durable memories from sessions, whileautoDreamEnabledconsolidates these memories daily, leading to genuine learning from experience without model retraining. - MAGIC DOC for Auto-Maintenance: A specific H1 header format (
# MAGIC DOC:) enables Claude Code to automatically maintain sections of documentation, with optional italicized instructions to scope its update focus. - Refined Pattern Language: The detailed pattern language for permissions and
ifconditions includes advanced globbing (*,**) and specific syntax for MCP tools. - Forked Skill Optimizations:
context: forkruns skills as background subagents, and usingmodel: inheritor omitting themodelfield is crucial for maintaining prompt cache efficiency with the parent conversation.
The revelations from the source code suggest Anthropic is building a platform for highly autonomous, self-learning AI development agents. These capabilities, though currently undocumented, are functional and allow developers to create sophisticated, context-aware, and continuously improving AI workflows today.