Imported from epicrunze/JaRVIS (
skills/jarvis-toggle/SKILL.md). Install upstream withnpx skills add epicrunze/JaRVIS --skill jarvis-toggle. Copyright stays with the author.
JaRVIS Toggle
Enable or disable JaRVIS for the current project. This toggles both the hook system and the JaRVIS instructions in your project's agent configuration file.
Step 1: Resolve JaRVIS data directory
Run bash <skill-path>/scripts/resolve-dir.sh. It prints the absolute data directory; wherever $JARVIS_DIR appears below, paste that literal path. Do not wrap the call in $(...): Claude Code never auto-approves command substitution, and shell state does not persist between Bash calls.
If the resolved directory doesn't exist, inform the user they need to run /jarvis-init first, then stop.
Step 2: Detect platform and instruction file
Look for the project's agent instruction file. Check in order:
| File | Platform |
|---|---|
CLAUDE.md |
Claude Code |
.cursorrules |
Cursor |
.github/copilot-instructions.md |
GitHub Copilot |
AGENTS.md |
Antigravity |
Use the first one found. If multiple exist, operate on all of them.
Step 3: Toggle state
Check if $JARVIS_DIR/.jarvis-disabled exists:
Disabling (marker does NOT exist → create it)
- For each detected instruction file, find the
## JaRVISsection (from the heading to the next##heading or end of file). - Store the removed content in
$JARVIS_DIR/.jarvis-disabledas a JSON object:{ "files": { "CLAUDE.md": "## JaRVIS\n\nUse `/jarvis-reload`...", ".cursorrules": "## JaRVIS\n\nIdentity and memories..." } } - Remove the
## JaRVISsection from each instruction file.
Enabling (marker EXISTS → remove it)
- Read
$JARVIS_DIR/.jarvis-disabledto get the backed-up sections. - For each file in the backup, append the stored JaRVIS section back to the file.
- Delete
$JARVIS_DIR/.jarvis-disabled.
If the backup file is missing or corrupted, fall back to the example snippets from
skills/jarvis-init/references/ (CLAUDE.md.example, cursorrules.example, etc.)
to regenerate the section.
Step 4: Report status
Tell the user the new state:
- If now enabled: "JaRVIS is now enabled for this project. The
## JaRVISsection has been restored to<files>. Hooks will run on next session start." - If now disabled: "JaRVIS is now disabled for this project. The
## JaRVISsection has been removed from<files>. Hooks will be skipped until you run/jarvis-toggleagain."
Also note: "You can also set JARVIS_DISABLE=true in your environment to temporarily
disable JaRVIS for a single session without changing the persistent setting."