
Close Issue: Let AI Clean Up Stale Issues and Keep Your Repository Organized
Introduction
The longer a project runs, the more GitHub issues pile up. Resolved issues that were never closed, issues made irrelevant by changing requirements, issues with no activity for months—this "noise" makes it harder to find the issues that actually need attention.
Reviewing and closing issues one by one is tedious and time-consuming. That's where DevLoop Runner's Close Issue comes in. It uses AI to analyze your open issues, determine which ones should be closed, and clean them up automatically.
What Is Close Issue?
Close Issue is one of three modes available in Issue Run.
| Mode | Description |
|---|---|
| Create Issue | Analyzes a repository and creates new issues automatically |
| Rewrite Issue | Rewrites an existing issue to improve clarity and structure |
| Close Issue | Analyzes stale issues and closes them automatically (this article) |
Where Create Issue creates issues and Rewrite Issue polishes them, Close Issue cleans up your issue backlog. The AI analyzes each issue's content and context, then makes closure decisions with a confidence score and clear reasoning.
How to Use
Step-by-Step Guide
- Navigate to the Run page and select the "Issue Run" tab
- Choose "Close Issue" from the mode selection
- Enter the repository
- Format:
owner/repo(e.g.,my-org/my-project)
- Format:
- Set the inspection limit (1–50 issues)
- Optionally configure the days threshold and exclude labels
- Select your GitHub account
- Click "Start Issue Run" to run
Parameter Details
Close Issue has several unique parameters that give you fine-grained control over the process.
Inspection Limit (1–50 issues)
The maximum number of open issues the AI will inspect. Unlike Create Issue's limit of 5, Close Issue supports up to 50 issues at once. Start with a smaller number to review the results, then increase as you gain confidence.
Days Threshold (Default: 90 days)
Specifies how many days of inactivity an issue must have before it's considered for closure. The default is 90 days.
| Setting | Use Case |
|---|---|
| 30 days | Active projects needing quick cleanup |
| 90 days | Standard periodic cleanup |
| 180 days | Long-term projects with conservative cleanup |
If left unset, the AI evaluates all issues regardless of their last activity date.
Exclude Labels
Prevents issues with specific labels from being closed. Specify multiple labels separated by commas.
Example: bug, feature, wontfix, pinned
Tagging important issues with labels like pinned or keep-open ensures they won't be accidentally closed.
Understanding the Results
Close Issue results are displayed on the job detail page.
Summary Statistics
The results overview shows four key metrics.
| Metric | Description |
|---|---|
| Total Inspected | Number of issues the AI analyzed |
| Recommended Close | Number of issues the AI recommended closing |
| Actually Closed | Number of issues that were actually closed |
| Skipped | Number of issues skipped due to exclude labels or other reasons |
Individual Issue Details
For each issue, you can review the following information:
- Issue number and title — Identifies the issue
- Status — Closed, skipped, or error
- AI recommendation — "Close" or "Keep"
- Confidence score — How confident the AI is in its decision, shown as a percentage
- Reasoning — The AI's explanation of why it made that decision (expandable)
A higher confidence score means the AI is more certain the issue should be closed. Reading the reasoning helps you verify whether the AI's analysis is sound.
Use Cases
Regular Repository Cleanup
Run Close Issue monthly or quarterly to keep stale issues from piling up.
1st of each month: Inspect 20 issues inactive for 90+ days
End of quarter: Inspect 50 issues inactive for 180+ days
Regular runs keep your issue count manageable and your backlog focused.
Cleaning Up Large Projects
For projects with over 100 open issues, manual cleanup simply isn't practical. Close Issue lets AI prioritize and recommend closure candidates so you can focus your review time efficiently.
Make sure to set up exclude labels to protect important issues from being closed accidentally.
Combining with Create Issue and Rewrite Issue
Use all three Issue Run modes together to manage the full issue lifecycle.
- Create Issue to automatically detect new improvements
- Rewrite Issue to improve issue descriptions
- Close Issue to clean up stale issues
Running this cycle regularly keeps your repository's issues organized and up to date.
Things to Keep in Mind
Always Review the Results
Even when the AI recommends closing an issue, it may still need attention. This is especially important during your first run. Review the confidence scores and reasoning, and if everything checks out, gradually increase the inspection limit for future runs.
Set Up Exclude Labels in Advance
Tag long-lived issues or intentionally open issues with labels before running Close Issue. This prevents issues marked "discuss later" or "in progress" from being closed by mistake.
Write Access Required
Close Issue performs close operations on issues, so you'll need a GitHub account with write access to the target repository.
Summary
- Close Issue uses AI to analyze open issues and automatically close stale ones
- Control the scope with days threshold and exclude labels
- Results include confidence scores and AI reasoning for easy review
- Combine with Create Issue and Rewrite Issue for comprehensive issue management
Don't let stale issues pile up—use Close Issue to keep your repository clean and focused.
Get Started with DevLoop Runner
Auto-generate PRs from GitHub Issues. Let AI accelerate your development.