Claude Env Cleanup
Safety Contract
Default to audit-only until the user explicitly asks to clean. Never print raw secrets, tokens, API keys, OAuth values, refresh tokens, or full private config values. Report only key presence, route markers, table/column hits, process names, and safe operational implications.
Before destructive or mutating work, create a timestamped backup under /Users/kevin/Backups/ or next to the file being edited, then state the backup path. Make minimal scoped edits. Do not remove unrelated proxies, especially ClashX on 7890, when the problem is Claude-specific routing on 127.0.0.1:15721.
Uninstall official Claude App or Claude Code itself only when the user explicitly asks to delete, remove, or uninstall the body/app/CLI. When that explicit request exists, stop running confirmed official Claude processes first, move app/data/browser-bridge residue to Trash or a timestamped backup folder, uninstall package-manager installs with the package manager when possible, and verify that the binary/app no longer exists. Treat Chrome PWA shortcuts, Claude Code URL Handler.app, Anthropic Native Messaging manifests, and Claude browser extensions as app/CLI entry points when the user asks to remove Claude App and Claude Code.
Preserve Teamo Code unless the user separately and explicitly asks to remove Teamo. Preserve com.claude-to-im.bridge and /Users/kevin/code/Claude-to-IM-skill unless the user explicitly asks to remove that bridge; Kevin uses it as a Codex integration, not as proof of official Claude. Do not delete /opt/homebrew/bin/teamo, @teamolab/teamo-cli, ~/.teamo, or ~/.claude/projects. Teamo terminal verification can depend on ~/.teamo/* and session JSONL files under ~/.claude/projects. If a short-lived claude process appears with parent teamo, treat it as Teamo runtime behavior, not proof that the official Claude Code binary is still installed.
For coding-agent config hygiene, distinguish active config from historical evidence. Audit active config files first. Do not recursively grep session logs, debug logs, caches, plugin bundles, or backups by default; they create noise and can expose private content. Move historical debug/telemetry/router backups only when the user asks to clean local residue or privacy traces.
For browser locale, timezone, and font signal work, report consistency facts and safe local changes only. Do not delete macOS system fonts or system-protected font assets. It is acceptable to move user-installed fonts to a timestamped backup and clear the user font cache when explicitly requested, but state that macOS system fonts such as PingFang, Hiragino, STHeiti, and Songti/STSong may still be detectable.
For Claude network environment monitoring, prefer browser-visible facts for DNS/WebRTC/IP quality. Local command output is useful for proxy, route, resolver, and history checks, but DNS leak verdicts should be based on browser-side detection whenever possible. Do not open a large battery of sites by default; use only the three core manual checks listed below unless the user asks for more.
Browser cookie and site-data cleanup is a manual, high-blast-radius step. In post-ban workflows, report the relevant browser profile targets and give clear manual steps. Do not delete Chromium/Safari cookie databases, Local Storage, IndexedDB, Service Worker data, cache folders, or whole browser profiles unless Kevin explicitly requests destructive browser-data cleanup and confirms the scope.
For environment fingerprint profiles, store only a sanitized local baseline by default. Keep region, timezone, locale/languages, proxy local ports, DNS resolver summary, ASN/provider, WebRTC verdicts, and PWR fingerprint verdicts when available. Redact or omit raw public IPs, LAN IPs, gateways, tailnet addresses, mDNS candidate values, browser profile names, raw PWR detection payloads, cookie contents, tokens, and secrets. Do not commit user-specific profile files to a public skill repo.
For official Claude Code privacy controls, prefer Anthropic's documented environment variables in ~/.claude/settings.json under the top-level env key. These are low-risk config writes after backup, but they still require restarting Claude Code/terminal apps to ensure startup-read env values apply. Do not set skipWebFetchPreflight by default; it is a separate WebFetch safety-check opt-out with a security tradeoff, not part of CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC.
Quick Audit
Run the bundled read-only audit first:
bashpython3 "$SKILL_DIR/scripts/audit_claude_env.py"
If SKILL_DIR is not set, resolve it from the skill folder path and run:
bashpython3 ~/.codex/skills/claude-env-cleanup/scripts/audit_claude_env.py
Use the output to decide which workflow applies. If the audit finds sensitive keys, say only that the key exists and where it is configured, not its value.
The audit also reports official Claude privacy controls from the current process and ~/.claude/settings*.json, including DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, DISABLE_FEEDBACK_COMMAND, CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY, and DO_NOT_TRACK.
For network environment monitoring, run the read-only network audit:
bashpython3 ~/.codex/skills/claude-env-cleanup/scripts/audit_network_env.py
When the user explicitly wants live public-IP and Claude reachability checks, add --external. To track whether the node region changes over time, append a history snapshot:
bashpython3 ~/.codex/skills/claude-env-cleanup/scripts/audit_network_env.py --external --append-history ~/.codex/network-env-history.jsonl
For a banned-account recovery self-check, add --post-ban so the audit prints browser site-data targets, manual cleanup reminders, and the five-site guide checklist:
bashpython3 ~/.codex/skills/claude-env-cleanup/scripts/audit_network_env.py --post-ban
For a reusable local environment baseline, create or read ~/.claude/session-env/environment-fingerprint-profile.md. When answering from that file, say it is the user-confirmed local baseline and include its date before deciding whether a live re-check is needed.
Decision Flow
-
If the user only asks whether Claude leftovers exist, run audit-only and summarize:
- Claude config files present or missing
ANTHROPIC_*key presence- route markers such as
127.0.0.1:15721,PROXY_MANAGED,api.302.ai,302ai-claude-code,glm-5.2 - CC Switch DB/table hits
- whether port
15721is listening
-
If the user wants Claude Code back on official
claude.aiauth, preserve active non-official routes unless they explicitly ask to abandon them. Focus on stale official-profile values in~/.cc-switch/cc-switch.dband high-priority env values in~/.claude/settings.jsonthat can trigger "connectors disabled because ANTHROPIC_API_KEY or another auth source takes precedence". -
If the user wants to remove non-official Claude routing, back up and then remove Claude-specific route overrides from:
~/.claude/settings.json~/.codex/config.toml~/.cc-switch/settings.json~/.cc-switch/cc-switch.db
-
If the user says CC Switch can be deleted or asks to remove it completely, use the "Remove CC Switch App and State" pattern below. This is broader than route cleanup: include the Homebrew cask,
/Applications/CC Switch.app,~/.cc-switch, process state, LaunchAgents, and port15721, while preserving unrelated Codex/Teamo/Claude-to-IM bridge components. -
If the user asks about browser/system detection signals such as time zone, browser language,
Intllocale, timezone offset, emoji style, or installed Chinese fonts, use the "Locale, Time Zone, and Font Signal Hygiene" pattern. Restart browser-family apps before trusting post-change results because browser runtimes can cache timezone and font state. -
If the user asks about Claude network environment, IP purity, DNS leak, WebRTC leak, or node stability, use the "Claude Network Environment Monitoring" pattern. Prefer current browser results from the three core sites over command-line-only conclusions.
-
If the user asks what the local timezone, exit region, DNS, IP, WebRTC, PWR fingerprint, browser language, or environment fingerprint baseline is, use the "Environment Fingerprint Profile" pattern. Prefer a user-confirmed sanitized baseline first, then run live checks only when freshness matters.
-
If the user asks for new-account usage takeaways, account warm-up, "养号期", or "指纹重置", use the "Account Stability and Fingerprint Reset Takeaways" pattern. Present these as operational stability heuristics, not as a guarantee that account risk is eliminated.
-
If the user says an account was banned, asks what to do after a ban, or asks to clear browser cookies, remove CC Switch, and re-check Claude App/Code, use the "Post-Ban Account Reset Self-Check" pattern. Keep it audit-first, make manual cookie/site-data actions highly visible, and do not perform destructive browser cleanup unless explicitly requested.
-
If the user calls something a Claude "skill" but it may be an installed artifact, verify the artifact class first:
- skill folder
- global npm or Homebrew CLI
- app bundle
- LaunchAgent
- local data directory
- log directory
Then clean the actual artifact class, not the label the user guessed.
-
If the user explicitly asks to delete official Claude App or Claude Code itself, use the "Uninstall Official Claude App and Claude Code" pattern below. This is a broader uninstall than route cleanup; include app bundles, package-manager installs, binaries, LaunchAgents, updater jobs, app support data, caches, preferences, saved state, and logs where present.
-
If Teamo or
com.claude-to-im.bridgeis mentioned, run a preservation check before and after cleanup: verifyteamostill resolves,~/.teamostill exists,~/.claude/projectsis not removed, and the bridge is still present/running when it was intentionally preserved. -
If the user asks to clean local coding-agent configs based on request-chain trust rules, audit for four categories:
- provider route overrides:
ANTHROPIC_BASE_URL,OPENAI_BASE_URL,api_base_url,baseUrl, local proxy ports, third-party routers - request rewriting surfaces: Claude Code Router, provider transformers, gateway adapters, custom system-prompt/status-line commands
- permission bypasses:
bypassPermissions, skipped dangerous-mode prompts, unsafe host-header fallback - telemetry/debug residue: failed event files, debug logs, obsolete router logs, old DB/env backups containing key names
Clean only active-risk items by default. Preserve intentional tools and credentials unless the user asks to remove the tool itself.
- If the user asks to enable official Claude Code privacy controls, use the "Official Claude Code Privacy Controls" pattern. Prefer the documented
envblock in~/.claude/settings.json, back up before editing, validate JSON after editing, and remind the user to restart Claude Code and terminal apps.
Known Local Surfaces
Treat these as the high-yield inspection points:
~/.claude/settings.json~/.claude/settings.jsontop-levelenvprivacy controls:DISABLE_TELEMETRYDISABLE_ERROR_REPORTINGCLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICDISABLE_FEEDBACK_COMMANDCLAUDE_CODE_DISABLE_FEEDBACK_SURVEYDO_NOT_TRACK
~/.claude/settings.bailian.json(separate profile; do not merge with main route)~/.claude.json~/.codex/config.toml~/.cc-switch/settings.json~/.cc-switch/cc-switch.db/Applications/CC Switch.app- Homebrew cask
cc-switch ~/.claude-code-router/config.json~/.cursor/mcp.json~/.gemini/settings.json~/.gemini/config/mcp_config.json~/.kiro/settings/cli.json~/.openclaw-lan-u*/openclaw.json~/.claude-sync/config.json~/Library/LaunchAgents/~/Library/Logs//Applications/Claude.app~/Applications/Chrome Apps.localized/Claude.app(Chrome PWA shortcut tohttps://claude.ai/)~/Applications/Claude Code URL Handler.app(official Claude Code deep-link handler forclaude-cli://)- Chromium Native Messaging manifests:
~/Library/Application Support/*/NativeMessagingHosts/com.anthropic.claude_browser_extension.json~/Library/Application Support/*/*/NativeMessagingHosts/com.anthropic.claude_browser_extension.json~/Library/Application Support/*/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json~/Library/Application Support/*/*/NativeMessagingHosts/com.anthropic.claude_code_browser_extension.json
- Claude Chrome extension IDs observed in manifests or installed profiles:
fcoeoabgfenejglbffodgkkbkcdhcgfn(Claude in Chrome (Beta)observed locally)dihbgbndebgnbjfmelmegjepbnkhlgnidngcpimnedloihjnnfngkgjoidhnaolf
- global npm package
@anthropic-ai/claude-code - official npx cache paths such as
~/.npm/_npx/*/node_modules/@anthropic-ai/claude-code - Teamo Code preservation surfaces:
/opt/homebrew/bin/teamo, global package@teamolab/teamo-cli,~/.teamo, and~/.claude/projects - Claude Code binaries found by
which -a claudeor likely bin folders such as~/.npm-global/bin,~/.local/bin,/opt/homebrew/bin, and/usr/local/bin - Claude app data under
~/Library/Application Support/Claude* - Claude app caches, preferences, saved state, and logs under
~/Library/ - Claude Code local cache and state markers such as
~/Library/Caches/claude-cli-nodejsand~/.claude-code-now-last-dir - Shared Claude/Teamo state markers such as
~/.claudeand~/.claude.json; these may reappear and are not proof by themselves that official Claude Code is still installed - manual browser site-data cleanup targets:
- Chromium-family profile stores such as
~/Library/Application Support/Google/Chrome/*/Cookies,~/Library/Application Support/Google/Chrome/*/Network/Cookies,~/Library/Application Support/Google/Chrome/*/Local Storage,~/Library/Application Support/Google/Chrome/*/IndexedDB, and equivalent Edge/Brave/Arc paths - Safari cookie and storage locations such as
~/Library/Containers/com.apple.Safari/Data/Library/Cookiesand~/Library/Safari/LocalStorage
- Chromium-family profile stores such as
- current process environment for
ANTHROPIC_* - listener on
127.0.0.1:15721 - locale/timezone and browser-signal checks:
/etc/localtime,systemsetup -gettimezonewhen sudo is available,date, browser language/locale settings,~/Library/Fonts,/Library/Fonts, and macOS system font locations - network environment checks:
scutil --proxy,scutil --dns,route -n get default, watched proxy ports such as7890,7892,1080,8080,8888, and browser-visible public IP/DNS/WebRTC/PWR checks - sanitized local environment baseline:
~/.claude/session-env/environment-fingerprint-profile.md
Route residue indicators include ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL, ANTHROPIC_MODEL, ANTHROPIC_MODEL_NAME, OPENAI_BASE_URL, PROXY_MANAGED, 127.0.0.1:15721, 302ai-claude-code, claude-official, api.302.ai, glm-5.2, proxy_live_backup, claude-code-router, openrouter, anyrouter, api.deepseek.com, open.bigmodel.cn, teamocode.com, and code.newcli.com.
Permission-risk indicators include bypassPermissions, skipDangerousModePermissionPrompt, and dangerouslyAllowHostHeaderOriginFallback.
Privacy-control indicators include DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, DISABLE_FEEDBACK_COMMAND, CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY, DO_NOT_TRACK, CLAUDE_CODE_ENABLE_FEEDBACK_SURVEY_FOR_OTEL, and the separate setting skipWebFetchPreflight.
Cleanup Patterns
Disable Non-Official Claude Proxy Routing
Use when the user wants Claude Code to stop using CC Switch or a local Anthropic-compatible proxy.
- Back up
~/.claude/settings.json,~/.codex/config.toml,~/.cc-switch/settings.json, and~/.cc-switch/cc-switch.db. - Remove Claude-specific
ANTHROPIC_AUTH_TOKEN,ANTHROPIC_API_KEY,ANTHROPIC_BASE_URL, and related default-model route overrides from Claude/Codex config. - In
~/.cc-switch/settings.json, setlaunchOnStartup: false,enableLocalProxy: false, andcurrentProviderClaude: claude-officialwhen those fields exist. - In
~/.cc-switch/cc-switch.db, remove only non-official Claude providers or Claude proxy env values requested by the user. - Stop
CC Switch.appor the relevant helper process. - Verify
127.0.0.1:15721is no longer listening, unless the user intentionally keeps CC Switch running.
Clean Stale Official-Profile Auth
Use when Claude Code has a valid claude.ai OAuth account but connectors are disabled due to a higher-priority API key or proxy auth source.
- Back up
~/.cc-switch/cc-switch.db. - Locate the
claude-officialprovider/config row. - Remove
ANTHROPIC_AUTH_TOKEN,ANTHROPIC_API_KEY, andANTHROPIC_BASE_URLfrom that official profile only. - Preserve active proxy profiles such as
302ai-claude-codeunless the user asks to remove them. - Restart or refresh the relevant Claude/CC Switch process.
Remove CC Switch App and State
Use when the user explicitly says CC Switch can be deleted or asks to remove CC Switch itself.
- Inventory first without printing secrets:
/Applications/CC Switch.app~/.cc-switch- Homebrew cask
cc-switch which -a cc-switch ccswitchps ax -o pid=,ppid=,comm=matches forCC Switch|cc-switch|ccswitchlaunchctl listand~/Library/LaunchAgentsmatches for CC Switchlsof -nP -iTCP:15721 -sTCP:LISTEN
- Create
/Users/kevin/Backups/cc-switch-delete-<timestamp>/withinventory/,files/, andremoved/. - Copy
/Applications/CC Switch.appand~/.cc-switchintofiles/before deletion or movement. - Uninstall the cask with
HOMEBREW_NO_AUTO_UPDATE=1 brew uninstall --cask cc-switch, capturing stdout/stderr intoinventory/. - Move any remaining
~/.cc-switchand/Applications/CC Switch.appintoremoved/. - Verify:
/Applications/CC Switch.appis absent~/.cc-switchis absentbrew list --caskno longer showscc-switchwhich -a cc-switch ccswitchfinds nothing- no CC Switch process or LaunchAgent is running
127.0.0.1:15721is not listening
- Preserve
com.claude-to-im.bridge, Codex, Teamo, and~/.claude/projectsunless the user separately asks to remove them.
Installed Artifact Cleanup
Use when a name might be a skill, CLI, service, or app.
- Search skill roots first.
- If no skill matches, check
which -a, package-manager listings,launchctl list,~/Library/LaunchAgents, and likely data/log folders. - Back up or move residual state to Trash rather than permanently deleting it unless the user explicitly asks for deletion.
- Verify the binary, LaunchAgent, process, and residual folders are gone or intentionally preserved.
Coding-Agent Request Chain Hygiene
Use when the user asks to apply the high-permission coding-agent trust rule.
- Inventory active config only:
- Claude:
~/.claude/settings.json,~/.claude/settings.local.json,~/.claude.json - Codex:
~/.codex/config.toml,~/.codex/auth.jsonpresence only - Teamo:
~/.teamo/settings.json,~/.teamo/auth.jsonpresence only - CC Switch:
~/.cc-switch/settings.json,~/.cc-switch/cc-switch.db - Claude Code Router:
~/.claude-code-router/config.json - Cursor/Gemini/Kiro/OpenClaw: their MCP/settings JSON files
- LaunchAgents and Native Messaging hosts
- Claude:
- Classify each finding:
- intentional active route
- stale route residue
- permission bypass
- request rewrite/transformer
- telemetry/debug/history residue
- Back up before mutation.
- Remove or archive stale third-party router configs such as inactive
~/.claude-code-router. - Remove permission-bypass defaults from active config unless the user explicitly wants always-on dangerous mode.
- Set OpenClaw local gateway
dangerouslyAllowHostHeaderOriginFallbackto false unless the user explicitly needs LAN host-header fallback. - Move debug/telemetry/router logs and old key-bearing backups out of active home folders when the user asks for privacy cleanup; keep them in a timestamped backup instead of deleting permanently.
- Preserve Teamo, Codex auth, project sessions, and bridge runtimes unless removal is explicitly requested.
Official Claude Code Privacy Controls
Use when the user asks to enable Claude privacy controls, turn off telemetry/error reporting, block nonessential traffic, or mentions DISABLE_TELEMETRY, DISABLE_ERROR_REPORTING, or CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC. Official reference pages:
https://code.claude.com/docs/en/data-usagehttps://code.claude.com/docs/en/settings
- Back up
~/.claude/settings.jsonbefore editing. If it does not exist, create it as a valid JSON object. - Merge these recommended values into the top-level
envobject:DISABLE_TELEMETRY: "1"DISABLE_ERROR_REPORTING: "1"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1"DISABLE_FEEDBACK_COMMAND: "1"CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY: "1"DO_NOT_TRACK: "1"
- Do not set
skipWebFetchPreflightunless the user specifically asks to disable the WebFetch domain safety check and accepts the security tradeoff. - Do not set auto-update or feature-flag-disabling variables as part of the privacy-control default unless the user asks for that narrower behavior.
- Validate with
python3 -m json.tool ~/.claude/settings.json. - Re-run
python3 ~/.codex/skills/claude-env-cleanup/scripts/audit_claude_env.pyand confirm the "Official Claude Privacy Controls" section reports the expected controls. - Tell the user to restart Claude Code, Claude Desktop if relevant, and terminal sessions. Some settings reload on file change, but env-style controls are safest after process restart.
- Clarify scope: these controls opt out of documented telemetry, error reporting, feedback, surveys, and nonessential traffic; they are not the same thing as zero data retention, browser cookie cleanup, or a full fingerprint reset.
Locale, Time Zone, and Font Signal Hygiene
Use when the user is comparing local browser/system signals such as Intl.DateTimeFormat().resolvedOptions().timeZone, navigator.languages, Intl locale, getTimezoneOffset(), emoji style, or canvas font detection.
- Time zone:
- Set Singapore with
sudo systemsetup -settimezone "Asia/Singapore"when explicitly requested. - If macOS prints
Error:-99but also saysSet TimeZone: Asia/Singapore, verify withreadlink /etc/localtime; the change may have succeeded. - Use
sudo systemsetup -gettimezoneorreadlink /etc/localtimefor verification. - Remember
Asia/ShanghaiandAsia/Singaporeare bothUTC+8, sogetTimezoneOffset()remains unchanged even when the IANA timezone changes. - Restart browser/Codex/Claude after changing timezone because runtimes can cache timezone at startup.
- Set Singapore with
- Fonts:
- First inspect
~/Library/Fontsand/Library/Fonts. - Move only user-installed fonts to a timestamped backup such as
~/Desktop/font-backup-<timestamp>/when the user explicitly asks to test removal. - Clear user font cache with
atsutil databases -removeUserand restartfontdwithkillall fontd. - Do not delete macOS system fonts or protected assets. PingFang, Hiragino Sans GB, STHeiti, and Songti/STSong are expected macOS signals and can remain detectable even after user fonts are removed.
- First inspect
- Browser language and
Intllocale are separate from system timezone and fonts. Treat them as browser/profile settings, not font cleanup. - Be honest about limits: normal Chrome on macOS cannot fully hide system font availability; a clean browser profile, anti-fingerprinting browser, VM, or remote environment may be needed for a different fingerprint.
Environment Fingerprint Profile
Use when the user wants a reusable local baseline for questions such as "本机时区是什么", "出口/DNS/IP/WebRTC 是什么", "PWR 指纹是什么", or "按本机环境指纹汇总". This profile is for local Claude/Codex context, not for public repo publishing.
- Generate the candidate from read-only sources:
python3 ~/.codex/skills/claude-env-cleanup/scripts/audit_network_env.py- Add
--externalonly when public-IP and Claude reachability probes are appropriate. - Prefer browser-side checks for DNS/WebRTC verdicts.
- Sanitize before writing a profile:
- Keep: country/region, timezone, IANA browser timezone, macOS locale/languages, browser language summary, local proxy ports, DNS resolver summary, network interface label, ASN/provider, IP version presence, WebRTC verdicts, and PWR fingerprint verdict/risk level when a browser check reports it.
- Redact or omit: full public IPv4/IPv6 values, LAN IP, gateway, tailnet IPs, exact mDNS host candidates, browser profile names, raw PWR detection payloads, cookie/storage contents, tokens, OAuth values, API keys, and raw config secrets.
- Store the sanitized profile at
~/.claude/session-env/environment-fingerprint-profile.mdunless the user specifies another local-only path. - When answering from this profile, say: "这是用户确认过的本机环境基线", include the confirmation date, and explain that IP/DNS/WebRTC/PWR can drift.
- If live checks differ from the stored baseline, report the diff and ask before overwriting the baseline.
- Never commit a user-specific baseline profile to the public skill repository; only commit the generic procedure.
Codex can automatically perform these read-only or low-risk setup steps after the user asks for an environment profile:
- Run local audits for timezone, macOS locale, browser language preferences, proxy settings, system DNS, default route, watched proxy ports, and Claude reachability probes.
- Create the local folder
~/.claude/session-env/when missing. - Write a sanitized candidate profile to
~/.claude/session-env/environment-fingerprint-profile.md. - Redact raw public IPs, LAN IPs, gateway addresses, tailnet addresses, exact WebRTC candidates, browser profile names, raw PWR detection payloads, and secrets before writing.
- Re-read the written file and check that it contains no obvious raw IP or secret values.
- Report the candidate as "待用户确认" until the user explicitly confirms it.
The user must manually perform or confirm these steps:
- Confirm that the sanitized profile is accurate before it is treated as "用户确认过的本机环境基线".
- Open browser-only checks such as
ip.net.coffee/claude,ippure.com/claude, andiplark.comwhen DNS/WebRTC/PWR/IP risk must reflect the real browser, not the terminal. - Provide screenshots or page verdicts for browser-only values that automation cannot reliably read.
- Restart browsers after timezone, language, proxy, extension, or cookie changes before trusting the baseline.
- Approve any write to global Claude/Codex instruction files outside this profile path.
- Approve any destructive cleanup, including deleting cookies, Local Storage, IndexedDB, browser extensions, browser profiles, Claude App, Claude Code, or CC Switch.
Account Stability and Fingerprint Reset Takeaways
Use when the user asks how to reduce operational risk for a new Claude account, after a ban, or during an early account warm-up period. Treat these as user-provided stability heuristics and practical reminders, not as a bypass guarantee.
- New-account early period:
- For the first two weeks, use only the official Claude Desktop/App path and avoid standalone CLI use when following this strategy.
- Do not use third-party clients such as OpenCode, OpenClaw, CraftAgent, or other unofficial wrappers during the early account phase.
- Prefer platform subscription channels such as App Store or Google Play when the user explicitly asks for purchase-channel guidance; do not store payment details.
- Start from the basic Pro tier and upgrade naturally after usage history exists; avoid abrupt heavy-tier behavior.
- After upgrading to Max, keep the first two weeks conservative and avoid repeatedly hitting usage limits. If summarizing the user's heuristic, say "no more than about 3 limit hits" rather than treating it as an official threshold.
- Usage rhythm:
- Encourage a human-like work/rest rhythm; avoid continuous 24-hour high-load automation.
- Do not share accounts. Shared use mixes devices, regions, browser fingerprints, and usage rhythms.
- Network posture:
- IP type is less important than stability and crowding. Avoid public, overused shared proxies.
- In the early period, avoid frequent IP/country/ASN switching.
- Fingerprint reset is the key post-ban step:
- Before changing to a new account after a ban, complete the post-ban cleanup flow: browser site data, Claude extensions, Native Messaging manifests, official Claude App/Code residue, CC Switch, local auth/config/cache/log/telemetry residue, and browser-side network checks.
- Treat
~/.claude/telemetry, app caches, browser storage, Native Messaging, and third-party client configs as part of the fingerprint surface when the user asks for a reset. - Verify before reuse; do not assume uninstalling one app removed the whole fingerprint surface.
- Warm-up window:
- If the user asks for a timeframe, present the user's heuristic as about one month or after the first renewal, then relax constraints gradually.
Codex can automatically help by auditing local residue, checking active routes, listing third-party client configs, generating a sanitized environment baseline, and removing files only after explicit permission plus backup. The user must manually choose subscription channel, usage rhythm, account sharing behavior, browser-page verdicts, and whether to follow the early-period usage limits.
Post-Ban Account Reset Self-Check
Use when the user says a Claude account was banned and asks for the three-step reset: clear browser cookies, remove CC Switch, and check/remove Claude Code terminal plus Claude Desktop App. This workflow is audit-first; it can identify cleanup targets, but cookie/site-data clearing and in-browser extension removal are manual unless Kevin explicitly requests destructive browser-data edits.
- Start with read-only audits:
python3 ~/.codex/skills/claude-env-cleanup/scripts/audit_claude_env.pypython3 ~/.codex/skills/claude-env-cleanup/scripts/audit_network_env.py --post-ban- Add
--externalonly when live public-IP and Claude reachability checks are appropriate.
- Step 1, browser reset:
- MANUAL REQUIRED: in every browser profile used with the banned account, clear site data/cookies/cache for
claude.ai,anthropic.com,console.anthropic.com, and any Claude login/session helper domains. - MANUAL REQUIRED: remove or disable Claude/Anthropic browser extensions and session-key helper extensions tied to the banned account.
- MANUAL REQUIRED: restart the browser after clearing, then re-run browser-side DNS/WebRTC/IP checks.
- Do not delete a whole browser profile unless the user explicitly asks for that and a backup plan is clear.
- MANUAL REQUIRED: in every browser profile used with the banned account, clear site data/cookies/cache for
- Step 2, CC Switch:
- If CC Switch is still present and the user has already said it can be deleted, use "Remove CC Switch App and State".
- If the user only asked for audit, report whether
/Applications/CC Switch.app,~/.cc-switch, Homebrew caskcc-switch, LaunchAgents, processes, and127.0.0.1:15721are present. - Preserve
com.claude-to-im.bridge, Codex, and Teamo.
- Step 3, Claude Code terminal and Desktop App:
- If the user explicitly asks to delete official Claude App/Code, use "Uninstall Official Claude App and Claude Code".
- If the user only asks to self-check, report
which -a claude,@anthropic-ai/claude-code,/Applications/Claude.app, Chrome PWA shortcut, Claude Code URL Handler, Native Messaging manifests, Claude extensions, app support/cache/preferences/logs, and official Claude processes. - Preserve
~/.claude/projects,~/.teamo, andcom.claude-to-im.bridgeunless separately requested.
- After the three cleanup areas, open or instruct the user to open the five guide sites and record screenshots or key verdicts:
https://ip.net.coffee/claude/https://iplark.com/https://net.coffee/https://ippure.com/https://cc.mastersgo.cc/Treatnet.coffeeas a tool hub if it does not show a direct Claude result page; use its Claude/DNS/WebRTC tools as needed.
- Report in four buckets:
- automatically checked
- manual action required
- destructive cleanup performed with backup paths
- remaining risks before using a new account
- If the user says "指纹重置", treat it as the priority outcome: the local Claude/browser/client fingerprint surface should be clean or intentionally documented before the new account is used.
Claude Network Environment Monitoring
Use when the user asks to check Claude network environment, IP purity, DNS leak, WebRTC leak, node region stability, or the "5 checks" from a Claude usage guide.
- Run the local audit first:
python3 ~/.codex/skills/claude-env-cleanup/scripts/audit_network_env.py- Add
--externalonly when live public-IP and Claude endpoint requests are appropriate. - Add
--post-banwhen the user wants the five-site post-ban guide checklist and browser site-data cleanup reminders. - Add
--append-history ~/.codex/network-env-history.jsonlwhen the user wants node-region drift monitoring.
- Open only these three core browser checks by default:
https://ip.net.coffee/claude/for Claude-specific IP trust, Claude reachability, DNS/WebRTC links, timezone, and language.https://ippure.com/claudefor Claude environment, DNS/WebRTC status, and Chinese-fingerprint score.https://iplark.com/for independent IP intelligence, geo consistency, ASN/provider, and IP score.
- Treat DNS leak as a browser-side verdict:
- Good: public exit IP is overseas and DNS resolver exits are overseas, hidden by DoH/DoT, or reported as normal/no leak.
- Bad: public exit IP is overseas but DNS resolver IPs show China/local ISP or a different unexpected region.
scutil --dnsis only supporting evidence; Chrome may resolve through the proxy differently from the terminal.
- Treat these as watch items rather than automatic cleanup targets:
- IPv6 Claude exit when a page warns that IPv6 is not recommended for Claude Code.
- data-center or hosting IP instead of residential IP.
- mixed IPv4/IPv6 or mixed-country outbound results.
- browser language/Intl/font signals that still look Chinese.
- PWR fingerprint warnings or mismatch flags from browser-side detection pages.
- Report a compact verdict:
- IP/ASN/region
- risk score or trust score from each site
- DNS leak status
- WebRTC leak status
- Claude reachability
- residual browser/system fingerprint risks
Uninstall Official Claude App and Claude Code
Use only after the user explicitly asks to remove the official app or CLI itself.
- Inventory before uninstall:
which -a claude- package-manager records for
@anthropic-ai/claude-code - official npx cache records for
@anthropic-ai/claude-code /Applications/Claude.app~/Applications/Chrome Apps.localized/Claude.app~/Applications/Claude Code URL Handler.app- Anthropic Native Messaging manifests under Chromium browser profile roots
- Claude browser extensions in Chrome profiles, especially IDs
fcoeoabgfenejglbffodgkkbkcdhcgfn,dihbgbndebgnbjfmelmegjepbnkhlgni, anddngcpimnedloihjnnfngkgjoidhnaolf - running processes matching
Claude,claude, orAnthropic - launchd entries matching
claudeoranthropic - app support/cache/preference/log paths under
~/Library/
- Create a timestamped backup or Trash staging directory. Store both a pre-uninstall inventory and config snapshots such as
~/.claude/settings.json,~/.claude/settings.local.json,~/.claude.json,~/.cc-switch/settings.json, and~/.cc-switch/cc-switch.dbwhen present. - Stop running confirmed Claude Desktop and Claude Code processes. Leave unrelated bridges, Codex processes,
com.claude-to-im.bridge, and Teamo processes alone unless the user asks to remove them. If aclaudeprocess has parentteamo, verify withps/lsofbefore killing and preserve Teamo by default. - Uninstall Claude Code with npm if it is installed as
@anthropic-ai/claude-code; then remove leftoverclaudesymlinks or version folders only after confirming they belong to Claude Code. - Move
/Applications/Claude.app,~/Applications/Chrome Apps.localized/Claude.app, and~/Applications/Claude Code URL Handler.appto Trash or the staging directory when present. - Move official Claude Desktop residue to Trash/staging:
~/Library/Application Support/Claude~/Library/Application Support/com.anthropic.claudefordesktop~/Library/Caches/com.anthropic.claudefordesktop~/Library/Caches/com.anthropic.claudefordesktop.ShipIt~/Library/Caches/claude-cli-nodejs~/Library/HTTPStorages/com.anthropic.claudefordesktop~/Library/Preferences/com.anthropic.claudefordesktop.plist~/Library/Preferences/ByHost/com.anthropic.claudefordesktop*.plist~/Library/Saved Application State/com.anthropic.claudefordesktop.savedState~/Library/Logs/Claude
- Move official Claude Code state markers such as
~/.claude.jsonand~/.claude-code-now-last-dironly when the user asks to delete the Claude Code terminal program or local records. Keep a copy in the timestamped backup. If~/.claude.jsonreappears with only migration/user metadata and there is noclaudebinary/app/package, report it as a shared runtime state marker rather than proof of official Claude Code still being installed. - Move Anthropic Native Messaging manifests to Trash/staging. These are browser-side bridge pre-authorisations; deleting Claude.app alone can leave a broken manifest such as
com.anthropic.claude_browser_extension.jsonin Chrome. - If a Claude browser extension is installed, report it separately and either:
- ask the user to remove it through
chrome://extensionswhen only auditing, or - move the matching extension ID folder to backup/staging when the user explicitly asked to delete Claude browser integration residue. Do not delete unrelated Chrome profile data.
- ask the user to remove it through
- Preserve shared local state by default. Do not remove
~/.claude/projects,~/.claude/skills,~/.teamo, or~/.claude-to-imduring official Claude uninstall. If cleaning official Claude Code data is explicitly requested, move only confirmed official-auth/cache items and keep project/session data available for Teamo. - Verify
claudeis no longer on PATH,/Applications/Claude.appand user-level Claude app shortcuts are absent, global/npx@anthropic-ai/claude-codeentries are absent, Anthropic Native Messaging manifests are absent, Claude browser extension IDs are absent or intentionally preserved, Claude processes are stopped, and launchd no longer reports active official Claude updater jobs. - Verify Teamo if it was in scope:
teamo --versionstill works,~/.teamoexists, and the expected~/.claude/projectssession files remain.
Verification
After edits, verify with targeted checks:
- JSON files parse with
python3 -m json.tool - SQLite DB opens with
sqlite3 - route markers are absent or intentionally present
lsof -nP -iTCP:15721 -sTCP:LISTENmatches the intended state- Claude/Codex config no longer contains unexpected
ANTHROPIC_*route overrides - official Claude privacy controls are present in
~/.claude/settings.jsonunderenvwhen requested, andskipWebFetchPreflightis absent unless intentionally enabled - CC Switch app/cask/data are absent when removal was requested
- coding-agent active configs no longer contain stale router endpoints, permission-bypass defaults, or unsafe Host Header fallback unless intentionally preserved
/etc/localtimepoints to the intended timezone after timezone changes~/Library/Fontsuser-installed fonts are absent or intentionally present after font-signal tests- environment fingerprint profile is sanitized before being stored, does not contain raw public IPs, LAN/gateway/tailnet addresses, exact WebRTC candidates, raw PWR detection payloads, browser profile names, cookies, tokens, or secrets
- post-ban self-check reports browser cookie/site-data targets, makes manual browser cleanup actions explicit, confirms CC Switch state, confirms official Claude App/Code state, and records the five guide-site verdicts
- network audit reports expected proxy/DNS/default-route state, browser checks show no DNS/WebRTC leak, and history does not show unintended country/ASN drift when monitoring is enabled
- for app/CLI/browser-bridge uninstall,
/Applications/Claude.app,~/Applications/Chrome Apps.localized/Claude.app, and~/Applications/Claude Code URL Handler.appare absent,which -a claudefinds nothing,npm list -g --depth=0and~/.npm/_npxhave no@anthropic-ai/claude-code,~/Library/Caches/claude-cli-nodejsis absent, Anthropic Native Messaging manifests are absent, Claude browser extension IDs are absent or intentionally preserved, and no official Claude process remains - for Teamo and bridge preservation,
which -a teamoor/opt/homebrew/bin/teamo --versionstill works,~/.teamoplus~/.claude/projectsremain, and intentionally preservedcom.claude-to-im.bridgeremains loaded/running
When reporting results, separate:
- current facts verified in this run
- changes made
- backup paths
- residual risks or intentionally preserved routes


