Claude Code Power User Guide

9 insights from the leaked source code that reveal how Claude Code actually works - and how to use it like a top 1% user.

25 min read Advanced AI Development James Killick
1 / 9
01Insight 01

It's Not a Chatbot in Your Terminal

Claude Code is a full agent runtime with 11 architectural layers. Most people use about 10% of it.

claude-code

Most people think Claude Code is basically Claude but in your terminal - a chatbot with access to your local files. That is completely wrong.

What the source code reveals is that Claude Code is a full agent runtime. It is a proper application built with Bun, TypeScript and React. It has a tool system, a command system, a memory system, a permission engine, a task manager, a multi-agent coordinator and an MCP client and server, all wired together under one execution pipeline.

The flow works like this: your input hits a CLI parser, goes to something called the Query Engine, calls the LLM API, runs a tool execution loop and then renders results back in your terminal.

The 11 architectural layers are: Terminal UI, Command Service, Permission Engine, Tool System, Query Engine, Memory System, Task Manager, Agent Coordinator, MCP Client/Server, Hook System and Runtime Core.

If you are using Claude Code like a chatbot - just typing questions and hoping for good answers - you are using maybe 10% of what it can actually do. The rest of the value is in the systems built around the model, and that is what the remaining insights are about.

Think of it like buying a Ferrari and never leaving first gear. The model is the engine, but the harness is the gearbox, suspension, steering and brakes. You need both.

02Insight 02

The Highest-Leverage Config File You Will Ever Write

CLAUDE.md is loaded every single turn, not just at session start. Most people use 200 characters of a 40,000 character limit.

Memory hierarchyClick to expand

CLAUDE.md is not documentation. It is an operating manual that gets injected into every single conversation turn. Not just at session start - every turn.

Most people either ignore this file or dump a few random notes into it. That is a massive missed opportunity because you have 40,000 characters to shape how Claude Code behaves, and most people use about 200.

Think of it this way: if Claude Code is an employee, then CLAUDE.md is their onboarding document. It tells them how you work, what matters, what to never do and how the project is structured.

The four-level hierarchy

