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.
No prompts match. Try a different term or clear the filters.
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
Rules & context
Build capability
Automate & compound
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:
| Part | When loaded | Token cost | Content |
|---|---|---|---|
| Metadata | Always | Low | Name & description (frontmatter) |
| Instructions | When invoked | Medium | SKILL.md body |
| Resources | As needed | Flexible | Scripts, 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
| Hook | Run a command on a configured event, e.g. a FileChanged hook when a source file changes |
| Routine / Scheduled Task | Run 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-ingestion | Turn raw files into structured knowledge (a FileChanged hook plus a handler) |
| Auto-review | Review changes before final output, e.g. /code-review |
Prompt, skill, agent or hook?
| Need | Best tool |
|---|---|
| One-time task | Prompt |
| Repeated workflow | Skill |
| Specialist review | Agent |
| Automatic reaction to a file/event | Hook |
| Recurring check | Routine / Scheduled Task |
| Repeated improvement cycle | Loop (/loop) |
| Source material organization | Knowledge Base |
| Project-wide instructions | CLAUDE.md |