AI-Wiki/Claude Code

Claude Code Master Guide

Claude Code gets powerful when you stop treating it like a chatbot and start treating it like a project-aware development agent. This is my working library of the prompts and patterns that do that: searchable, taggable, one click to copy.

Field guide

Start with the workflow, then dig into the mental model, guardrails and decision rules below.

The workflow that compounds

Each project follows this arc, and the last step loops back, so every pass is faster than the last.

Foundation

01Project idea
02Project interview
03Project brief

Rules & context

04CLAUDE.md
05Guardrails
06Knowledge base

Build capability

07Skills
08Verification
09Agents

Automate & compound

10Hooks
11Scheduled checks
12Continuous improvement

Loops back to step 01, so each cycle makes the next faster.

The mental model: not just a chat

Claude Code works best with persistent project context. Instead of writing one-off prompts every time, you build reusable structure:

  • CLAUDE.md for project instructions
  • Skills for repeatable workflows
  • Knowledge bases for source material
  • Hooks for automatic processing
  • Agents for specialist review
  • Scripts for deterministic tasks
  • Verification steps for quality control

The goal: move from "ask Claude manually every time" to "Claude knows the project, follows rules, uses reusable workflows, and verifies its own output."

Guardrails: Always / Ask First / Never

Always Do

  • Run tests before finalizing changes
  • Explain assumptions
  • Keep changes scoped
  • Preserve existing behavior unless asked

Ask First

  • Deployments
  • Sending messages
  • Deleting data
  • Changing production config
  • Cost-impacting decisions

Never Do

  • Expose secrets
  • Modify production without approval
  • Rewrite unrelated files
  • Commit unfinished work
  • Invent missing facts
Anatomy of a skill

There's no official "levels" system, but it helps to picture how a skill's content loads, so long reference material costs almost nothing until it's actually needed:

PartWhen loadedToken costContent
MetadataAlwaysLowName & description (frontmatter)
InstructionsWhen invokedMediumSKILL.md body
ResourcesAs neededFlexibleScripts, templates, data

Instructions for flexible judgment · code for repeatable operations · resources for factual lookup.

Good verification steps
  • Check against source files
  • Run tests
  • Compare output against requirements
  • Use scripts for deterministic validation
  • Ask a critic agent to review
  • Flag assumptions and missing evidence
Automation ideas
HookRun a command on a configured event, e.g. a FileChanged hook when a source file changes
Routine / Scheduled TaskRun recurring checks or summaries: a cloud Routine (/schedule) or a local Scheduled Task
Loop (/loop)Repeat a task on an interval until quality criteria are met
Auto-ingestionTurn raw files into structured knowledge (a FileChanged hook plus a handler)
Auto-reviewReview changes before final output, e.g. /code-review
Prompt, skill, agent or hook?
NeedBest tool
One-time taskPrompt
Repeated workflowSkill
Specialist reviewAgent
Automatic reaction to a file/eventHook
Recurring checkRoutine / Scheduled Task
Repeated improvement cycleLoop (/loop)
Source material organizationKnowledge Base
Project-wide instructionsCLAUDE.md