$ git clone https://github.com/u1f992/dotfiles.git ~/dotfiles
$ cd ~/dotfiles
$ ./link.sh> .\link.batIgnore the .tmp/ directory and personal Claude Code/Codex settings in all repositories. Codex's .codex/ directory is excluded as a unit; under .agents/, only files and directories carrying .local or -local suffixes are excluded.
$ git config --global core.excludesfile "$(pwd)/.gitignore-global"
$ git config --global --get core.excludesfileTo unset:
$ git config --global --unset core.excludesfileOXC reads exclusions from .gitignore and .git/info/exclude, but deliberately ignores the user's global Git ignore file. In projects that use OXC, append the global exclusions to .git/info/exclude:
$ git_global_ignore="$(git config --path --get core.excludesFile)" && git_info_exclude="$(git rev-parse --path-format=absolute --git-path info/exclude)" && test -f "$git_global_ignore" && test -f "$git_info_exclude" && { printf '\n'; cat "$git_global_ignore"; } >> "$git_info_exclude".claude/ holds personal Claude Code configuration. Each item carries a suffix so that core.excludesfile (see above) ignores it in other projects. This assumes those projects do not use the suffix themselves. The suffix is .local, except skill directories, which use -local to conform to the Agent Skills specification (latest).
Deploy them into a project with symlinks dereferenced. The destination receives regular files rather than links back into this repository:
$ cp -RL ~/dotfiles/.claude proj-dir/To share project instructions between coding agents, a relative symlink from
CLAUDE.mdtoAGENTS.mdis recommended:$ ln -s AGENTS.md CLAUDE.md
The canonical shared rules and skills are under .agents/rules/ and .agents/skills/. .claude/rules and .claude/skills are relative symlinks to those shared directories. cp -RL dereferences the links when deploying Claude configuration, so the destination receives regular rules/ and skills/ directories.
The third-party skills below are vendored. This is because the specification also requires a skill's name to match the parent directory name, so an unmodified submodule and the -local suffix cannot coexist.
| Directory | Upstream |
|---|---|
| .agents/skills/humanizer-local | blader/humanizer@523374d (MIT license) |
| .agents/skills/japanese-tech-writing-local | k16shikano/fd287c3133457c4fd8f5601d34aa817d@c7189cd (Unlicense) |
| .agents/skills/cognitive-rhythm-writing-local | k16shikano/eb2929f13ed19c97188393d297be8432@a3b1e26 (Unlicense) |
To confirm that the name is the only change (japanese-tech-writing-local also carries a one-line local style patch, SKILL.md.diff):
$ git clone https://github.com/blader/humanizer .tmp/humanizer
$ git -C .tmp/humanizer checkout 523374dee72d67c7b2b5f858ea0094ffda49c3ac
$ diff --recursive --exclude=.git .tmp/humanizer .agents/skills/humanizer-localFor japanese-tech-writing-local, apply that patch to the upstream checkout first; only the name then differs. Re-apply it after any future upstream bump.
$ git clone https://gist.github.com/k16shikano/fd287c3133457c4fd8f5601d34aa817d.git .tmp/japanese-tech-writing
$ git -C .tmp/japanese-tech-writing checkout c7189cdc9c2520be50418209834145bdf3a46e97
$ patch -d .tmp/japanese-tech-writing -p1 < .agents/skills/japanese-tech-writing-local/SKILL.md.diff
$ diff --recursive --exclude=.git --exclude=SKILL.md.diff .tmp/japanese-tech-writing .agents/skills/japanese-tech-writing-local$ git clone https://gist.github.com/k16shikano/eb2929f13ed19c97188393d297be8432.git .tmp/cognitive-rhythm-writing
$ git -C .tmp/cognitive-rhythm-writing checkout a3b1e26beced71d582e13314fb6f5b179b023c76
$ diff --recursive --exclude=.git .tmp/cognitive-rhythm-writing .agents/skills/cognitive-rhythm-writing-localThe Claude Code configuration is mirrored into Codex-native repository surfaces:
.codex/rules/agents-preamble.local.mdcontains only the Codex-specific instructions for loading./AGENTS.mdand resolving precedence..agents/rules/contains the canonical rules shared with Claude Code.AGENTS.override.mdis generated by joining the Codex-only preamble and the shared rules withnpm run generate:instructions..agents/skills/contains the local skills..codex/config.tomland.codex/hooks.jsonconfigure Codex and its hooks..codex/rules/default.rulesblocksgh pr create,gh issue create, andgit push.
Deploy the Codex configuration and shared skills in the same way:
$ cp -RL ~/dotfiles/.agents ~/dotfiles/.codex ~/dotfiles/AGENTS.override.md proj-dir/Shared hook data and host-independent policy code have one canonical copy under .agents/hooks/:
.agents/hooks/
├── policy.local/
│ ├── cli.ts
│ ├── hook-adapter.ts
│ ├── reject-words.ts
│ └── require-tasks.ts
├── reject-words.local.json
└── require-tasks.local.json
Claude and Codex keep only their host-specific hook schema and HookAdapter in .claude/hooks/claude.local.ts and .codex/hooks/codex.local.ts. Their policy.local/ directories and JSON files are relative symlinks to .agents/hooks/. The executable entry points only connect an adapter, a policy, and its JSON file; stdin/stdout handling lives in the shared cli.ts.
Each host uses one stop.local.ts hook that evaluates the banned-word and pending-task policies together and merges their messages into one Stop decision. Codex's edit adapter extracts only added lines from an apply_patch command, so deleted and unchanged context do not trigger the banned-word policy.
cp -RL follows all these links, so deployed projects are self-contained and contain regular files rather than links back into this repository.
Codex loads project configuration only after the repository is trusted. Review and trust the migrated command hooks with /hooks on first use.