CLAUDE.md is not a single file. It is a four-level system that cascades from global to private:

  • Global (~/.claude/CLAUDE.md) - applies everywhere. Your universal conventions
  • Project (./CLAUDE.md) - project-specific context. Architecture, stack, team norms
  • Modular Rules (.claude/rules/*.md) - focused rules that load based on file glob patterns
  • Private (CLAUDE.local.md) - your personal overrides, git-ignored

The memory system: MEMORY.md

Beyond CLAUDE.md, there is a full persistent memory system. Claude Code maintains a MEMORY.md index file and individual memory files across sessions. It stores five types of information:

  • User memories - your role, preferences, expertise level
  • Feedback memories - corrections and confirmations from past sessions
  • Project memories - ongoing work context, decisions, deadlines
  • Reference memories - pointers to external systems and resources

The memory system means Claude Code learns from your corrections. Tell it once that you prefer Australian English or that tests should go next to source files, and it remembers across every future session.

What to put in CLAUDE.md

The best users keep CLAUDE.md short, opinionated and operational. Decision rules, constraints and conventions - not a novel about your project's history:

  • "We use TypeScript strict mode. Always."
  • "Tests go in __tests__/ folders next to the source file."
  • "Never modify the database schema without running migrations."
  • "Use pnpm, not npm."
  • "Australian English only. No em dashes. No Oxford commas."

If you get nothing else from this guide, go update your CLAUDE.md today. It is the single highest-leverage thing you can do to improve your Claude Code experience.

03Insight 03

The Commands That Change Everything

There are 85+ slash commands. Most people use none. Here are the six that matter daily - starting with the most important one.

> Type a command...

/plan

The most important command. Puts Claude Code into planning mode where it maps the full approach before touching any code. It reads files, explores the codebase and presents a structured plan for your approval before executing anything.

Usage

/plan

The source code reveals roughly 85 slash commands in Claude Code. Most users know maybe five of them. Power users treat these commands like keyboard shortcuts - they are one of the biggest levers for getting more value out of the tool.

/plan - the command that changes how you work

This deserves its own section because it is genuinely the most important command in Claude Code.

/plan puts Claude Code into planning mode. Instead of immediately executing, it maps out the full approach first. It reads files, explores the codebase, identifies dependencies, considers edge cases and presents a structured plan for your approval before it touches anything.

The source confirms this is a dedicated product feature with its own tools for entering and exiting plan mode - not just a prompting trick. There is also /ultraplan for more thorough planning on complex tasks.

Why this matters: most wasted tokens come from Claude Code going down the wrong path and having to backtrack. Planning first eliminates that. You review the approach, adjust if needed, then execute with confidence. It saves tokens and produces better results.

For any task that touches more than a couple of files, start with /plan. It is the difference between a junior developer who starts coding immediately and a senior who thinks first.

The other five that matter daily

/compact compresses your conversation history. You can run it with a prompt like /compact keep the API integration details to control what survives compression. Essential for long sessions.

/review and /security-review are built-in code review workflows. The fact that these exist as dedicated commands tells you review is a first-class feature, not an afterthought.

/context shows what files Claude Code is tracking. Every file costs tokens, so this is your spend visibility tool.

/cost shows real-time session spend. Check it regularly.

/init generates a CLAUDE.md by analysing your codebase. The fastest path to a solid project config.

Better prompts are one lever. Knowing these commands is a completely separate lever that most people are not even touching.

Unlock the remaining 6 insights

Enter your details and we'll email you a link to the full guide.

Frequently Asked Questions

What is Claude Code and how is it different from other AI coding tools?
Claude Code is Anthropic's AI-powered coding assistant that works directly in your terminal and editor. Unlike tools that generate code snippets in isolation, Claude Code understands your entire codebase context, can read and write files, run tests and execute commands within a continuous session. The key difference is architectural: Claude Code runs a multi-layer pipeline with separate stages for intent classification, context retrieval, planning, execution and validation, which explains why it handles complex multi-file tasks more reliably than simpler AI coding assistants.
What did the Claude Code source code leak reveal?
Anthropic accidentally exposed Claude Code's full source code via an npm package in March 2026. The leak revealed 512,000 lines of production TypeScript showing 11 architectural layers, a four-level CLAUDE.md hierarchy that gets injected every turn, 85+ slash commands, a multi-agent coordinator with three execution models (Fork, Teammate, Worktree), a deep permission system with wildcard patterns, 25+ lifecycle hooks and a persistent memory system. The source was mirrored publicly on GitHub before Anthropic issued DMCA takedowns.
How much does Claude Code cost?
Claude Code is billed based on API token usage through your Anthropic account rather than a flat subscription fee. Costs vary depending on usage intensity. A developer doing occasional tasks might spend $20-50 per month, while heavy daily use on large codebases can run $100-300 per month or more. You can set spending limits in your Anthropic console, use the /cost command to monitor sessions in real time and use /compact to reduce token usage on long conversations.
Claude Code vs Cursor vs GitHub Copilot - which should I use?
Each tool suits different workflows. GitHub Copilot is best for inline autocomplete inside VS Code and JetBrains IDEs. Cursor is a full IDE replacement with strong multi-file editing and a clean interface. Claude Code is strongest for complex agentic tasks where you need the AI to reason across many files, run commands, write tests and execute a multi-step plan. Many teams use Copilot for day-to-day autocomplete and Claude Code for larger feature work, refactoring and architecture tasks.
What is CLAUDE.md and how should I configure it?
CLAUDE.md is a markdown file you place at the root of your project that Claude Code reads and injects into every single conversation turn as its primary operating context. Think of it as a staff onboarding document for your AI developer. Include your tech stack and versions, coding conventions, folder structure, common patterns and workflow preferences. There is a four-level hierarchy: global (~/.claude/CLAUDE.md), project (./CLAUDE.md), modular rules (.claude/rules/*.md) and private (CLAUDE.local.md). You have 40,000 characters to work with and most people use about 200.
What does the /plan command do in Claude Code?
Typing /plan puts Claude Code into a dedicated planning mode where it maps task dependencies, explores the codebase, identifies risks and presents a structured plan for your approval before touching any code. The source confirms this is a first-class product feature with its own tools for entering and exiting plan mode. Without /plan, Claude Code often jumps straight to implementation which can produce locally correct but globally inconsistent solutions. Making /plan the default starting point for non-trivial tasks is one of the highest-leverage habits a Claude Code user can build.
Does Claude Code remember previous sessions and learn your codebase?
Yes. Claude Code uses a persistent memory system with a MEMORY.md index file and individual memory files stored at ~/.claude/projects/. It tracks four types of information: user preferences, feedback corrections from past sessions, project context and reference pointers to external systems. Sessions are saved as JSONL files so you can resume with --continue, pick a specific session with --resume or branch a conversation with --fork-session. The memory system means Claude Code learns from your corrections and carries that knowledge into every future session.
Can Claude Code run multiple tasks in parallel?
Yes. The source code reveals three execution models for sub-agents: Fork (inherits parent context and shares the prompt cache, making parallelism practically free), Teammate (runs in a separate terminal pane with a file-based mailbox for longer tasks) and Worktree (gets its own git worktree and isolated branch for parallel code changes). Because forked agents share the prompt cache, running five agents costs barely more than running one. You can request parallelism explicitly or let the agent coordinator handle it automatically.
How do I get started with Claude Code?
Install Claude Code using the native installer from Anthropic (not npm, following the March 2026 supply-chain incident). Authenticate with your Anthropic API key. Navigate to your project directory and run "claude" to start a session. Before your first serious task, run /init to generate a CLAUDE.md file by analysing your codebase, then customise it with your conventions. For any non-trivial task, start with /plan so Claude Code maps its approach before writing code. Use /cost to monitor spend and /compact to manage long sessions.
What are the best practices for using Claude Code in a team?
Maintain a detailed shared CLAUDE.md that every developer contributes to and treats as a living document. Establish a convention of using /plan before significant tasks so work is reviewable before execution. Configure permissions in settings.json with wildcard patterns for recurring workflows so the team spends less time clicking "allow". Use the memory system to capture team conventions and feedback. For complex tasks, decompose work into parallel sub-agents rather than running everything in a single thread.

About the Author

James Killick
James Killick

Co-founder at Njin. Building AI-powered sales systems for B2B businesses.

Ready to see AI in action?

Find out how AI-powered systems can accelerate your sales pipeline.