by yzhao062
One config to rule all your AI agents: portable (every project, every session), effective (curated writing, routing, skills), and safer (destructive-command guard).
# Add to your Claude Code skills
git clone https://github.com/yzhao062/anywhere-agentsEnglish · 中文
One config to rule all your AI agents: portable, effective, safer.
A maintained, opinionated configuration that follows you across every project, every machine, every session. Supports Claude Code and Codex today, with plans to grow.
Install • Scenarios • Docs • Fork

[!NOTE] Condensed from daily use. The sanitized public release of the agent config I have run daily since early 2026 across research, paper writing, and dev work (PyOD 3, LaTeX, admin) on macOS, Windows, and Linux. Not a weekend project. Maintained by Yue Zhao — USC CS faculty and author of (9.8k★ · 38M+ downloads · ~12k citations).
No comments yet. Be the first to share your thoughts!
Your preferences for how AI agents work (how reviews happen, what writing style to use, which Git operations must confirm, which AI-tell words to never emit) today live in one of three broken states: scattered across per-repo CLAUDE.md files that drift over time, copy-pasted between projects diverging on every tweak, or only in your head and re-explained to every agent in every session.
I started using Claude Code and Codex daily across research code, paper writing, and admin work in early 2026. Daily use exposed which rules actually needed automation: a bootstrap that syncs config across repos and machines; a review workflow that stages a diff, sends it to Codex, iterates; and a set of rules that kept failing at the prompt level until they became hooks or checks. anywhere-agents ships that (portable sync, review workflow, and mechanical enforcement) as one maintained configuration. Four shipped skills (implement-review, my-router, ci-mockup-figure, readme-polish) cover review, routing, figures, and READMEs. Fork it, swap pieces, keep upstream updates.
It is not only a style guide: hooks stop risky commands from proceeding silently and block flagged prose writes before they land.
A typical day with this config: morning project setup (Scenario A), midday review when a feature is done (Scenario B), afternoon prose drafting with writing-style guardrails (Scenario C), evening safety check before pushing (Scenario D), and session defaults at the right effort and model level running in the background (Scenario E). The five scenarios below are not a feature list; they are the default behavior the author has lived with since early 2026.
Run this once in the project root:
pipx run anywhere-agents # Python path (zero-install with pipx)
npx anywhere-agents # Node.js path (zero-install with Node 14+)
Next time you open Claude Code or Codex here, the agent reads AGENTS.md automatically and inherits every default: writing style, Git safety, session checks, skill routing.
What appears in your project after bootstrap:
your-project/
├── AGENTS.md # shared config (synced from upstream)
├── AGENTS.local.md # your per-project overrides (optional, never overwritten)
├── CLAUDE.md # generated from AGENTS.md for Claude Code
├── agents/codex.md # generated from AGENTS.md for Codex
├── .claude/
│ ├── commands/ # skill pointers: `implement-review`, `my-router`, `ci-mockup-figure`, `readme-polish`
│ └── settings.json # your project keys merged with shared keys
└── .agent-config/ # upstream cache (auto-gitignored)
Git is the subscription engine. git pull gets updates. Fork and git merge upstream/main if you want to diverge.
You finished a feature. You want a second opinion before the merge.
Ask Claude Code: "review this".
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#ffe5e5', 'primaryBorderColor': '#990000', 'primaryTextColor': '#1a1a1a', 'lineColor': '#990000'}}}%%
flowchart LR
A([you: "review this"]) --> B[Claude stages<br/>the diff]
B --> C[Codex reviews<br/>with content lens]
C --> D[/CodexReview.md<br/>High · Med · Low/]
D --> E[Claude applies<br/>fixes, re-stages]
E --> F{clean?}
F -->|no, loop| C
F -->|yes| G([merged])
my-router picks the skill (implement-review), which then picks the content lens (code, paper, proposal, or general) based on what you staged. Codex reads the diff, writes CodexReview.md with findings tagged High / Medium / Low and exact file:line references. Claude Code applies the fixes and re-stages — the loop runs until there is nothing left to flag. For larger changes, the loop can start with a plan-review phase that checks the approach before implementation.
You ask your agent to draft a related-work section. The default AI voice creeps in.
Without anywhere-agents:
We delve into a pivotal realm — a multifaceted endeavor that underscores a paramount facet of outlier detection, paving the way for groundbreaking advances that will reimagine the trailblazing work of our predecessors and, in so doing, garner unprecedented attention in this burgeoning field.
One sentence. 42 words. Ten highlighted AI-tell words. An em-dash used as casual punctuation. No structure — every clause just adds more filler.
With anywhere-agents:
We examine outlier detection along three dimensions: coverage, interpretability, and scale. Each matters; none alone is sufficient. Prior work has addressed one or two of these in isolation; this work integrates all three.
Three sentences. 33 words. Zero banned words. Semicolons and colons instead of em-dashes. One idea per sentence, and the last sentence actually says something about the contribution.
The shared AGENTS.md bans ~40 AI-tell words by default (delve, pivotal, underscore, paramount, paving, groundbreaking, trailblazing, garner, unprecedented, burgeoning, and more). It preserves your format (LaTeX stays LaTeX, no bullet conversion of prose), avoids em-dashes as casual punctuation, and does not glue a summary sentence to the end of every paragraph. The ban is enforced by a PreToolUse hook on .md/.tex/.rst/.txt writes; Scenario D covers the mechanism.
Customize the banned list in your fork, or override per project in AGENTS.local.md.
A PreToolUse hook (scripts/guard.py) runs before every agent tool call and intercepts four classes of action before they land.
Family 1: Destructive Git / GitHub confirmations. The agent is about to force-push main. You have had a long day and were about to type y without reading.
[guard.py] ⛔ STOP! HAMMER TIME!
command: git push --force origin main
category: destructive push
This is destructive. Are you sure? (y/N)
Covers git push, git commit, git merge, git rebase, git reset --hard, gh pr merge, gh pr create, and related. Read-only operations (status, diff, log) stay fast.
Family 2: Command-shape guard for compound cd chains. cd <path> && <cmd> is denied at tool-call time because it triggers Claude Code's built-in approval prompts even when both halves are individually allowed, and hides the underlying tool call. Suggestion: use git -C <path> or pass the target path as an argument.
Family 3: Writing-style deny on prose files. Any Write / Edit / MultiEdit to .md / .tex / .rst / .txt files whose outgoing content contains a banned AI-tell word from AGENTS.md Writing Defaults is denied at tool-call time, not merely requested. The deny message lists the offending words so the agent can revise. Code files (.py, .js, etc.) are not checked.
Family 4: Session-banner gate. Until the agent has emitted the session-start banner at the top of a session, user-visible mutating tool calls (Write / Edit / Bash / MultiEdit / etc.) are denied; read-only and dispatch tools (Read / Grep / Glob / Skill / Task / TodoWrite and similar) stay available so the agent can inspect state and route work. Prevents silent skipping of the bootstrap status report.
AGENT_CONFIG_GATES=off in the env block of ~/.claude/settings.json disables only Families 3 and 4. Families 1 and 2 stay on; they guard irreversible loss and hidden command shapes, with no false-positive cost worth the opt-out.
Shell deletes (rm -rf) are gated separately through Claude Code's built-in permission prompts configured in user/settings.json.
Most Claude Code and Codex users never touch:
medium. The /effort slider lets you pick max, but only for the current session; it does not persist.