thread-abort-migration

thread-abort-migration is a skill for Claude Code, Codex from managedcode/dotnet-skills. It costs 163 tokens per session (2,800 once invoked), scanned A, a copy of thread-abort-migration, MIT.

A guide to replacing .NET Framework’s Thread.Abort and related forced thread termination with cooperative cancellation. Cooperative cancellation lets running code stop by checking a cancellation request and cleaning up safely.

In plain words
What is it for?
Use it to replace Thread.Abort, Thread.Interrupt, Thread.ResetAbort, ThreadAbortException handling, and older ASP.NET patterns that depend on them.
Why use it?
Forced thread termination is unsupported in modern .NET and can leave work or cleanup unfinished. This migration helps older applications move to a supported way of stopping operations.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to replace Thread.Abort, Thread.Interrupt, Thread.ResetAbort, ThreadAbortException handling, and older ASP.NET patterns that depend on them.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/managedcode/dotnet-skills/thread-abort-migration
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add managedcode/dotnet-skills --skill thread-abort-migration
Clone the repo
git clone --depth 1 https://github.com/managedcode/dotnet-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for thread-abort-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/managedcode/dotnet-skills/thread-abort-migration/github.svg)](https://agentmods.dev/skills/managedcode/dotnet-skills/thread-abort-migration)
Your own site
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/thread-abort-migration"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/thread-abort-migration/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for thread-abort-migration

Your own site · 80×15
<a href="https://agentmods.dev/skills/managedcode/dotnet-skills/thread-abort-migration"><img src="https://agentmods.dev/badge/skills/managedcode/dotnet-skills/thread-abort-migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 163 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,800 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00163 $0.02800
Opus 5.5 $0.00065 $0.01120
Sonnet 5.5 $0.00033 $0.00560
Haiku 4.5 $0.00016 $0.00280

Measured 2mo ago against content hash 0dfe570c456b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

thread-abort-migration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to thread-abort-migration — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

catalog/Platform/Official-DotNet-Upgrade/skills/thread-abort-migration/SKILL.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Thread.Abort Migration

This skill helps an agent migrate .NET Framework code that uses Thread.Abort to the cooperative cancellation model required by modern .NET (6+). Thread.Abort throws PlatformNotSupportedException in modern .NET — there is no way to forcibly terminate a managed thread. The skill identifies the usage pattern first, then applies the correct replacement strategy.

When to Use

  • Migrating a .NET Framework project to .NET 6+ that calls Thread.Abort
  • Replacing ThreadAbortException catch blocks that use control flow or cleanup logic
  • Removing Thread.ResetAbort calls that cancel pending aborts
  • Replacing Thread.Interrupt for waking blocked threads
  • Migrating ASP.NET code that uses Response.End or Response.Redirect(url, true), which internally call Thread.Abort
  • Resolving PlatformNotSupportedException or SYSLIB0006 warnings after a target framework change

When Not to Use

  • The code only uses Thread.Join, Thread.Sleep, or Thread.Start without any abort, interrupt, or ThreadAbortException catch blocks. These APIs work identically in modern .NET — no migration is needed. Stop here and tell the user no migration is required. If you suggest modernization (e.g., Task.Run, Parallel.ForEach), you must explicitly state these are optional improvements unrelated to Thread.Abort migration, and the existing code will compile and run correctly as-is on the target framework.
  • The project will remain on .NET Framework indefinitely
  • The Thread.Abort usage is inside a third-party library you do not control

Inputs

Input Required Description
Source project or solution Yes The .NET Framework project containing Thread.Abort usage
Target framework Yes The modern .NET version to target (e.g., net8.0)
Thread.Abort usage locations Recommended Files or classes that reference Thread.Abort, ThreadAbortException, Thread.ResetAbort, or Thread.Interrupt

Read the full file on GitHub · 145 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 145 lines · 163 tokens per session scan A 0dfe570c456b

Subscribe to this mod's changes

thread-abort-migration is a skill published in the GitHub repository managedcode/dotnet-skills (527 stars, last pushed 16d ago), licensed MIT. It adds 163 tokens to every session and 2,800 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to thread-abort-migration, differing in 0 lines, and is treated as a copy.

Related

thread-abort-migration compared with skills from other repositories

thread-abort-migration next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
thread-abort-migrationmanagedcode/dotnet-skillsSkill52716d agoMITA163Claude Code, Codex
cs0618-hunterjoslat/maf-doctorSkill1414d agoMITA85Claude Code, Codex
nuget-diff-analyzerjoslat/maf-doctorSkill1414d agoMITA56Claude Code, Codex
agents-sdk-dotnet-debuggingmicrosoft/AgentsSkill1.1k5d agoMITA136Claude Code
roslyn-codelensMarcelRoozekrans/roslyn-codelens-mcpSkill78todayMITA104Claude Code
clean-architecture-dotnetSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A50Claude Code, Codex
creating-dotnet-mcp-serversSebastienDegodez/copilot-instructionsSkill19923d agoApache-2.0A43Claude Code, Codex