iTranslated by AI
Reusing Common Coding Agent Settings with dotfiles

Introduction
Claude Code, Codex CLI, Gemini CLI...
Various coding agents are emerging, but isn't it quite a hassle to set each of them up individually?
Also, if your PC crashes and you haven't backed up those settings, you often find yourself starting over from scratch.
In this article, I will use Dotfiles, a tool for "managing configuration files," to organize these settings.
What are Dotfiles?
It would be faster to read the following resources as they are quite helpful.
In short, it is a system that manages configuration files such as .zshrc and links them using symbolic links (like shortcuts). This allows you to change everything by updating one location and makes backups easier.
It seems difficult, doesn't it?
It's not difficult at all.
Writing a shell script for the setup is a bit of a chore, but you can just have ChatGPT write it for you quickly.
Once you understand how to create symbolic links, you're all set.
How to do it
First and foremost, since you need a base dotfiles folder, create a repository with Git and perform a quick initial commit.
You can place your configuration files inside it. In this case, we will create an install.sh to link AGENTS.md with various coding agents.
Placing the files
First, organize the contents of the dotfiles folder as shown below:
dotfiles
├── AGENTS.md
└── install.sh
Write your common settings in AGENTS.md. It is perfectly fine to just write your prompt here in plain language.
Creating symbolic links
After writing AGENTS.md, we will set up a symbolic link for it. This time, we will target Claude Code's ~/.claude/CLAUDE.md.
Ultimately, you can just use the following command:
ln -s "AGENTS.md" "~/.claude/CLAUDE.md"
With this, Claude Code's CLAUDE.md and AGENTS.md are linked, and CLAUDE.md now references AGENTS.md.
Automating with a shell script
Now, while running this command works,
typing it every time is a hassle, so let's automate it.
# dotfiles configuration
# Written in "source:destination" format
dotfiles=(
"AGENTS.md:$HOME/.claude/CLAUDE.md"
"AGENTS.md:$HOME/.codex/AGENTS.md"
"AGENTS.md:$HOME/.gemini/GEMINI.md"
)
# Delete existing files and create symbolic links
for dotfile in "${dotfiles[@]}"; do
src="${dotfile%%:*}"
dest="${dotfile##*:}"
rm -f "$dest"
ln -s "$(pwd)/$src" "$dest"
done
echo "✌️ Install completed!!!!"
echo "✌️ Please restart your terminal or run: source ~/.zshrc"
Grant permissions to this shell script with the following command
and execute it to update all settings at once.
chmod 755 install.sh
Conclusion
Now it is possible to carry over the common settings for coding agents.
Please enjoy a better coding life by utilizing this.
By the way, besides this, I also include things like:
- A setup to make the terminal look cute
- tmux configuration
- Raycast scripts
I've tossed these in as well, and they are quite convenient.
Discussion