Tips to keep Claude Code local config and session history after account ban
12/04/2026 — 12/04, 21:19·1 sources (all)·1 reports (all)
Key takeaways
- A V2EX post shares how to keep local configuration and session history when switching to API after a Claude Code account ban. The author sug…
Background & analysis
On December 4, 2026, a post on V2EX described how to keep local configuration and session records when moving from a banned Claude Code account to API access. The author divides the contents of the ~/.claude directory into two broad groups: files the user wrote themselves, which should be carried over when switching credentials or machines, and items tied to the old login that become useless after switching to a Key.
The post recommends preserving the global instructions in ~/.claude/CLAUDE.md and rules/, along with permissions, hooks, environment variables, and the default model in settings.json. It also lists skills/, commands/, agents/, and agent-memory/ as worth taking, since they hold skills, custom commands, subagents, and their memory. Session records live under ~/.claude/projects/<project>/*.jsonl. By default, cleanupPeriodDays is set to 30 days, and the background process deletes these records silently; once removed, they no longer appear in /resume. The author suggests setting "cleanupPeriodDays": 365 in settings.json to extend retention, noting the value must be a number without quotes and no less than 1.
The post treats settings.json as one of the files to carry over and says a Key will be added to it in the next step. The only verifiable development so far is this experience-sharing post; the material contains no response from Anthropic or Claude Code.
AI-generated from 1 reports · updated 1 day ago
Related AI tools
- Heat index
- 48
- All sources
- 1
- All reports
- 1
- First seen
- 1 day ago
Reports on this story headlines open the original
A V2EX post explains how to keep local Claude Code configuration and session history when switching from a banned account to API keys. It recommends carrying over custom settings, skills, commands, and agent memory from ~/.claude, and setting cleanupPeriodDays to 365 in settings.json to delay automatic session cleanup.
V2EXAI score 53
Other stories people are talking about
- Heat index 52How to Get Notified When Claude Code Waits for Input1 sources
- Heat index 49Developer shares a note-taking setup to make Claude Code retain corrections1 sources
- Heat index 42Using Codex and Claude Code to review each other's code1 sources
- Heat index 79When Claude Code plugins are worth building: a team's take1 sources
- Heat index 98NewDeveloper open-sources a Claude Code skill that interviews you before writing your blog post1 sources
How is heat calculated?About the methodHide
Heat counts how many independent sources covered a story in the last 48 hours: one source counts once no matter how many posts it published, decaying with a 24-hour half-life. What ranks first is what many people are talking about.
This page aggregates public feeds. Headlines and summaries are machine-organized and remain the property of the original authors; verify important facts at the source. If you believe a headline or summary infringes your rights, email the contact address in the footer with the page URL and basis of your claim, and we will remove or replace it after review.
- Surge
- Discussion rising fast
- New
- First report within 6 hours
- Rising
- Still gathering discussion

