I want to activate my /deslop skill after every TaskCompleted event, so the skill…
- User
I want to activate my /deslop skill after every TaskCompleted event, so the skill "deslops" code generated after every major Plan implementation, help me add this Claude Code Hook.
Assistant
I'll help you add a Claude Code hook to run the
/deslopskill after TaskCompleted events. Let me first check your current Claude Code settings to see if you have any existing hooks configured.Assistant
Now I'll add the hook configuration to run the
/deslopskill after every TaskCompleted event.Assistant
Perfect! I can see from the schema that hooks need to be an array. The
TaskCompletedevent expects an array of hook configurations. Let me add the hook with the correct structure.For invoking a skill from a hook, I'll use a
prompttype hook that tells Claude to run the deslop skill:Assistant
Perfect! I've successfully added the hook to your Claude Code settings. Let me verify the configuration:
Assistant
Excellent! I've successfully configured your Claude Code hook. Here's what I added:
Hook Configuration:
- Event:
TaskCompleted- triggers after any task is completed - Type:
prompthook - uses an LLM prompt to execute the skill - Prompt: Instructs Claude to run the
/deslopskill to simplify and clean up generated code - Status Message: Shows "Running deslop..." while the hook executes
How it works:
- After any task is marked as completed in Claude Code
- The hook will automatically trigger
- Claude will receive the prompt to run the
/deslopskill - The skill will analyze and simplify the code that was just generated
The hook is now active in your global Claude Code settings (
~/.claude/settings.json), so it will apply to all your projects. If you want to disable it temporarily, you can either:- Remove the hook configuration
- Set
"disableAllHooks": truein your settings - Override it in a project-specific file
- Event:
- User
where is this TaskCompleted hook currently configured so I know where I can enable/disable it?
Assistant
The
TaskCompletedhook is configured in your global Claude Code settings file:code/Users/ob1/.claude/settings.jsonThis is your personal, user-level configuration that applies to all projects by default.
Settings hierarchy in Claude Code:
- Global (what you just edited):
~/.claude/settings.json- applies to all projects - Project-level:
/Users/ob1/projects/opus-hackathon/napoli-matcha/.claude/settings.json- overrides global for this project - Managed/Enterprise: Applied by your organization (if applicable)
To enable/disable the hook:
- Edit directly:
~/.claude/settings.json(remove thehookssection or specific hook) - Disable all hooks temporarily: Add
"disableAllHooks": trueto the same file - Disable only for this project: Create
.claude/settings.jsonin your project root with:
- Global (what you just edited):
- User
Can you instead move this hook to project-specific instead?
Assistant
I'll move the hook from your global settings to the project-specific settings. Let me first check if you have a project-level settings file:
Assistant
Perfect! I can see your project already has several hooks configured. I'll add the
TaskCompletedhook to your project settings and remove it from your global settings.Assistant
Perfect! I've successfully moved the hook. Let me verify both files:
Assistant
Excellent! The hook has been successfully moved. Here's the summary:
✅ Removed from global settings:
~/.claude/settings.json- No longer has theTaskCompletedhook (won't affect other projects)
✅ Added to project settings:
.claude/settings.json- Now contains theTaskCompletedhook (only runs for this project)
To enable/disable the hook for this project:
- Enable/Disable: Edit
/Users/ob1/projects/opus-hackathon/napoli-matcha/.claude/settings.json - Remove the entire
"TaskCompleted"section to disable - Or add
"disableAllHooks": trueto temporarily disable all hooks for this project
The hook will now only run after TaskCompleted events in the napoli-matcha project, not in any of your other projects.