feat: add claude wrapper that auto-links AGENTS.md as CLAUDE.md #49
Reference in New Issue
Block a user
Delete Branch "feat/claude-wrapper-agents-link"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
functions/claude.fish, a wrapper for theclaudeCLI. Before launching, it checks the current directory and the git project root; whenCLAUDE.mdis absent butAGENTS.mdis present, it creates a relative symlinkCLAUDE.md -> AGENTS.mdso Claude Code picks up shared agent instructions without duplicating the file. All arguments are forwarded verbatim.Details
__fish_config_op_enabled __fish_config_op_aliases. When disabled (or the master__fish_config_opinionatedis off), the call passes through to the barecommand claude $argvunchanged — per Convention §14.ln -s AGENTS.md "$dir/CLAUDE.md"so the link is portable and not tied to an absolute path.set_color green), with paths shown relative to the git root.-h/--helpand every other flag straight to the realclaude(thin wrapper exemption, §12).Docs
docs/fish-config.md(SoT): new### claudeentry in §5.12, a row in the C1 component-reference table, and a mention in the C1 summary list.docs/fish-config.index: newclaude-clianchor.Manual Verification
AGENTS.mdbut noCLAUDE.md, runclaude --help. Confirm a green→ Linked CLAUDE.md → AGENTS.mdnotice prints and the symlink is created (ls -l CLAUDE.mdshows-> AGENTS.md).claudeagain in the same directory — confirm no duplicate link notice (CLAUDE.md now exists).AGENTS.md, runclaudeand confirm the root link is created with a relative path shown in the notice.claudelaunches with no notice and no file created.set -g __fish_config_op_aliases off, runclaudein anAGENTS.md-only dir, and confirm it passes through with no symlink created.claude --resumebehaves identically to the bare binary.