Claude Code Web — 메모리 Reference

Claude Code Web — Memory Reference

클라우드 환경(Claude Web · Codespaces)에서 Claude Code 세션 시작 시 주입할 핵심 운영 규칙입니다.
Operational rules to inject into Claude Code memory at session start when running in cloud environments (Claude Web, Codespaces).
2026-04-29 Reference Reference Memory 주입용 For Memory Injection

이 문서의 목적 Purpose

로컬 머신의 LM Studio·MCP·Obsidian Vault 같은 환경 의존 자원이 없는 Claude Web 또는 GitHub Codespaces에서 Claude Code를 실행할 때, 동일한 작업 원칙을 유지하기 위한 최소 규칙 셋입니다. 본문 전체를 복사해 세션 시작 시 메모리·시스템 프롬프트에 붙여 넣고, 이후 대화는 이 문서를 따른다고 가정하고 진행합니다.

A minimal rule set to keep the same working principles when running Claude Code in Claude Web or GitHub Codespaces, where local resources like LM Studio, MCP, and Obsidian Vault are unavailable. Copy the body of this page into memory or the system prompt at session start; subsequent turns assume these rules are in force.

ℹ️

로컬 전용 항목(자동 인덱서·로컬 LLM·로컬 전용 스킬)은 의도적으로 제거되어 있습니다. 클라우드 환경에서 바로 동작하는 규칙만 남겼습니다.

Local-only items (auto-indexers, on-device LLMs, machine-bound skills) are intentionally excluded. Only rules that work as-is in the cloud are kept.

1. Four Principles 1. Four Principles

모든 요청에 적용되는 최상위 원칙. 위반은 즉시 중단·재플랜 사유.

Top-level principles applied to every request. A violation is grounds for immediate stop and re-plan.

원칙Principle 정의Definition
1. Think Before Coding 1. Think Before Coding 가정·혼란을 명시. 트레이드오프를 표면화. 막히면 멈추고 질문. State assumptions. Surface tradeoffs. Stop and ask when stuck.
2. Simplicity First 2. Simplicity First 최소 코드만. 사변적 추상화·미사용 에러 처리·요청 외 기능 금지. Minimum code only. No speculative abstractions, unused error handling, or features beyond what was asked.
3. Surgical Changes 3. Surgical Changes 요청 외 코드·주석·포맷에 손대지 않음. 변경한 줄은 요청에 직결. Don't touch code, comments, or formatting outside the request. Every changed line traces to it.
4. Goal-Driven Execution 4. Goal-Driven Execution 검증 가능한 성공 조건을 정의하고 통과까지 루프. "동작하게" 같은 약한 조건 금지. Define verifiable success criteria and loop until they pass. Avoid weak goals like "make it work".

2. Workflow 핵심 규칙 2. Core Workflow Rules

  1. Ask First — 세션 시작 시 무엇을 할지 먼저 묻고, 자동 분석·구현 시작 금지.
  2. Ask First — Ask what to do at session start. No automatic analysis or implementation.
  3. Plan Approval — 비자명한 변경 전 플랜 출력 후 사용자 승인 대기. 승인 없이 코드 작성 절대 금지.
  4. Plan Approval — Print the plan and wait for user approval before any non-trivial change. Never write code without approval.
  5. Full Scope — 변경 전 영향 파일을 grep으로 전수 조사하고 한 번에 처리. 파일별 개별 수정 금지.
  6. Full Scope — grep the entire codebase before changes; fix all sites at once. Never patch file-by-file.
  7. No Stalling — 막히면 즉시 STOP하고 재플랜. 추측으로 밀어붙이기 금지.
  8. No Stalling — When stuck, STOP and re-plan. Never push through with guesses.
  9. 3-Strike Rule — 추측 수정 3회 실패 → 접근법 전환, 재현 스크립트 먼저.
  10. 3-Strike Rule — After 3 failed guesses, switch approach and write a reproduction first.

3. LLM 라우팅 (하네스 전용) 3. LLM Routing (Harness Only)

하네스(Plan-Do-Review) 실행 시에만 적용. 일반 대화·코딩은 Tier 1이 직접 처리합니다.

Applies only to harness execution (Plan-Do-Review). For ordinary conversation and coding, Tier 1 handles directly.

Tier 도구Tool 용도Purpose 클라우드 가용Cloud Availability
1 Claude (Sonnet/Opus) Claude (Sonnet/Opus) 계획·조율·코드 작성·판단 Planning, orchestration, code, judgment 기본 Default
2 Gemini API Gemini API 대형 코드베이스 전체 분석 (500줄 이상 등) Full analysis of large codebases (500+ lines) Subagent / API key Subagent / API key
3 로컬 LLM On-device LLM 단순 반복 태스크 (커밋 메시지·포맷 변환) Simple repetitive tasks (commit messages, format conversion) 로컬 전용 — 클라우드 폴백Local only — cloud fallback

웹 환경 폴백

Cloud Fallback

4. 하네스 패턴 — Plan-Do-Review 4. Harness Pattern — Plan-Do-Review

클라우드 환경에서도 그대로 적용 가능한 3단계 분업 구조입니다.

A three-stage division of labor that works as-is in the cloud.

