Claude Code 如何在無 Git 網站專案中管理多個工作階段並追蹤上載狀態
Running several Claude Code sessions on one site without git: a shared log that also tracks what's uploaded
LM web lab 提出無 Git 網站專案的 Claude Code 多工作階段管理方法,以共享純文字日誌記錄修改檔案和上載狀態。各工作階段編輯前重讀檔案,並在 CLAUDE.md 設定編輯規則;日誌會列出仍標記為 Uploaded: no 的待上載項目,也記錄部分上載狀態。
Most advice about parallel Claude Code sessions starts with "use git worktrees". That's good advice if you use git. A lot of people who build sites with Claude don't: they keep a folder on their laptop, open several chats on it, and upload the files by hand.
That's my setup, across seven internal web apps for a small company. Two problems come with it.
The first is overwrites. Session A edits style.css. Session B read style.css an hour ago, makes its own change from that old copy and writes the whole file back, and A's work is gone without any error, so nothing tells you it happened.
The second is deploy state. After a day with several chats, which files have changed since the last upload? File dates lie (a chat touched a file and reverted it), and each chat only remembers its own work.
What fixed it
A plain text log in the project, which every session reads before editing and appends to when it's done:
## 2026-03-14 16:20 — Contact form: phone number field
- Session: contact form
- Version: 2.3.8
- Files: contact.php, js/form.js, inc/version.php
- What changes: the contact form asks for a phone number (optional)
- After upload: nothing
- Uploaded: no
And a short block of rules in CLAUDE.md. Re-read a file right before editing it, even if you read it earlier. Change files only with targeted edits, never by rewriting the whole file or copying a backup over it. Bump the version on every change, so browsers reload the CSS and JS. Don't tidy up changes you didn't make; they're another session's work in progress.
With that in place, "what do I have to upload?" has an exact answer: every entry still marked Uploaded: no, from any session, each file once. "I uploaded it" flips them to yes (date).
Things that only showed up in testing
The log needs a starting entry that lists the whole site as not uploaded. Otherwise the first chat you ask says "nothing to upload", because the log is empty, while the server is months behind.
Partial uploads need their own status. If you upload everything except main.js, marking the entries as uploaded loses main.js from the next list; leaving them as not uploaded makes you re-upload everything. The skill now writes partly (date), still to upload: main.js.
If you've always dragged the whole folder to the server, your .env file is probably already online, and maybe downloadable. Setup now says so and tells you to delete it there and change the keys.
The skill
I packaged all of this as a Claude skill and Claude Code plugin, MIT licensed: https://github.com/lmweblab/claude-code-parallel-sessions. You tell Claude you keep several chats open on the project, and it asks how you upload, finds your version number, builds the never-upload list and writes the two files.
It's a set of rules, not a lock. Two sessions editing the same file in the same few seconds can still collide. The rules make stale copies and forgotten uploads rarer; they don't make them impossible.
Written with AI assistance (Claude), which also helped test the skill.
來源:DEV Community · dev.to