Skip to content

feat(claude):with previous conversation & isolate context #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 4, 2025

Conversation

luoliwoshang
Copy link
Contributor

@luoliwoshang luoliwoshang commented Aug 4, 2025

With -c, Claude continues the most recent conversation session, maintaining context and history from previous interactions. Without -c, Claude starts a fresh conversation with no prior context, treating each interaction as independent.

See https://docs.anthropic.com/en/docs/claude-code/cli-reference

  • Check if mounting the same host directory causes context confusion between containers.

When using claude -c, mounting to the same host Claude directory causes unexpected context contamination. For example, in luoliwoshang/agent-test#26 (comment), there shouldn't be any mention of go-introduction.md since that content belongs to a different unmerged PR's context (luoliwoshang/agent-test#28).
Currently, all containers share the same Claude config directory mounted at /home/codeagent/.claude (see internal/code/claude_docker.go:65). We need to isolate Claude's data directory per PR, similar to how we handle workspace isolation in /tmp/codeagent/{workspace-id}.

  • isolate Claude's data with other conversaion

with the feature support ( isolate claude config) 50107fb

this pr luoliwoshang/agent-test#32 create a isolate claude config folder and only have this pr 's context luoliwoshang/agent-test#32 (comment)

2025/08/04 13:09:39.464975 [INFO] code/claude_docker.go:175: Created isolated Claude config directory: /Users/zhangzhiyang/.claude-luoliwoshang-agent-test-32
  • if not config any ANTHROPIC_API_KEYANTHROPIC_AUTH_TOKEN 、 fallback to use host mashine 's .claude folder to auth

@luoliwoshang luoliwoshang marked this pull request as draft August 4, 2025 02:20
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@luoliwoshang luoliwoshang changed the title [wip] claude with previous conversation [wip] feat(claude):with previous conversation & Aug 4, 2025
@luoliwoshang luoliwoshang changed the title [wip] feat(claude):with previous conversation & [wip] feat(claude):with previous conversation & isolate context Aug 4, 2025
@luoliwoshang luoliwoshang changed the title [wip] feat(claude):with previous conversation & isolate context feat(claude):with previous conversation & isolate context Aug 4, 2025
@luoliwoshang luoliwoshang marked this pull request as ready for review August 4, 2025 07:31
@luoliwoshang luoliwoshang marked this pull request as draft August 4, 2025 09:24
@luoliwoshang luoliwoshang marked this pull request as ready for review August 4, 2025 12:42
@CarlJi CarlJi merged commit d1abf9b into qiniu:main Aug 4, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants