hug
Turn HuG Flow on or off for Claude Code, or report whether it is on. `on` records the current setup, resolves instructions that conflict with HuG Flow, then applies the minimal setup through one impor
SKILL.mdskills/hug/SKILL.md
GitHub/hug
Everything is done by ~/.claude/hug/scripts/hug.sh, a clone of
https://github.com/julienbrg/hug. If it's missing, follow
SETUP.md first.
Run the script as it is. Don't edit ~/.claude/CLAUDE.md,
~/.claude/settings.json or ~/.claude/skills/ by hand: off can
only revert what the script recorded.
on
Scan. Run
sh ~/.claude/hug/scripts/hug.sh scan. It prints candidate lines as<file>:<line>:<text>, from the globalCLAUDE.mdand the current repository's. They are only candidates: keep the ones that really contradict HuG Flow:- the agent stages its own work, or runs
git add -A,git add .orgit commit -a; - the agent commits without waiting for the maintainer to stage;
- pushing or force-pushing to
main; Co-Authored-Bytrailers or "Generated with" footers.
Also read
~/.claude/settings.json:includeCoAuthoredByorgitAttributionset totrueis a conflict too. The script never overwrites an existing key, so the maintainer changes it or keeps it.- the agent stages its own work, or runs
Ask. Show the real conflicts in one list. For each, the maintainer picks: keep theirs, comment it out (restored by
off), or leave both. Say that an unresolved conflict makes the agent's behavior unpredictable, since both files load together.Plan. State what
onwill change and that/hug offreverts it:- one import line appended to
~/.claude/CLAUDE.md, pointing toexamples/minimal/CLAUDE.mdin the clone (skipped if the file already has HuG rules); includeCoAuthoredBy: false,gitAttribution: falseand deny rules for bulk staging,git commit -a, pushes tomainand admin merges, added to~/.claude/settings.jsonwhere missing;- the
/intakeskill in~/.claude/skills/intake/, if absent; - with
--repo: squash-only merges, merged branches deleted, and thehug-flowruleset requiring the checks that passed on the last merged pull request, throughhug init, which refuses if none did. This needs admin rights, is visible to collaborators, and rulesets on private repositories may need a paid GitHub plan.
Wait for a yes.
- one import line appended to
Apply. Run
sh ~/.claude/hug/scripts/hug.sh on [--comment <file>:<line>]... [--repo <owner>/<repo>], with one--commentper line to comment out. Report its output, including the backup path.Tell the maintainer the rules load in the next session: they start a new one, or run
/clear.
off
Run sh ~/.claude/hug/scripts/hug.sh off and report its output. It
removes the import line, uncomments what on commented out, removes the
settings and the intake skill on added and, if on had --repo,
deletes the ruleset and restores the merge settings. Changes the
maintainer made in the meantime stay. The full backup stays on disk.
status
Run sh ~/.claude/hug/scripts/hug.sh status and report its output.