/reapply-patches
Reapply local modifications after a THRUNT update
$ npx -y skills add backbay-labs/thrunt-god --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/reapply-patches
Context preview
What this command does when you run it.
Reapply local modifications after a THRUNT update
Command definition
reapply-patches.mddescription: Reapply local modifications after a THRUNT update
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
<purpose> After a THRUNT update wipes and reinstalls files, this command merges user's previously saved local modifications back into the new version. Uses intelligent comparison to handle cases where the upstream file also changed. </purpose>
<process>
Step 1: Detect backed-up patches
Check for local patches directory:
# Global install — detect runtime config directory
if [ -d "$HOME/.config/opencode/thrunt-local-patches" ]; then
PATCHES_DIR="$HOME/.config/opencode/thrunt-local-patches"
elif [ -d "$HOME/.opencode/thrunt-local-patches" ]; then
PATCHES_DIR="$HOME/.opencode/thrunt-local-patches"
elif [ -d "$HOME/.gemini/thrunt-local-patches" ]; then
PATCHES_DIR="$HOME/.gemini/thrunt-local-patches"
else
PATCHES_DIR="$HOME/.claude/thrunt-local-patches"
fi
# Local install fallback — check all runtime directories
if [ ! -d "$PATCHES_DIR" ]; then
for dir in .config/opencode .opencode .gemini .claude; do
if [ -d "./$dir/thrunt-local-patches" ]; then
PATCHES_DIR="./$dir/thrunt-local-patches"
break
fi
done
fiRead `backup-meta.json` from the patches directory.
**If no patches found:**
No local patches found. Nothing to reapply.
Local patches are automatically saved when you run /thrunt:update
after modifying any THRUNT workflow, command, or agent files.
Exit.
Step 2: Show patch summary
## Local Patches to Reapply
**Backed up from:** v{from_version}
**Current version:** {read VERSION file}
**Files modified:** {count}
| # | File | Status |
|---|------|--------|
| 1 | {file_path} | Pending |
| 2 | {file_path} | Pending |Step 3: Merge each file
For each file in `backup-meta.json`:
1. **Read the backed-up version** (user's modified copy from `thrunt-local-patches/`) 2. **Read the newly installed version** (current file after update) 3. **Compare and merge:**
- If the new file is identical to the backed-up file: skip (modification was incorporated upstream)
- If the new file differs: identify the user's modifications and apply them to the new version
**Merge strategy:**
- Read both versions fully
- Identify sections the user added or modified (look for additions, not just differences from path replacement)
- Apply user's additions/modifications to the new version
- If a section the user modified was also changed upstream: flag as conflict, show both versions, ask user which to keep
4. **Write merged result** to the installed location 5. **Report status:**
- `Merged` — user modifications applied cleanly
- `Skipped` — modification already in upstream
- `Conflict` — user chose resolution
Step 4: Update manifest
After reapplying, regenerate the file manifest so future updates correctly detect these as user modifications:
# The manifest will be regenerated on next /thrunt:update
# For now, just note which files were modified
Step 5: Cleanup option
Ask user:
- "Keep patch backups for reference?" → preserve `thrunt-local-patches/`
- "Clean up patch backups?" → remove `thrunt-local-patches/` directory
Step 6: Report
## Patches Reapplied
| # | File | Status |
|---|------|--------|
| 1 | {file_path} | ✓ Merged |
| 2 | {file_path} | ○ Skipped (already upstream) |
| 3 | {file_path} | ⚠ Conflict resolved |
{count} file(s) updated. Your local modifications are active again.</process>
<success_criteria>
- [ ] All backed-up patches processed
- [ ] User modifications merged into new version
- [ ] Conflicts resolved with user input
- [ ] Status reported for each file
</success_criteria>
Read more
description: Reapply local modifications after a THRUNT update allowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion
<purpose> After a THRUNT update wipes and reinstalls files, this command merges user's previously saved local modifications back into the new version. Uses intelligent comparison to handle cases where the upstream file also changed. </purpose>
<process>
Step 1: Detect backed-up patches
Check for local patches directory:
# Global install — detect runtime config directory
if [ -d "$HOME/.config/opencode/thrunt-local-patches" ]; then
PATCHES_DIR="$HOME/.config/opencode/thrunt-local-patches"
elif [ -d "$HOME/.opencode/thrunt-local-patches" ]; then
PATCHES_DIR="$HOME/.opencode/thrunt-local-patches"
elif [ -d "$HOME/.gemini/thrunt-local-patches" ]; then
PATCHES_DIR="$HOME/.gemini/thrunt-local-patches"
else
PATCHES_DIR="$HOME/.claude/thrunt-local-patches"
fi
# Local install fallback — check all runtime directories
if [ ! -d "$PATCHES_DIR" ]; then
for dir in .config/opencode .opencode .gemini .claude; do
if [ -d "./$dir/thrunt-local-patches" ]; then
PATCHES_DIR="./$dir/thrunt-local-patches"
break
fi
done
fiRead `backup-meta.json` from the patches directory.
**If no patches found:**
No local patches found. Nothing to reapply. Local patches are automatically saved when you run /thrunt:update after modifying any THRUNT workflow, command, or agent files.
Exit.
Step 2: Show patch summary
## Local Patches to Reapply
**Backed up from:** v{from_version}
**Current version:** {read VERSION file}
**Files modified:** {count}
| # | File | Status |
|---|------|--------|
| 1 | {file_path} | Pending |
| 2 | {file_path} | Pending |Step 3: Merge each file
For each file in `backup-meta.json`:
1. **Read the backed-up version** (user's modified copy from `thrunt-local-patches/`) 2. **Read the newly installed version** (current file after update) 3. **Compare and merge:**
- If the new file is identical to the backed-up file: skip (modification was incorporated upstream)
- If the new file differs: identify the user's modifications and apply them to the new version
**Merge strategy:**
- Read both versions fully
- Identify sections the user added or modified (look for additions, not just differences from path replacement)
- Apply user's additions/modifications to the new version
- If a section the user modified was also changed upstream: flag as conflict, show both versions, ask user which to keep
4. **Write merged result** to the installed location 5. **Report status:**
- `Merged` — user modifications applied cleanly
- `Skipped` — modification already in upstream
- `Conflict` — user chose resolution
Step 4: Update manifest
After reapplying, regenerate the file manifest so future updates correctly detect these as user modifications:
# The manifest will be regenerated on next /thrunt:update # For now, just note which files were modified
Step 5: Cleanup option
Ask user:
- "Keep patch backups for reference?" → preserve `thrunt-local-patches/`
- "Clean up patch backups?" → remove `thrunt-local-patches/` directory
Step 6: Report
## Patches Reapplied
| # | File | Status |
|---|------|--------|
| 1 | {file_path} | ✓ Merged |
| 2 | {file_path} | ○ Skipped (already upstream) |
| 3 | {file_path} | ⚠ Conflict resolved |
{count} file(s) updated. Your local modifications are active again.</process>
<success_criteria>
- [ ] All backed-up patches processed
- [ ] User modifications merged into new version
- [ ] Conflicts resolved with user input
- [ ] Status reported for each file
</success_criteria>
Threat hunting command system for agentic IDEs
Repo: backbay-labs/thrunt-god
Other commands on thrunt-god.
- /help
Show available THRUNT threat hunting commands and artifact layout
Open command - /map-environment
Map available telemetry, query surfaces, tenants, retention windows, and investigation blind spots
Open command - /new-case
Initialize a threat hunting case from a signal, detection, intel lead, or analyst suspicion
Open command - /new-program
Initialize a threat hunting program with an environment map, tool inventory, huntmap, and empty execution directories
Open command - /plan
Create phase plans for a threat hunt with exact telemetry tasks, receipts, and query outputs
Open command - /publish
Publish a hunt as a case report, escalation, detection promotion, or leadership summary
Open command

