mirror of
https://github.com/anthropics/claude-code.git
synced 2026-05-07 23:42:40 +00:00
Compare commits
8 Commits
bcherny-pa
...
ashwin/loc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02a77c5897 | ||
|
|
3262b673c3 | ||
|
|
369bd9b6d7 | ||
|
|
611956def4 | ||
|
|
a9f1fefbe9 | ||
|
|
3d5ef4e8c0 | ||
|
|
d967bbbe30 | ||
|
|
5faa082d6e |
19
.claude/commands/commit-push-pr.md
Normal file
19
.claude/commands/commit-push-pr.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
allowed-tools: Bash(git checkout --branch:*), Bash(git add:*), Bash(git status:*), Bash(git push:*), Bash(git commit:*), Bash(gh pr create:*)
|
||||||
|
description: Commit, push, and open a PR
|
||||||
|
---
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
- Current git status: !`git status`
|
||||||
|
- Current git diff (staged and unstaged changes): !`git diff HEAD`
|
||||||
|
- Current branch: !`git branch --show-current`
|
||||||
|
|
||||||
|
## Your task
|
||||||
|
|
||||||
|
Based on the above changes:
|
||||||
|
1. Create a new branch if on main
|
||||||
|
2. Create a single commit with an appropriate message
|
||||||
|
3. Push the branch to origin
|
||||||
|
4. Create a pull request using `gh pr create`
|
||||||
|
5. You have the capability to call multiple tools in a single response. You MUST do all of the above in a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.
|
||||||
@@ -30,6 +30,8 @@ Found 3 possible duplicate issues:
|
|||||||
|
|
||||||
If your issue is a duplicate, please close it and 👍 the existing issue instead.
|
If your issue is a duplicate, please close it and 👍 the existing issue instead.
|
||||||
|
|
||||||
|
<sub>This issue will be automatically closed as a duplicate in 3 days if there are no additional comments. To prevent auto-closure, please 👎 this comment.</sub>
|
||||||
|
|
||||||
🤖 Generated with [Claude Code](https://claude.ai/code)
|
🤖 Generated with [Claude Code](https://claude.ai/code)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
78
.github/workflows/auto-close-duplicates.yml
vendored
Normal file
78
.github/workflows/auto-close-duplicates.yml
vendored
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
name: Auto-close duplicate issues (DRY RUN)
|
||||||
|
description: Dry run - logs issues that would be auto-closed as duplicates after 3 days if no response
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 9 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-close-duplicates:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 10
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Auto-close duplicate issues
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const threeDaysAgo = new Date();
|
||||||
|
threeDaysAgo.setDate(threeDaysAgo.getDate() - 3);
|
||||||
|
|
||||||
|
// Get all open issues
|
||||||
|
const { data: issues } = await github.rest.issues.listForRepo({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
state: 'open',
|
||||||
|
per_page: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
for (const issue of issues) {
|
||||||
|
// Get comments for this issue
|
||||||
|
const { data: comments } = await github.rest.issues.listComments({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number
|
||||||
|
});
|
||||||
|
|
||||||
|
// Find duplicate comments (look for "Found 1 possible duplicate" or "Found X possible duplicate")
|
||||||
|
const dupeComments = comments.filter(comment =>
|
||||||
|
comment.body.includes('Found') &&
|
||||||
|
comment.body.includes('possible duplicate') &&
|
||||||
|
comment.user.type === 'Bot'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (dupeComments.length === 0) continue;
|
||||||
|
|
||||||
|
// Get the most recent duplicate comment
|
||||||
|
const lastDupeComment = dupeComments[dupeComments.length - 1];
|
||||||
|
const dupeCommentDate = new Date(lastDupeComment.created_at);
|
||||||
|
|
||||||
|
// Check if the duplicate comment is 3+ days old
|
||||||
|
if (dupeCommentDate > threeDaysAgo) continue;
|
||||||
|
|
||||||
|
// Check if there are any comments after the duplicate comment
|
||||||
|
const commentsAfterDupe = comments.filter(comment =>
|
||||||
|
new Date(comment.created_at) > dupeCommentDate
|
||||||
|
);
|
||||||
|
|
||||||
|
if (commentsAfterDupe.length > 0) continue;
|
||||||
|
|
||||||
|
// Check if issue author reacted with thumbs down to the duplicate comment
|
||||||
|
const { data: reactions } = await github.rest.reactions.listForIssueComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
comment_id: lastDupeComment.id
|
||||||
|
});
|
||||||
|
|
||||||
|
const authorThumbsDown = reactions.some(reaction =>
|
||||||
|
reaction.user.id === issue.user.id && reaction.content === '-1'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (authorThumbsDown) continue;
|
||||||
|
|
||||||
|
// DRY RUN: Log the issue that would be auto-closed
|
||||||
|
const issueUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/issues/${issue.number}`;
|
||||||
|
console.log(`[DRY RUN] Would auto-close issue #${issue.number} as duplicate: ${issueUrl}`);
|
||||||
|
}
|
||||||
85
.github/workflows/lock-closed-issues.yml
vendored
85
.github/workflows/lock-closed-issues.yml
vendored
@@ -13,16 +13,81 @@ concurrency:
|
|||||||
group: lock-threads
|
group: lock-threads
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lock-threads:
|
lock-closed-issues:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 10
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/lock-threads@1bf7ec25051fe7c00bdd17e6a7cf3d7bfb7dc771 # v5.0.1
|
- name: Lock closed issues after 7 days of inactivity
|
||||||
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
issue-inactive-days: "7"
|
script: |
|
||||||
process-only: "issues"
|
const sevenDaysAgo = new Date();
|
||||||
log-output: true
|
sevenDaysAgo.setDate(sevenDaysAgo.getDate() - 7);
|
||||||
issue-comment: >
|
|
||||||
This issue has been automatically locked since it was
|
const lockComment = `This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.`;
|
||||||
closed and has not had any activity for 7 days.
|
|
||||||
If you're experiencing a similar issue, please file a new issue
|
let page = 1;
|
||||||
and reference this one if it's relevant.
|
let hasMore = true;
|
||||||
|
let totalLocked = 0;
|
||||||
|
|
||||||
|
while (hasMore) {
|
||||||
|
// Get closed issues (pagination)
|
||||||
|
const { data: issues } = await github.rest.issues.listForRepo({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
state: 'closed',
|
||||||
|
sort: 'updated',
|
||||||
|
direction: 'asc',
|
||||||
|
per_page: 100,
|
||||||
|
page: page
|
||||||
|
});
|
||||||
|
|
||||||
|
if (issues.length === 0) {
|
||||||
|
hasMore = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const issue of issues) {
|
||||||
|
// Skip if already locked
|
||||||
|
if (issue.locked) continue;
|
||||||
|
|
||||||
|
// Skip pull requests
|
||||||
|
if (issue.pull_request) continue;
|
||||||
|
|
||||||
|
// Check if updated more than 7 days ago
|
||||||
|
const updatedAt = new Date(issue.updated_at);
|
||||||
|
if (updatedAt > sevenDaysAgo) {
|
||||||
|
// Since issues are sorted by updated_at ascending,
|
||||||
|
// once we hit a recent issue, all remaining will be recent too
|
||||||
|
hasMore = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Add comment before locking
|
||||||
|
await github.rest.issues.createComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
body: lockComment
|
||||||
|
});
|
||||||
|
|
||||||
|
// Lock the issue
|
||||||
|
await github.rest.issues.lock({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: issue.number,
|
||||||
|
lock_reason: 'resolved'
|
||||||
|
});
|
||||||
|
|
||||||
|
totalLocked++;
|
||||||
|
console.log(`Locked issue #${issue.number}: ${issue.title}`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Failed to lock issue #${issue.number}: ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
page++;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Total issues locked: ${totalLocked}`);
|
||||||
|
|||||||
25
CHANGELOG.md
25
CHANGELOG.md
@@ -1,5 +1,30 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 1.0.70
|
||||||
|
|
||||||
|
- Performance: Optimized message rendering for better performance with large contexts
|
||||||
|
- Windows: Fixed native file search, ripgrep, and subagent functionality
|
||||||
|
- Added support for @-mentions in slash command arguments
|
||||||
|
|
||||||
|
## 1.0.69
|
||||||
|
|
||||||
|
- Upgraded Opus to version 4.1
|
||||||
|
|
||||||
|
## 1.0.68
|
||||||
|
|
||||||
|
- Fix incorrect model names being used for certain commands like `/pr-comments`
|
||||||
|
- Windows: improve permissions checks for allow / deny tools and project trust. This may create a new project entry in `.claude.json` - manually merge the history field if desired.
|
||||||
|
- Windows: improve sub-process spawning to eliminate "No such file or directory" when running commands like pnpm
|
||||||
|
- Enhanced /doctor command with CLAUDE.md and MCP tool context for self-serve debugging
|
||||||
|
- SDK: Added canUseTool callback support for tool confirmation
|
||||||
|
- Added `disableAllHooks` setting
|
||||||
|
- Improved file suggestions performance in large repos
|
||||||
|
|
||||||
|
## 1.0.65
|
||||||
|
|
||||||
|
- IDE: Fixed connection stability issues and error handling for diagnostics
|
||||||
|
- Windows: Fixed shell environment setup for users without .bashrc files
|
||||||
|
|
||||||
## 1.0.64
|
## 1.0.64
|
||||||
|
|
||||||
- Agents: Added model customization support - you can now specify which model an agent should use
|
- Agents: Added model customization support - you can now specify which model an agent should use
|
||||||
|
|||||||
Reference in New Issue
Block a user