Repository navigation
Conversation
Upstream revision 5a6848ffd3c2b4f6705aa18547117ed1b1bf05cb from suyuan2022/suyuan-skill.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9404aae110
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| absolute = target.absolute() | ||
| protected = {claude / name for name in PROTECTED} | ||
| if absolute == claude.absolute() or any(absolute == p.absolute() or p.absolute() in absolute.parents for p in protected): |
There was a problem hiding this comment.
Resolve ancestor symlinks before checking protected paths
When a cleanup target has a symlinked ancestor, absolute() leaves that ancestor unresolved, allowing the protected-path check to pass even though shutil.move() moves protected data. For example, with ~/Library/Logs symlinked to ~/.claude/projects, discovery automatically includes ~/Library/Logs/Claude, and cleanup moves the actual ~/.claude/projects/Claude directory into Trash. I reproduced this with an isolated temporary home. The final protection check also misses it because projects itself still exists. Resolve ancestor directories before validating the target against protected paths, while preserving the ability to move a target that is itself a symlink without following it.
Useful? React with 👍 / 👎.
| for key in keys - {"CLAUDE_CODE_SIMPLE"}: | ||
| env.pop(key, None) |
There was a problem hiding this comment.
Clear inherited simple mode when measuring terminal sessions
When this script runs inside a terminal Claude Code session that inherited CLAUDE_CODE_SIMPLE=1, removing that setting and rerunning --measure still passes the stale value to every child because this exclusion applies to all sessions, not just Desktop. I reproduced this with an empty current env and a settings backup containing the removed key: claude_env() retains CLAUDE_CODE_SIMPLE=1, while simple_mode() returns false. Consequently, the documented disable-and-remeasure flow continues measuring without skills or MCP and no longer warns that the results represent simple mode. Preserve the Desktop-injected override only for Desktop sessions; let terminal measurements reread this key from the updated settings like the other settings-derived variables.
Useful? React with 👍 / 👎.
| clean_safe = not processes | ||
| if processes and risky: | ||
| print("\n所选风险操作要求由你正常退出所有 Claude Code / Claude Desktop;脚本不会 kill 进程。") | ||
| input("退出后按 Enter 重新检查:") | ||
| if claude_processes(): |
There was a problem hiding this comment.
Recheck running processes after the final confirmation
If Claude starts after the initial audit—for example, while the user is answering the risk-selection prompts—the empty processes snapshot keeps clean_safe true and bypasses the only subsequent process check, even when identity rotation or Desktop removal is selected. I reproduced this by making Claude become active at the first prompt: the script checked processes only once, then rotated the identity and moved the cache while reporting success. This defeats the requirement that these operations run only after Claude has exited and permits modifications while the application is using the affected state. Perform a fresh process check after confirmation and before destructive operations, including after the potentially lengthy backup.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d960a3f84a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return env | ||
| preserved = {"CLAUDE_CODE_SIMPLE"} if in_desktop_session() else set() | ||
| path = config_dir(pathlib.Path.home()) / "settings.json" | ||
| for source in [path, *sorted(path.parent.glob("settings.json.bak-*"))[-1:]]: |
There was a problem hiding this comment.
Retain removed environment keys across successive settings edits
When multiple settings changes are made within the same Claude session, consulting only the latest backup lets previously removed environment variables leak back into measurements. For example, remove ENABLE_LSP_TOOL=0 after one backup, then back up settings again before another edit: neither the current settings nor the latest backup contains that key, so claude_env() retains the session's inherited ENABLE_LSP_TOOL=0. I reproduced this with two timestamped backups. Subsequent measurements therefore continue disabling LSP despite the updated configuration, undermining the documented edit-and-remeasure verification. Track settings-derived keys across the relevant backups rather than only the newest one.
Useful? React with 👍 / 👎.
Summary
Verification