Worked configuration examples and a permutation reference, from the simplest single-identity setup through a portable committed .agent-shim.json. Verbatim from an earlier README.md.
// ~/.agent-shim/config-profiles/client-base.json
{
"categories": { "knowledge": false, "history": false },
"entries": {
"knowledge/skills/commit": true,
"knowledge/skills/pr-feedback": true,
"knowledge/rules": true
}
}// ~/.agent-shim/config-profiles/client-acme.json
{ "extends": ["client-base"] }// ~/.agent-shim/config-profiles/client-widget.json
{ "extends": ["client-base"] }// ~/.agent-shim/directory-rules.json
{
"rules": [
{ "path": "~/work/clients/acme", "configProfile": "client-acme" },
{ "path": "~/work/clients/widget", "configProfile": "client-widget" }
]
}One login serves both clients. History is fully isolated between them; commit, pr-feedback, and rules stay available in both. If "isolated" should mean each client still sees its own past sessions rather than none at all, add a glob entry override scoped to that client's own encoded project directories (see Pattern matching) rather than opening history wholesale.
Two logins, a directory rule as a safety net independent of which one is active. A personal identity defaults to sharing history everywhere; a work identity defaults to not sharing it. One client is under a strict no-cross-contamination requirement:
{ "rules": [{ "path": "~/work/clients/regulated-client", "configProfile": "client-strict" }] }If claude @personal is ever run from inside that same directory — intentionally or by habit — the rule still applies, because rules aren't tied to identity. History stays off no matter which login is active.
A team repo ships its own config; a new teammate needs zero setup. A project commits .agent-shim.json at its root:
{ "categories": { "history": false }, "entries": { "knowledge/skills/commit": true, "knowledge/skills/pr-feedback": true } }A new teammate installs agent-shim, creates their own identity, clones the repo, and runs claude from inside it — they get the isolation-plus-shared-skills behaviour immediately, with no local configuration. If they want to see their own past sessions there too, that's a personal, local addition that composes on top of the committed file.
Share-by-default, with narrow exceptions. The inverse posture — broad sharing, a couple of carve-outs:
{
"rules": [
{ "path": "~/oss", "categories": { "history": true } },
{ "path": "~/oss/private-experiments", "categories": { "history": false } }
]
}The deeper rule narrows what the shallower one opened up.
A minimal progression, each adding one mechanism on top of the last:
- Bare minimum — an identity, nothing else configured. Shipped defaults apply as-is.
- One configuration profile, no directory scoping —
{ "categories": { "history": true } }as an identity's default: that identity shares history everywhere. - Directory rules switching profiles under one identity — a
personalprofile and aworkprofile, a rule sending~/workto the latter. - Linear
extendschain —base→work(extendsbase) →client-acme(extendswork), each layer stating only what's different. - Diamond
extends— a profile extending two others that disagree on one category; the later one in the list wins. - A path-level override with the parent category closed — one skill shared without opening the whole category.
- A directory rule adding an inline override deeper than the profile it selected — a shared
client-strictprofile for~/work/clients, one extra skill for~/work/clients/acmespecifically, no new profile needed. - A glob entry override against
~/.claude/projects/— sharing history for every project matching a pattern, without listing each one. - A portable
.agent-shim.json— works identically for every clone location. - Two identities sharing one configuration profile — both declare the same
defaultConfigProfile; nothing else needs to stay in sync between them.