What is Project Mode
If you have only used ChatGPT or Claude.ai in a browser, you are used to a flow like 'open a chat window → ask a question → get an answer → close the window and everything is gone.' Claude Code is different: it always works inside a specific folder. That folder is a project. Every interaction in the session revolves around that folder.
Project Mode = Claude Code Locked Inside One Folder
A project is just a folder
In Claude Code, 'project' is not an abstract concept. It is a folder on your disk. This guide uses one specific empirical project — Patient Capital → Corporate ESG Performance — as the running example, and its folder is ~/papers/pc-esg/. A separate meta-analysis project would live in ~/papers/meta-analysis/. The two are independent.
Before launching Claude Code, you cd into the folder, then type claude. Once started, the working directory of the whole session is locked to that folder. Claude can read any file under it, create new files in it, run scripts in it. It cannot see anything outside the folder unless you explicitly hand over a path, like /Users/han/Demonstration_Data/EmpiricalWiki/.
This 'locked to a folder' property is called the working directory. It is the single biggest difference between Claude Code and a web chat tool.
What the Patient Capital → ESG project folder looks like
~/papers/pc-esg/ ├── CLAUDE.md ← project notes (protected term list, A2 primary measure) ├── checkpoint.md ← cross-session progress log ├── 01_文献/ ← literature PDFs indexed by 8 frameworks ├── 02_变量字典/ ← 测算方法说明.md, 变量对照表.xlsx ├── 03_原始数据/ ← CSMAR + Huazheng ESG + myopia raw data ├── 04_中间数据/ │ ├── main_panel.dta ← main panel: 26874 obs, 3608 firms │ ├── csmar_panel.dta │ └── 耐心资本_七合一_WZY.dta ├── 05_分析代码/ │ └── 耐心资本-全套代码.do ← do0_setup → do10_robust ├── 06_结果输出/ │ ├── tables/ ← Table 1–10 (RTF) │ └── tables_tsv/ ← Table 1–10 (CSV readable) ├── 07_论文写作/ │ ├── 01_主表/ │ └── 02_文献综述/ └── .git/ ← git version history
Why use a folder as the project boundary
Keeping everything project-related under one folder means Claude Code only cares about the patient-capital → ESG paper for the duration of the session. It will not poke around in your other empirical projects, nor will it read your browser history. It is normal to have 3-4 empirical projects in parallel as a researcher; each lives in its own folder and gets its own Claude Code session.
The folder boundary is also a natural isolation boundary. If one day you want to try a new PC measure (swap A2 for B1) without breaking the main regression, you do cp -r ~/papers/pc-esg ~/papers/pc-esg-experiment and launch Claude Code in the copy. The original project stays untouched.
Git history belongs to this folder. Each commit captures the project's state at that moment. To go back to the state at the end of phase 1, git checkout takes you there. Claude Code integrates closely with git — it will suggest commits at logical breakpoints and can read git log to recall what changed.
What to put in the folder and what to leave out
Put in: paper source (.tex / .docx), data (.dta, raw .xlsx, CSMAR zips), scripts (do / R / Python all fine), bibliography (.bib), the CLAUDE.md notes file, the checkpoint.md progress file, advisor meeting notes. These are part of the project; Claude needs them at hand.
Leave out: very large intermediate artifacts (multi-GB Bootstrap permutation samples) — keep those outside the folder and reference them by absolute path. Do not put sensitive data (subject PII, unredacted micro-survey data) in plain form; encrypt or add to .gitignore. Do not dump unrelated files in — they pollute Claude's working context.
Rule of thumb: if you are unsure, put it in. Claude does not auto-read every file; it only reads on demand when something in your instruction needs it. Extra files do not cost you context.
One-line summary of project mode
A web chat tool is like a question kiosk: ask, get an answer, next time you arrive everything is gone. Claude Code is like a resident assistant living inside your Patient Capital → ESG folder: it sees the months of do0–do10 runs, the 12 ready tables, all the phase-1 and phase-2 Stata logs, knows the PC_A2 primary measure decision, knows KZ stands in for WW. The next time you launch Claude Code in the same folder, it picks up where you left off — through files, through git, through CLAUDE.md and checkpoint.md, not through its own memory.
Common beginner pitfalls
Launching in the wrong folder
Running claude inside ~/Downloads makes Claude Code treat ~/Downloads as the project root. Always cd into something like ~/papers/pc-esg first. Sanity check: after launch, type pwd and confirm the working directory is correct.
Starting sessions on the desktop
Launching from the desktop or your home directory exposes Claude to a pile of unrelated files and it cannot tell which belong to the current task. Put each empirical project in its own clearly named folder; cd in before launching.
Moving the project folder around
If the folder path changes, absolute paths hard-coded in CLAUDE.md and relative paths used by .do files may break. Commit current state with git before moving, and after moving, launch Claude Code to verify it can still read main_panel.dta and other key files.