claude-code.el allows running multiple Claude instances simultaneously, each associated with a specific directory (project root, file directory, or current directory). This enables separate conversations for different workflows (e.g., one instance for 'tests' and another for 'refactor') within the same project.
Key Concepts
- Instance Naming: The first instance in a directory is the "default". Subsequent instances require a custom name.
- Buffer Naming: Buffers follow the pattern
*claude:/path/to/directory:instance-name*. - Instance Selection: If multiple instances exist for a project, commands like
claude-send-command or claude-code-kill will prompt you to select the target instance. - Cross-Project Usage: You can select an instance running in a different project to analyze dependent files or sibling directories.
- Persistence: The package remembers which buffers are associated with which instances to minimize repetitive prompts.
## Instance Management
- When you start Claude with `claude-code`, it creates an instance for the current directory
- If a Claude instance already exists for the directory, you'll be prompted to name the new instance (e.g., "tests", "docs")
- You can also use `claude-code-new-instance` to explicitly create a new instance with a custom name