When multiple Hermes Agents collaborate, the best practice is not to throw all tasks into one session, but to use profile to isolate identities and configurations, git worktree to isolate code changes, and the main session to only be responsible for task disassembly and acceptance. This is the least likely to cause memory stringing, file overwriting, and context confusion.
When to use profile
profile is suitable for differentiating between long-term roles, such as "Hermes who writes code", "Hermes who operates content", and "Hermes who is a personal assistant". Each profile has its own configuration, session, skill, and home directory. If you want an agent to have an independent model, independent memory, or independent platform access, you should create a profile.
When to use a worktree
--worktree is suitable for multiple agents to change the same repository at the same time. It creates an isolated working tree for each session, preventing two agents from changing the same file at the same time. The official documentation also supports copying necessary files that are ignored by git through .worktreeinclude, such as .env, .venv/, node_modules/.
A secure process
- The main agent only does planning and division of labor, and does not directly change the code.
- Each subtask has a separate worktree and asks it to report which files have been changed at the end.
- Open a profile when it involves long-term identity differences, and do not create a new profile for each small task.
- Before merging, the main agent or manual run tests, watch diffs, and handle conflicts.
Many problems of "multiple agents become more and more chaotic" are essentially due to the lack of isolation boundaries. The combination is clearest with profiles for long-term roles, worktrees for parallel code, and ordinary sessions for temporary exploration.