Skip to content

[BUG] Two Claude Code sessions in the same folder / project share chat history when they should be separate. #7702

@CryptVenture

Description

@CryptVenture

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When I start two Claude code sessions in the same folder, they seem to share history - which means they get mixed up with each others tasks. For example, if I start one Claude Code Session to do debugging and another to do feature development - the one will have the chat history of the other. After a particular task has been completed, the debugging instance starts to do Feature development because it seems to have access to the chat history of the other (e.g. if you use the up arrow when you are in the code interface you can up arrow to the prompts from the other instance). This means that Claude Code eventually stops following explicit instructions and does what it likes.

What Should Happen?

Each instance in the same project should be isolated from ther others. Even when resuming a chat --resume, the instance should be isolated and every chat interface should maintain its own context and chat history - the only time that things should be recalled is when you --resume an instance, then that instance's messaging, context, prompts etc should all be retrieved and used.

Error Messages/Logs

Steps to Reproduce

Open two instances of Claude code in the same project folder. Give each instance a task and watch as when one instance completes the task (often after a compaction) it will have context, prompting and history from the other instance.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

1.0.115 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corearea:securitybugSomething isn't workingduplicateThis issue or pull request already existshas reproHas detailed reproduction stepsmemoryplatform:linuxIssue specifically occurs on Linux

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions