Coding Agents in Practice (1/5) — Claude Code Workflow: CLAUDE.md, Skills, Memory, Session Recovery

AI ์ฝ”๋”ฉ ์—์ด์ „ํŠธ ์‹ค์ „ (1/5) — Claude Code ์›Œํฌํ”Œ๋กœ์šฐ: CLAUDE.md·์Šคํ‚ฌ·๋ฉ”๋ชจ๋ฆฌ·์„ธ์…˜ ๋ณต์›

Same model, different workflow — different results. Four core building blocks, organized as a real-world pattern.


ํ•ต์‹ฌ ์š”์•ฝ

  • Four pieces: CLAUDE.md (identity) / Skills (task modules) / Memory (cross-session persistence) / Session Recovery
  • Primary source: Anthropic Claude Code documentation at code.claude.com
  • Core principle: "An agent is the model plus everything that sits on top of it" — and how that everything is structured is the workflow
  • Outcome: a well-shaped workflow reduces token cost, retry count, and debugging cost on the same task

1. Why workflow design now beats model choice

When coding agents were new, the answer was always "use a stronger model." By 2026, the same Sonnet 4.6 or Opus 4.7 produces meaningfully different results depending on workflow design. Stronger models demand more accurate context — and when context is wrong, a stronger model gives you wrong answers more confidently.

Claude Code provides four building blocks for shaping the workflow. This piece walks through each, with the underlying principle and the real-world pattern.


2. CLAUDE.md — Agent identity

Role. A markdown file at the project root. The agent reads it automatically at the start of every session. It carries "what is this project, and what are the rules?"

Authoring principles. - Read First section: list the additional core docs the agent should pull in. Keeps onboarding deterministic. - Hard Rules: spell out what must never happen — external publishes, credential edits, sweeping rewrites. - Workflow: a rule like "3+ steps → brainstorming → writing-plans → execution → verification" tells the agent how to escalate. - Scope / Surface: the directory structure and the responsibility of each directory.

Common mistakes. - Writing too long. CLAUDE.md is always in context; every line costs tokens. Keep it lean. - Forgetting "what does this project do?" The agent needs that on day one. - Embedding fast-changing info. Move volatile info to a separate docs/ file and link from CLAUDE.md.

Test. "If the next session starts fresh and reads only this CLAUDE.md, can the agent follow this project's rules?"


3. Skills — Task modularization

Role. Files at .claude/skills/<skill-name>/SKILL.md. Each skill is a reusable task package corresponding to one kind of task (e.g., publish, verify, git-commit, compile).

When to extract a skill. - The same kind of task happens repeatedly (blog publish, commits, meeting notes). - The task has multiple stages (validate → process → output → report). - The procedure is something the team should share.

Authoring principles. - Triggers: list the keywords that should activate the skill. - Stages: input → validation → processing → output → report. - Hard rules: things this skill must never do (e.g., "do not publish without user confirmation"). - Output format: how to present results to the user (markdown table, JSON, Discord message, etc.).

Avoid duplication. When two skills overlap, merge them. Too many skills confuses skill selection. 5–15 is a healthy operating range.


4. Memory — Cross-session persistence

Role. Information that should outlive any single session. Claude Code memory typically operates in three tiers:

  • User profile (memory/user_profile.md, feedback_*.md): the user's role, preferences, past corrections.
  • Project memory (memory/project_*.md): in-progress decisions, milestones, external system IDs.
  • References (memory/reference_*.md): pointers to where information lives outside the project (Linear project keys, Grafana dashboards).

Save vs. don't save. - Save: explicit user rules, corrections of bad approaches, non-obvious reasons behind decisions, external system coordinates. - Don't save: facts derivable from code, change history (git log is authoritative), one-shot task details, anything already in CLAUDE.md.

The MEMORY.md index. All memory enters through a MEMORY.md index file. The index is always loaded into context — keep entries under 150 characters per line and the file under 200 lines.

Validity check. Memory ages. Before recommending from memory, verify against the current state of the code or external system.


5. Session Recovery — Resuming safely

Problem. Claude Code sessions end — context limit, user closure, system restart. The agent needs a way to not lose where it was and resume from that point in the next session.

Three durable stores. - tasks/plan.md: current milestones, completed items, next action. The single read-first entry point at session start. - tasks/lessons.md: a what-worked / what-didn't / why table. Prevents repeating the same mistake. - tasks/sessions/YYYYMMDD-HHMMSS.md: one snapshot per session. At session end, log changed files, decisions, and next steps.

Session start hook. Claude Code's SessionStart hook can auto-inject these three. The result: a new session starts as if the prior context were already recovered.

Recovery cautions. - Verify that files or features the previous session claimed to create actually exist. Memory is a point-in-time observation, not live state. - Long-paused work may have external state drift (branches, dependencies, data). Run git status and dependency checks before resuming.


6. The integrated workflow — One real cycle

How the four pieces combine in a single cycle:

  1. User request → the agent recognizes a trigger keyword and calls a Skill
  2. Skill entry → check CLAUDE.md rules + memory + current state
  3. 3+ step task → pass through brainstormingwriting-plansexecutionverification gates
  4. Session end → log changed files, decisions, and next step into tasks/sessions/
  5. Next session start → plan.md / lessons.md / latest session.md auto-injected → resume immediately

Signs the cycle is working. - The user does not have to repeat the same answer twice (memory is working). - The user does not have to ask "where did we leave off?" (session recovery is working). - No external publish or destructive change happens without user confirmation (Hard Rules are working).


7. At a glance

Component Location Core line Common mistake
CLAUDE.md Project root Identity + Hard Rules + Workflow Too long / volatile info inside
Skills .claude/skills/<name>/SKILL.md Task module: triggers + stages + output Too many overlapping skills
Memory memory/MEMORY.md index + per-file Non-obvious cross-session info only Saving facts derivable from code
Session Recovery tasks/plan.md + lessons.md + sessions/ Where the next session resumes Trusting memory without verification

Next up

Part 2/5 lines up Cursor 3 vs Claude Code vs GitHub Copilot — May 2026 comparison. Three coding agents with different design philosophies, sorted by price, capability, and real workflow fit.


References

  • Anthropic, Claude Code Documentation — code.claude.com (verified 2026-05-05).
  • Anthropic, Hooks and Skills Reference — code.claude.com/docs/hooks (verified 2026-05-05).
  • The "What Is Harness Engineering?" series provides the theoretical background for workflow design.

This is part 1/5 of the Coding Agents in Practice series.

๋Œ“๊ธ€

์ด ๋ธ”๋กœ๊ทธ์˜ ์ธ๊ธฐ ๊ฒŒ์‹œ๋ฌผ

Agent Memory Engine (2/10) — Building an AI Agent Memory System with SQLite Alone

"ML Foundations (9/9) — PyTorch vs TensorFlow, and the Road to Local LLMs"

"RAG Core Study (14/26) — Evaluation Sets with RAGAS & DeepEval"

"ML Foundations (8/9) — Deep Learning Architectures: CNN, RNN, Attention"

"ML Foundations (7/9) — Deep Learning Training: Optimizers, Regularization, Initialization"

OpenClaw to Hermes Migration (2/13) — What to Preserve, Partially Port, or Discard

AI Agents I Built (5/7) — Building an Automated Blogger API Publishing System