My Claude Code and Codex setup — memory, subagents, skills, plugins — as a repo you clone and link. Mac and Linux, one script, no sudo.
git clone git@github.com:xs1128/agentfiles.git ~/.agentfiles
sh ~/.agentfiles/install.sh
exec $SHELLInstalls Claude Code, Codex, bun and rtk if missing, symlinks claude/ into
~/.claude and codex/ into ~/.codex, and installs the pinned plugins.
Needs curl, git, jq.
Rerun it to update. Safe to rerun.
| flag | effect |
|---|---|
--no-deps |
skip the installs |
--no-bootstrap |
skip the plugins |
--no-codex |
Claude Code only |
--mcp |
also install the MCP servers (needs node) |
Because both directories are symlinks into the clone, editing a skill here takes effect next session, in either harness.
Three things, nothing else: rtk, the skills, the bundled plugins.
codex/AGENTS.md → ~/.codex/AGENTS.md the rtk rule
skills/* → ~/.codex/skills/* the same 45 directories Claude gets
plugins.toml.tmpl → appended to ~/.codex/config.toml
Codex has no PreToolUse hook, so rtk is an instruction in AGENTS.md rather
than a rewrite. It costs a few tokens per session that the Claude side gets for
free.
config.toml is Codex's own — it writes to it during sessions — so the plugin
enables are appended instead of symlinked, and only for a block the file does
not already have. Nothing there is ever rewritten, so a plugin you turned off by
hand stays off, and the previous copy lands in ~/.codex/backups/. Model and
reasoning effort are deliberately not pinned: they are set in Codex's UI, and
writing them here would revert that on every install.
Re-link without touching the rest:
sh scripts/link-codex.shPut the key in ~/.agent.env, readable only by you:
install -m 600 /dev/null ~/.agent.env
echo 'ZAI_API_KEY=your-key-here' >> ~/.agent.envThen:
glmSame config against z.ai: opus → glm-5.2, sonnet → glm-5-turbo, haiku →
glm-4.7. Plain claude is unaffected. ZAI_API_KEY in the environment wins
over the file.
Not installed by default, and never loaded implicitly — a server costs tool definitions in every prompt.
sh scripts/bootstrap.sh --mcpThen load per session:
claude --mcp-config ~/.claude/mcp/web.json --strict-mcp-config # playwright
claude --mcp-config ~/.claude/mcp/cloud.json --strict-mcp-config # firebasePlaywright's tools error until a browser is installed: npx playwright install chromium.
Loaded by both harnesses out of skills/. Vendored from upstream at pinned
commits. To pull newer ones:
sh scripts/sync-skills.shThat recopies from the commits manifests/skills.json names, so upstream changes
arrive as a reviewable diff.
caveman and claude-hud only, pinned in manifests/plugins.json. Change a pin
and rerun sh scripts/bootstrap.sh.
claude/ symlinked into ~/.claude
codex/ symlinked into ~/.codex
skills/ loaded by both
manifests/ pinned plugins, MCP packages, skill sources
scripts/ link, link-codex, bootstrap, glm, sync-skills
install.sh
Everything this repo puts on the machine is a symlink into the clone, so unlinking is most of the job:
find ~/.claude ~/.codex -maxdepth 2 -type l \
-exec sh -c 'readlink "$1" | grep -q "/.agentfiles/" && rm "$1"' _ {} \;
rm -f ~/.local/bin/glm ~/.codex/skills/.agentfiles-managedThen drop the # agentfiles block from your shell rc. Whatever was replaced is
under ~/.claude/backups/ and ~/.codex/backups/. The plugin blocks appended to
~/.codex/config.toml are left behind; delete them by hand.
The tools are a separate question, and both of these throw away auth and history:
rm -rf ~/.local/bin/claude ~/.local/share/claude ~/.claude ~/.claude.json
rm -rf ~/.codex ~/.local/bin/codex ~/.local/bin/codex-code-mode-hostCodex keeps its binary under ~/.codex, so that one line takes the install with
it. bun is rm -rf ~/.bun. rtk ships no uninstaller — delete whatever which rtk names.
Most skills are other people's work, MIT licensed and vendored. See CREDITS.md.