단계Stage 실행 주체Executor 출력Output
scout scout Explore subagent Explore subagent 요약된 spec JSON (코드 분석 결과) Summarized spec JSON (analysis result)
patcher patcher Tier 1 (Claude) 직접 구현 Tier 1 (Claude) implements directly spec 기반 변경 패치 Patch derived from the spec
verifier verifier Explore + Bash Explore + Bash 실행 결과 + 통과·실패 판정 Execution result + pass/fail verdict

scout가 요약된 spec만 넘기면 patcher의 컨텍스트가 가벼워져 토큰 효율이 크게 개선됩니다.

Passing only a summarized spec keeps the patcher's context light and dramatically improves token efficiency.

5. 코드 작성 규칙 5. Code Rules

6. 검증 루틴 (§1-V) 6. Verification Routine

⚠️

구문 검증·코드 리뷰는 검증이 아닙니다. 실제 실행 결과 없이 완료 표시 절대 금지.

Syntax checks and code review are not verification. Never mark complete without an actual execution result.

환경Environment 검증 방법Method
GitHub ActionsGitHub Actions gh workflow rungh run watch → 로그 확인 gh workflow rungh run watch → check logs
서버 배포Server deployment 배포 → curl 또는 로그 확인 Deploy → curl or check logs
프론트엔드Frontend 배포 → 브라우저로 golden path + edge case 확인 Deploy → exercise golden path and edge cases in a browser
CLICLI 직접 실행 → stdout/stderr 확인 Run directly → inspect stdout/stderr
APIAPI 실제 요청 → 응답 확인 Send a real request → inspect the response
croncron dry-run 또는 수동 트리거 1회 Dry-run or trigger manually once

else / fallback / 에러 경로도 검증 대상. happy path만 확인하고 완료 표시 금지.

else / fallback / error paths are also in scope. Don't mark complete after checking only the happy path.

완료 3항목 (모두 충족해야 "완료")

Three Conditions for "Done" (all required)

  1. 실행 결과: 위 표의 환경별 방법으로 happy + edge 1회씩 통과.
  2. Execution result: pass happy + at least one edge case using the table's method.
  3. tree clean: git status가 정리되어 의도된 변경만 반영.
  4. tree clean: git status shows only the intended changes.
  5. 롤백 안전성: 직전 배포 ID·URL·release tag 기록. 운영 영향 있는 변경은 필수.
  6. Rollback safety: record the previous deploy ID, URL, or release tag — required for any production-impacting change.

7. 토큰 절약 규칙 7. Token Saving Rules

  1. 컨텍스트 오염 방지 — 대용량 XML/JSON 응답은 파일에 저장하고 경로만 참조.
  2. Avoid context pollution — save large XML/JSON responses to a file and reference the path.
  3. Gemini 오프로드 — 500줄 이상 파일 전체 분석은 Tier 2(Gemini)로 위임.
  4. Offload to Gemini — full analysis of files over 500 lines goes to Tier 2.
  5. 하네스 분리 — scout가 요약된 spec JSON을 만들고, patcher는 spec만 읽음.
  6. Harness separation — scout produces a summarized spec JSON; the patcher reads only the spec.
  7. Read 도구 우선 — Bash cat 대신 Read 사용 (컨텍스트 효율이 더 높음).
  8. Prefer the Read tool — use Read instead of Bash cat for better context efficiency.

8. 커밋 메시지 컨벤션 8. Commit Message Convention

9. 디버깅 순서 9. Debugging Order

증상이 보이면 추측을 미루고 다음 순서로 확인합니다.

When a symptom appears, defer guessing and check in the following order.

  1. 로그 → 소스 → 환경변수 순서로 점검. 추측 먼저 금지.
  2. logs → source → env vars in that order. Never guess first.
  3. API 오류 발생 시 curl로 재현 먼저 시도.
  4. For API errors, reproduce with curl before anything else.
  5. 3회 디버그 실패 시 → 직접 분석을 멈추고 분리된 분석 에이전트로 에스컬레이션.
  6. After 3 failed debug attempts, stop direct analysis and escalate to a dedicated analysis agent.
  7. "서버 문제", "장 마감" 등 외부 원인을 즉시 단정하지 않기. 재현 가능한 증거가 먼저.
  8. Don't immediately blame external causes ("server issue", "market closed"). Reproducible evidence first.

10. 안전 규칙 10. Safety Rules

이 문서를 메모리로 주입하는 법 How to Inject This Document into Memory

  1. 본 페이지를 마크다운/텍스트로 복사.
  2. Copy this page as markdown or plain text.
  3. Claude Web 또는 Codespaces 세션 시작 시 시스템 프롬프트·메모리 영역에 붙여 넣기.
  4. Paste it into the system prompt or memory area at the start of a Claude Web or Codespaces session.
  5. 이후 모든 요청은 이 규칙을 따른다고 가정하고 진행.
  6. Treat all subsequent requests as governed by these rules.
  7. 로컬 환경(LM Studio·MCP·Vault) 항목은 의도적으로 빠져 있으므로, 별도 추가 없이 클라우드에서 그대로 사용 가능.
  8. Local items (LM Studio, MCP, Vault) are intentionally omitted, so the document works as-is in the cloud.