chasanc

Direnv Workspaces — DevOps skill for Claude Code

DevOps community

Per-folder identities for Claude Code, gh, aws, docker, kube and git, switched by direnv.

How to install Direnv Workspaces

This entry records only its repository, not the path inside it, so there is no exact command to give. Open chasanc/direnv-workspaces and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Direnv Workspaces does

Per-folder identities for Claude Code, gh, aws, docker, kube and git, switched by direnv.

Alternatives in DevOps

  • Render Deploy — Deploy applications to Render's cloud platform using Git-backed services 14.6k ★
  • Ship Release — Systematic release workflow for RTK: build verification, version bump, changelog update, git tag, and push to 11.9k ★
  • AWS Skills Pack — AWS cloud services skills 1.6k ★

README

direnv-workspaces

**Work for several clients or employers from one laptop without mixing up accounts.** `cd` into a folder and your Claude Code account, `gh`, `aws`, `docker`, `kube`, npm config, git email and SSH key switch to that folder's identity. No logging in and out.

![cd into a folder and the matching identity switches on](docs/overview.svg)

Why

Without it With it
One gh/aws/Claude login at a time; you log out and in between projects Each folder has its own logins, all valid at once
A commit lands with the wrong email, or a push uses the wrong SSH key includeIf picks the email and key by folder
A tool started from a dock icon or cron uses whatever was logged in last Anything started without workspace env falls back to personal, never to a company
Claude Code memory, plugins and history from one client leak into another Each workspace has its own Claude config and memory, with no credentials copied
Claude can read a different client's folder by accident Deny rules block each workspace's Claude from the others' folders and config
Setting up a new client takes an afternoon ws new acme you@acme.com, then log in once

How it works

  1. personal uses every tool's default location (~/.claude, ~/.config/gh, ~/.aws, ...).
  2. Each other workspace lives in ~/.config/workspaces// and applies only inside its folder ~/work//.
  3. A one-line .envrc in that folder points direnv at the workspace. On cd, direnv sets the tools' config-dir variables (CLAUDE_CONFIG_DIR, GH_CONFIG_DIR, AWS_CONFIG_FILE, ...). A git includeIf rule sets the email and SSH key.
  4. Leaving the folder restores personal.

Not a security boundary

Everything runs as one Linux user. Any program you run can read every file. This prevents *accidents* (wrong account, wrong key, wrong email), not hostile code. For a hard wall use a dev container or a second Linux user.

Inst