feat: add claude wrapper that auto-links AGENTS.md as CLAUDE.md

New functions/claude.fish wraps the claude CLI. Before launch it checks the
current directory and the git project root; when CLAUDE.md is absent but
AGENTS.md is present, it creates a relative symlink CLAUDE.md -> AGENTS.md so
Claude Code picks up shared agent instructions without duplicating the file.
Arguments are forwarded verbatim.

Implemented as a C1 command shadow: when __fish_config_op_aliases (or the
master __fish_config_opinionated) is disabled, the call passes through to the
bare claude binary unchanged. Link-creation notices print to stderr in green.

Documents the new shadow in docs/fish-config.md (section 5.12 AI tools, C1
component reference table, and C1 summary list) and adds a claude-cli anchor
to docs/fish-config.index.
This commit is contained in:
2026-06-12 17:44:40 -04:00
parent 95f2ad9112
commit f76a45e273
3 changed files with 82 additions and 1 deletions
+1
View File
@@ -130,6 +130,7 @@ logs=### logs
smart-exit=### smart_exit
ai=## 5.12 AI and Developer Tools
antigravity=### antigravity
claude-cli=### claude
claude=### claude-resume
claude-docs=### claude-docs
claude-pr=### claude-pr
+17 -1
View File
@@ -1106,6 +1106,20 @@ Add -i (interactive confirmation) to destructive commands:
file in the current directory, or opens an interactive fzf picker if no
session file is found.
### claude
Synopsis: claude [args...]
Wrapper for the claude CLI. Before launching, checks the current
directory and the git project root for CLAUDE.md; when it is absent but
AGENTS.md is present, creates a relative symlink CLAUDE.md -> AGENTS.md
so Claude Code picks up shared agent instructions without duplicating
the file. All arguments are forwarded verbatim. Command shadow (C1):
when __fish_config_op_aliases (or the master) is disabled, the call is
passed through to the real claude binary unchanged.
claude
claude --resume
### claude-resume
Synopsis: claude-resume
@@ -1459,7 +1473,8 @@ but a category with an explicit truthy value remains enabled regardless.
ping->prettyping, ssh->kitten,
du->duf/dust, mkdir/bash wrappers,
history timestamps, grep/cp/mv/wget
flag injection, help intercept
flag injection, help intercept, claude
AGENTS.md auto-link
__fish_config_op_autoexec Startup side-effects: Fisher
bootstrap, theme apply, paru/yay
wrapper generation, auto venv
@@ -1545,6 +1560,7 @@ all of these commands.
grep/fgrep/egrep forced --color=auto system grep variants
dir / vdir forced --color=auto system dir / vdir
help config intercepts "help config" → config-help fish builtin help
claude auto-links AGENTS.md as CLAUDE.md before launch command claude
When C1 is disabled, `rm` uses bare `command rm` with no wrapper — files
are permanently deleted, not trashed. There is no intermediate safety net.