Profiles
What is a Profile
A profile binds an agent, credentials, and sandbox policy to a set of directories or git remotes. When you run aide, it resolves which profile applies to your current working directory and launches the correct agent with the right environment.
Each profile lives in its own flat YAML file under ~/.config/aide/profiles/<name>.yaml, with global defaults in ~/.config/aide/config.yaml:
# ~/.config/aide/config.yaml
default_profile: work
agents:
claude:
binary: claude
# ~/.config/aide/profiles/work.yaml
agent: claude
secret: work
match:
- path: ~/work/*
- remote: "github.com/acme/*"
config_dir_name: work # claude runs from ~/.claude-work
gateways:
anthropic: {preset: anthropic, store: work, key: anthropic_api_key}
gateway_choice: {claude: anthropic}
Each profile contains: agent, secret, env, match, sandbox, capabilities, and optionally yolo, config_dir_name, config_dir, config_dirs, gateways, gateway_choice, and credentials (plain environment-variable secrets; see Configuration and Gateways).
Match Rules
Two rule types select a profile based on the current working directory or git remote.
Path rules match the working directory. Tilde expands to the home directory.
match:
- path: ~/work/* # any subdirectory of ~/work
- path: ~/work/acme # exact directory
- path: ~/clients/** # recursive glob
Remote rules match the git remote URL. Each rule is checked against the origin remote unless remote_name selects another one; a rule with remote_name: upstream matches only the upstream remote.
match:
- remote: "github.com/acme/*"
- remote: "github.com/acme/api" # exact match
- remote: "*.internal.corp/*"
remote_name: upstream
Remote URLs and non-glob rules are normalized to host[:port]/org/repo before comparison, so SSH (git@host:org/repo.git), ssh:// and https:// forms all match the same rule. The host is lowercased, a trailing .git or / is dropped, a port is kept unless it is the scheme’s default (ssh://git@git.example.com:2222/org/repo.git becomes git.example.com:2222/org/repo, while ssh://git@github.com:22/org/repo.git becomes github.com/org/repo), and user names, passwords or tokens embedded in the URL are discarded. Match reasons shown by aide which, aide status and the launch banner never include those credentials either. aide profile bind saves remote rules in this normalized form.
Both path: and remote: patterns are validated on load, save, and in aide config profiles (Profiles & Match Rules): patterns cannot be empty after trimming whitespace, and glob patterns (containing *, ?, [, or {) must parse as valid globs. Remote patterns are canonicalized before glob validation.
Resolution Order
aide scores every match rule and picks the highest-scoring profile:
| Match type | Base score | Tiebreaker |
|---|---|---|
| Exact path | 300 | + pattern length |
| Exact remote | 250 | + pattern length |
| Glob path | 200 | + pattern length |
| Glob remote | 100 | + pattern length |
An exact remote match (remote: "github.com/acme/api") deliberately outranks a glob path match - it’s more specific even though it’s not a path rule. Longer patterns beat shorter patterns within the same tier. When two profiles still score equally, the one whose name sorts first wins. If no rule matches, default_profile is the fallback.
.aide.yaml does not add a fifth scoring tier - it’s a field-by-field override merged on top of whichever profile wins the scoring above (some fields, like env, merge additively; others replace only if set). See Per-Project Override below.
Per-Project Override
Place .aide.yaml at the project root to override fields in the resolved profile for that project. aide merges it on top of the matched profile.
# .aide.yaml
agent: claude
env:
NODE_ENV: development
sandbox:
writable_extra:
- /tmp/build
Env variables merge additively; the project override wins on key conflicts. All other fields (including yolo) replace the matched value when set. .aide.yaml cannot set secret:: the secret store belongs to the profile.
Capabilities
The capabilities field activates named capabilities for a profile. Capabilities grant the sandbox additional permissions (filesystem paths, environment variables, network access) for specific tools.
# ~/.config/aide/profiles/infra.yaml
agent: claude
match:
- path: ~/infra/*
capabilities: [docker, k8s, aws]
secret: work
See Capabilities for details on built-in and custom capabilities.
Managing Profiles
aide profile list # list all profiles
aide profile create # create a new profile interactively
aide profile create work --agent claude --here # scripted: create and bind CWD
aide profile bind work # attach this folder (interactive scope menu on TTY)
aide profile bind work --scope org # bind all repos in the current git remote org
aide profile bind work --scope path # force exact folder path match
aide profile set-secret personal # set secret (auto-detects CWD)
aide profile set-secret work --profile work
aide profile remove-secret # clear secret (auto-detects CWD)
aide profile set-default work # change the default fallback
aide profile rename work work-acme # rename (updates default_profile too)
aide profile remove personal # delete a profile
aide profile list marks the default profile:
personal
Agent: claude
Match: ~/personal/*
work (default)
Agent: claude
Secret: work
Match: ~/work/*
The aide use Shortcut
aide use creates or updates a profile named after the CWD basename and binds it in one step. The first profile created automatically becomes default_profile.
aide use claude # bind CWD to claude
aide use claude --match "~/work/*" # bind a glob pattern instead of CWD
aide use claude --secret work # also attach a secret
aide use claude --sandbox strict # use a named sandbox profile
aide use --profile work # add CWD as a match rule to existing profile
Codex identities and native settings
Use separate native homes for personal, work, or client identities:
# ~/.config/aide/config.yaml
default_profile: personal
# ~/.config/aide/profiles/personal.yaml
agent: codex
config_dir_name: personal
# ~/.config/aide/profiles/work.yaml
agent: claude
config_dir_name: work
aide --profile work --agent codex launches Codex with
CODEX_HOME=~/.codex-work, even though work normally launches Claude.
The personal profile uses ~/.codex-personal. Applicable credential routes
provide the selected keys and endpoint settings. When none of the default
or saved routes applies to Codex, aide still launches it in the work home
and notes that it uses its own login. Use the agent’s native login flow
there; aide does not borrow the personal or global login.
An explicitly incompatible --gateway selection or a failure to load
a selected credential remains an error. A missing applicable default is
different from a broken selected credential.
Codex settings remain native. For example:
aide --profile work --agent codex -- --profile deep-review
aide selects the work identity and passes --profile deep-review unchanged
to Codex. Codex loads the named settings according to its installed version
from the selected home; aide does not create or remember those settings.
Provider and model compatibility also belongs to the agent: supplying a
key or endpoint does not make an unsupported provider compatible.
Codex’s real-account isolation admission is still pending verification. Automated launcher checks establish environment and argument handling, not native login, keyring, refresh, or concurrent-account behavior.
Multi-Account Setups
A common need is keeping a personal and a work Claude account side by side - different API keys or logins, different MCP servers, separate conversation history, no cross-contamination. aide composes two primitives to make this clean:
You can also create, edit, clone, and test match rules interactively in aide config profiles (Profiles & Match Rules).
- One native config dir per profile.
config_dir_name: work(validated as[a-zA-Z0-9_-]{1,64}or empty to clear back to default) makes aide set the agent’s config-dir variable (CLAUDE_CONFIG_DIR=~/.claude-work,CODEX_HOME=~/.codex-work, …) at launch, sync, adopt and list, so each profile keeps its own login, settings, MCP servers and history. - One secret store per account when you use API keys, chosen
with a gateway (
gateway_choice:). Without one, the agent uses the native login stored in that profile’s config dir.
Walkthrough - personal + work.
Create one encrypted secret per account (see Secrets - Quick Start for the editor flow):
aide secrets create personal --age-key age1abc...
aide secrets create work --age-key age1xyz...
Then declare the two profiles:
# ~/.config/aide/config.yaml
default_profile: personal
# ~/.config/aide/profiles/personal.yaml
agent: claude
match: [{path: ~/personal/*}]
secret: personal
config_dir_name: personal
gateways:
anthropic: {preset: anthropic, store: personal, key: anthropic_api_key}
gateway_choice: {claude: anthropic}
# ~/.config/aide/profiles/work.yaml
agent: claude
match: [{path: ~/work/*}]
config_dir_name: work # native login only, no API key
The first launch in each tree signs Claude Code in (or uses the key) inside the matching config dir; from then on aide picks the right state directory automatically based on CWD.
cd ~/personal/some-project && aide # uses ~/.claude-personal
cd ~/work/some-project && aide # uses ~/.claude-work
aide --profile work # this launch only, from anywhere
Resulting layout:
~/.config/aide/secrets/personal.enc.yaml
~/.claude-personal/ ← Claude Code state for personal account
~/.claude-work/ ← Claude Code state for work account
The same pattern extends to N accounts (client-x, oss, …) - just
add more profile blocks. Two profiles that would resolve to the same
config dir stop with profiles share a native config dir.
Per-profile login isolation for each agent is being verified by hand on macOS and Linux; the steps and their status are in profiles-verification.md.
To install skills and other Skillshare resources into each profile’s own config dirs, see Skillshare.
Migrating from contexts and monolithic config.yaml
Upgrading also migrates legacy gateways (base_url:) and the gateway names in default_credentials: to gateways: plus gateway_choice: on the first launch or config write, with backups under ~/.local/state/aide/migrations/; aide config migrate previews it. See Gateways.
aide config migrate previews splitting a single-file config.yaml (upgrading contexts: to profiles: if needed) into the modular file layout (config.yaml, sandbox.yaml, provisioning.yaml, and profiles/<name>.yaml) without writing anything; aide config migrate --write writes the split files and keeps the original as config.yaml.bak.
aide profile migrate converts a legacy contexts: config to profiles: in place without splitting files:
Each profile is extracted into its own flat
~/.config/aide/profiles/<name>.yamlfile, sandbox/guard/capability settings move tosandbox.yaml, and plugins/MCP servers/hooks move toprovisioning.yaml.When mutating commands (
aide profile,aide gateway,aide sandbox,aide cap,aide hook,aide env,aide adopt) run against a legacy single-fileconfig.yamlon an interactive terminal, aide prompts to migrate before saving.contexts:becomesprofiles:anddefault_context:becomesdefault_profile:. Profile names stay the same.Inside each profile
profile:becomesconfig_dir_name:andprofile_dir:becomesconfig_dir:, so every login dir stays where it is.Provider keys templated into
env:from the profile’ssecret:store become gateways (for the providers a gateway preset serves) orcredentials:bindings.A named profile never writes harness files into the harness’s native dir. A native-dir pin in
env:is dropped, a custom in-home path moves toconfig_dirs:, andconfig_dir_nameis derived from the profile name. A dir variable that is templated, relative or outside$HOMEblocks isolation: the profile fails to load with a hint to edit it by hand.aide refuses to launch a profile that shares a global login with another profile; give all but one of them a
config_dir_name:.A section that uses YAML anchors, aliases or merge keys is refused; expand it by hand and re-run.
Provisioning state is updated so the rewrite is not reported as drift.
.aide.yamlfiles are never changed, and a launch never rewrites the config.
aide context ... still works as a deprecated alias of aide profile ... (it prints a notice on stderr), and --context still works
wherever it did, as a deprecated alias of --profile.
Default Profile
The default profile is the fallback when no match rule applies. Change it at any time:
aide profile set-default personal
aide profile list shows it with a (default) marker.
Inspecting
aide which shows the matched profile and the reason for the match:
$ aide which
Profile: work
Matched: path glob match: ~/work/*
Agent: claude
Secret: work
aide which --resolve decrypts the secret and shows resolved environment variable values (redacted):
$ aide which --resolve
Profile: work
Matched: path glob match: ~/work/*
Agent: claude (/usr/local/bin/claude)
Secret: work [keys: ANTHROPIC_API_KEY]
Env:
ANTHROPIC_API_KEY <- secret (sk-ant-........)