A developer has shared a DIY method for managing multiple project accounts with Claude Code, addressing issues where the AI might use the wrong credentials. The solution involves configuring Git for per-folder identities and using direnv to manage environment variables for various command-line tools like GitHub CLI and Vercel. For Claude Code itself, a separate configuration directory can be specified. However, this manual setup has limitations, particularly with desktop applications and browser-based sign-ins. To overcome these, the developer created a tool called Hats, which centralizes account management, stores tokens securely in the system's keychain, and provides safeguards against accidental incorrect usage. AI
IMPACT Simplifies multi-project workflows for developers using AI coding assistants.
RANK_REASON The item describes a new tool (Hats) developed by the author to solve a specific problem with an existing AI product (Claude Code).
Read on dev.to — Claude Code tag →
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →