Agent skill
name
“Find out process id of processes consuming desired port no and kill those processes,Use this skill when we need to free up a desired port no that is occupied by a process, or when user request to free up <xyz> port or on error `port is already in use` when starting a new process”
Install this agent skill to your Project
npx add-skill https://github.com/sohampirale/skills/tree/main/.claude/free_port_in_use
SKILL.md
Purpose
- If desired port for new process to start is occupied/already in use due to i.force stopping old process (cntl+z) without proper realease of resources such as port no ii.backgroud processes running that occupy the desired port -Find out process id's of running processes on a desirec port no & kill those processes with process id received
Variables
KILL_PROCESSES : True
Instructions
- Read workflow steps clearly
- Do not interfere with any
port_nothat isn't requested - Do NOT assume any
port_noon your own - Do not kill processes of browser visiting a port
- NO need to read the
.claude/free_port_in_use/helpers.pyfile
Workflow
-
- Understand clearly the EXACT
port_nothat needs to be freed
- Understand clearly the EXACT
-
- Read
.claude/free_port_in_use/tools.pyfile
- Read
-
- Use
.claude/free_port_in_use/tools.py: def list_process_ids(port_nod)tool to get all process ids
- Use
-
- Use
.claude/free_port_in_use/tools.py: def kill_process_ids(process_ids:list[...])tool to kill all processes using desiredport_no
- Use
-
- Respond with clear summary of work done
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
git-guardrails-claude-code
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
scaffold-exercises
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
migrate-to-shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Didn't find tool you were looking for?