Claude Code Undocumented Features: Hooks, Memory, YOLO Classifier & More

André Figueira read the Claude Code source code (v2.1.87) and found dozens of undocumented configuration options. The official docs cover basics, but the actual package—freely inspectable in node_modules—exposes fields for hooks, agent memory, auto-mode rules, and more. Here's what you can actually configure right now.
YOLO Classifier: Auto-approve Actions with Plain English
Internally called the "YOLO Classifier" (yoloClassifier.ts), this system lets you describe your environment in plain English to decide when Claude can auto-approve operations. In settings.json, add a description like "this is a staging server, destructive operations are acceptable" to allow certain actions without prompting.
Hook Return Values That Change Behavior Mid-Flight
Hooks receive JSON on stdin and can return event-specific JSON on stdout. Here are the key return fields:
- PreToolUse:
updatedInput(rewrite tool input before execution),permissionDecision(force allow/deny),permissionDecisionReason,additionalContext - SessionStart:
watchPaths(automatic file watching triggering FileChanged events),initialUserMessage(prepend content to first user message),additionalContext - PostToolUse:
updatedMCPToolOutput,additionalContext - PermissionRequest:
decision(programmatic allow/deny withupdatedInputorupdatedPermissions)
Example: a PreToolUse hook that adds --dry-run to every git push command. In .claude/settings.json:
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{
"type": "command",
"command": "~/.claude/hooks/dry-run-pushes.sh"
}]
}]
}
}Script at ~/.claude/hooks/dry-run-pushes.sh:
#!/bin/bash INPUT=$(jq -r '.tool_input.command'This rewrites the command before execution, an undocumented field.
Session Context & File Watching
SessionStart hooks can set watchPaths to monitor files like package.json, .env, and tsconfig.json for changes, triggering FileChanged events. They can also inject initialUserMessage to prepend context, e.g., current git branch and uncommitted changes count.
Example script returning watch paths and initial message:
#!/bin/bash
BRANCH=$(git branch --show-current 2>/dev/null)
CHANGES=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
jq -n \
--arg branch "$BRANCH" \
--arg changes "$CHANGES" \
'{
"watchPaths": ["package.json", ".env", "tsconfig.json"],
"initialUserMessage": "Current branch: \($branch), uncommitted changes: \($changes)"
}'Persistent Agent Memory & Auto-Mode Rules
Agent memory can be configured to persist across sessions using fields in the ~/.claude/agents/ directory. Auto-mode rules can be described in plain English files, telling Claude when to approve actions automatically. The source also hints at "self-improving dream loops" where Claude can refine its own configs.
File Locations
- Settings:
~/.claude/settings.json(personal) or.claude/settings.json(project, shareable via git) - Skills:
~/.claude/skills/<name>/SKILL.md(personal) or.claude/skills/<name>/SKILL.md(project) - Agents:
~/.claude/agents/<name>.md(personal) or.claude/agents/<name>.md(project) - Hook scripts: Conventionally in
~/.claude/hooks/, must be executable (chmod +x)
These are practical for developers who want to customize Claude Code beyond the documented APIs. Expect these features to change between releases.
📖 Read the full source: HN AI Agents
👀 See Also

Maestro v1.5.0 adds Claude Code support for multi-agent orchestration
Maestro v1.5.0, an open-source multi-agent orchestration platform, now runs as a native plugin on Claude Code in addition to Gemini CLI. The update includes deeper design planning, a 42-step orchestration backbone, agent capability enforcement, and security hardening.

Librarian MCP: Local AI Server for Persistent Context with Documents
Librarian MCP is an open-source Model Context Protocol server that runs locally and connects to Jan, LM Studio, or Claude Desktop, enabling AI models to search and analyze document collections while maintaining full conversation context and data privacy.

Hyper iOS App: Voice Recorder with Real-Time Transcription and Action Extraction
Hyper is an iOS voice recorder app that transcribes conversations in real-time, provides summaries and action items, and allows mid-conversation queries via wakeword detection. It's designed for unstructured meetings like 1:1s, coffee chats, and standups.

Mandala v0.3: Open-Source Async Runtime to Unify Logistics Telemetry as OpenTelemetry Spans for Agent Reasoning
Mandala v0.3 provides an open-source async runtime that ingests telemetry from Samsara, Descartes, Vizion, and FMCSA via webhooks, emits events as OpenTelemetry spans, and exposes data via MCP tools for LLM agents.