Skip to content

bug: profile create --clone-all copies entire infrastructure (~2.3GB) instead of just profile data #5022

@rahimsais

Description

@rahimsais

Description

hermes profile create --clone-all <name> is extremely slow when cloning from the default profile (~/.hermes) because shutil.copytree() copies the entire directory tree with zero exclusions — including multi-GB infrastructure that is not profile data.

Size breakdown of ~/.hermes

Directory Size Profile data?
hermes-agent/ 2.2 GB No (repo checkout)
├── venv/ 680 MB No (Python virtualenv)
├── node_modules/ 167 MB No (npm packages)
├── .git/ 126 MB No (git history)
profiles/ 21 MB No (other profiles — recursive!)
checkpoints/ 16 MB No (regenerable cache)
state.db 11 MB No (runtime database)
bin/ 9.4 MB No (installed binaries)
cache/ 6.9 MB No (regenerable)
skills/ 11 MB Yes
sessions/ 28 MB Yes
memories/ 12 KB Yes
config.yaml, .env, SOUL.md, cron, etc. ~50 KB Yes

~2.26 GB of infrastructure is copied when only ~40 MB is actual profile data.

Root cause

In hermes_cli/profiles.py line 422:

if clone_all and source_dir:
    shutil.copytree(source_dir, profile_dir)  # no ignore= parameter

The fix already exists for export

export_profile() was fixed in commit 68fc4ae with _DEFAULT_EXPORT_EXCLUDE_ROOT (25+ entries) and _default_export_ignore() to exclude infrastructure from default profile exports. But create_profile(clone_all=True) was never updated to use the same exclusion logic.

Expected behavior

--clone-all should copy all profile state (config, memories, sessions, skills, cron, plugins, .env, auth.json) but exclude infrastructure (hermes-agent repo, venv, node_modules, .git, databases, caches, other profiles).

Documentation confirms this

All docs describe --clone-all as copying profile data, not infrastructure:

  • profiles.md: "Copies everything — config, API keys, personality, all memories, full session history, skills, cron jobs, plugins."
  • profile-commands.md: "Copy everything (config, memories, skills, sessions, state) from the current profile."

Suggested fix

Pass an ignore function to shutil.copytree() in the clone-all codepath, reusing the existing _DEFAULT_EXPORT_EXCLUDE_ROOT set (keeping .env and auth.json since clone-all wants a full working copy unlike export).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardtype/bugSomething isn't working

    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