AI Prompts for Identifying Deprecated API Usage

20 of the best prompts for identifying deprecated API usage, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.

AI Prompts for Identifying Deprecated API Usage

20 of the best prompts for identifying deprecated API usage, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.

Scroll to explore

Published June 28, 2026

Using deprecated library methods or APIs can lead to future failures when these features are removed or changed. This can cause unexpected behavior or crashes in your application. These prompts help developers identify and replace deprecated features to ensure compatibility and stability. This guide walks you through every stage of Identifying Deprecated API Usage, from Diagnose the Wall all the way through Prevent Recurrence, with a curated, copy-ready prompt at each step. Each stage targets a specific phase of the process so you always know exactly what to ask and what output to expect. Works with ChatGPT, Claude, and Gemini and any other major AI tool.

Diagnose the Wall

Identify any deprecated methods, APIs, or language features in use.

Check for Deprecated Methods

Please scan the codebase for any deprecated methods or APIs. Identify all occurrences and provide their specific locations within the code. Additionally, include a brief description of each deprecated method or API, explaining why it is considered deprecated and any recommended alternatives or updates that should be made. Format the output as a detailed report that can be easily referenced for future code maintenance.

Diagnose the Wall

Identify Language Features

Analyze the following code for any deprecated language features. Please identify each deprecated feature, specify the line numbers where they are used, and provide a brief explanation of why each feature is considered deprecated. Additionally, suggest modern alternatives that can be used in place of these deprecated features to ensure the code is up-to-date and compliant with current standards.

Diagnose the Wall

Review Library Versions

Please review the versions of libraries currently in use in my project. Identify any libraries that are outdated or deprecated, and provide recommendations for updated versions or alternatives. Include details on the potential impact of continuing to use these outdated libraries, such as security vulnerabilities or compatibility issues. Format your findings in a clear, structured list, highlighting the library name, current version, recommended version, and a brief explanation for each recommendation.

Diagnose the Wall

List Deprecated Warnings

Please run the following code: [INSERT CODE HERE] and capture any warnings related to deprecated features that arise during execution. Summarize these warnings by detailing the specific deprecated features mentioned, their potential impact on the code's functionality, and any suggested alternatives or updates that should be considered. Format the summary in a clear, organized manner, highlighting the key points for easy reference.

Diagnose the Wall

Examine CLAUDE.md Rules

Please examine the contents of my CLAUDE.md file, which I will provide: [PASTE CONTENT]. Identify any rules that specifically address deprecated features and assess whether they are being followed correctly. Additionally, provide recommendations for any areas that may need updating or clarification to ensure compliance with current standards. Summarize your findings in a structured format, highlighting key points and suggested actions.

Diagnose the Wall

Isolate and Fix

Focus on replacing deprecated features with current alternatives.

Replace Deprecated Methods

Identify all deprecated methods in the provided code snippet. For each deprecated method, suggest a modern alternative that achieves the same functionality. Additionally, update the code to replace the deprecated methods with the recommended alternatives, ensuring that the new code maintains the same logic and structure as the original. Please provide the updated code along with brief explanations for each change made.

Isolate and Fix

Update Language Features

Please review the following code snippet and identify any deprecated language features that need to be updated. Provide a detailed list of the changes required, specifying the deprecated features and their supported alternatives. Additionally, rewrite the code with the necessary modifications to ensure it adheres to current language standards. Include comments in the code to explain each change made for clarity.

Isolate and Fix

Upgrade Library Versions

Please update the libraries in my project to their latest stable versions. After updating, review the code for any breaking changes that may have occurred due to the updates. Provide a detailed list of the changes made, including any modifications to the code that were necessary to ensure compatibility with the new library versions. Additionally, include any recommendations for further improvements or optimizations that could enhance the overall performance of the project.

Isolate and Fix

Refactor Deprecated APIs

Refactor the following code to eliminate any usage of deprecated APIs and ensure it adheres to current API practices. Please provide a detailed explanation of the changes made, including the specific deprecated APIs that were removed and the new APIs that have been integrated. Additionally, include comments in the code to clarify the rationale behind each change and how it improves functionality or performance. The final output should be clean, well-structured code that follows best practices for modern API usage.

Isolate and Fix

Align with CLAUDE.md

Please review the code changes made in the project and ensure that they comply with the guidelines outlined in the CLAUDE.md document regarding deprecated features. Identify any instances where deprecated features are still being used and provide specific recommendations for how to update or replace them. Additionally, summarize the key rules from CLAUDE.md that are relevant to the current codebase, and suggest best practices for maintaining compliance in future code updates. Format your response as a detailed report that can be easily referenced by the development team.

Isolate and Fix

Verify the Resolution

Ensure all deprecated features have been successfully replaced and the code functions correctly.

Run Tests for Deprecated Replacements

Please execute the test suite for the project to ensure that all deprecated features have been successfully replaced with their new counterparts. Provide a detailed report on any errors or issues encountered during the testing process. Additionally, include a summary of which deprecated features were replaced, the new implementations, and any potential impacts on existing functionality. The report should be structured with clear sections for errors, replacements, and overall test results.

Verify the Resolution

Check for New Warnings

Please re-run the code for [PROJECT NAME] and check for any new warnings related to deprecated features. If any warnings appear, provide a detailed explanation of each warning, including the specific deprecated feature involved and suggestions for how to resolve or update the code to eliminate these warnings. Additionally, summarize the overall status of the code after the re-run, indicating whether it is functioning as expected without any deprecated feature warnings.

Verify the Resolution

Confirm Library Compatibility

Please verify the compatibility of the updated libraries with the current codebase. Provide a detailed analysis of any potential issues that may arise during integration, including specific functions or features that may not work as expected. Additionally, outline the steps that should be taken to ensure a smooth transition, and suggest any necessary modifications to the codebase to accommodate the updated libraries. Include examples of how to test the libraries in the current environment to confirm their functionality.

Verify the Resolution

Validate CLAUDE.md Compliance

Please review the changes made to the project and confirm that they comply with the updated CLAUDE.md rules regarding deprecated features. Provide a detailed analysis of each change, highlighting any areas that do not meet the compliance standards. Additionally, summarize the implications of any non-compliant changes and suggest necessary modifications to ensure full adherence to the CLAUDE.md guidelines. Format your response as a compliance report, including sections for compliant changes, non-compliant changes, and recommendations for improvement.

Verify the Resolution

Review Code Changes

Please review the following code changes made to address deprecated features in the project. Summarize the specific changes implemented, including any functions or libraries that were updated or replaced. Assess the effectiveness of these changes by evaluating whether the deprecated features have been successfully removed and if the new implementations maintain the intended functionality. Additionally, provide any recommendations for further improvements or potential issues that may arise from these changes.

Verify the Resolution

Prevent Recurrence

Create artefacts to ensure future code does not use deprecated features.

Create CLAUDE.md Rule

Please draft a new rule for the CLAUDE.md documentation that addresses the prevention of using deprecated methods in future code. The rule should include a clear definition of what constitutes a deprecated method, the reasons for avoiding them, and the potential impacts on code quality and maintainability. Additionally, provide examples of common deprecated methods and suggest alternative approaches or methods that should be used instead. Format the rule in a clear, structured manner suitable for inclusion in the documentation.

Prevent Recurrence

Add Code Comments

Please review the following codebase and insert detailed comments explaining the rationale behind the replacement of certain features. For each feature that has been replaced, provide a brief description of the original functionality, the reason for its replacement, and the preferred alternative that should be used instead. Ensure that the comments are clear and concise, making it easy for future developers to understand the changes. Aim for a thorough explanation for each significant change, and format the comments in a way that aligns with the existing coding standards in the project.

Prevent Recurrence

Develop a Naming Convention

Please propose a comprehensive naming convention for deprecated features within our codebase. The convention should include guidelines on how to label deprecated functions, classes, and variables to ensure they are easily identifiable. Additionally, outline a strategy for versioning these features and suggest a clear process for replacing them in future updates. Include examples of naming formats and explain how this convention can help maintain code quality and facilitate easier transitions during updates.

Prevent Recurrence

Design a Session-Opener Checklist

Please create a comprehensive checklist to use at the beginning of each coding session aimed at preventing the introduction of deprecated features. The checklist should include specific steps such as reviewing the current version of the API documentation, identifying any deprecated methods or classes, and ensuring that all team members are aware of the latest coding standards. Additionally, include a section for verifying that all dependencies are up to date and that there is a plan for addressing any deprecated features that may still be in the codebase. Format the checklist in a clear and organized manner, suitable for easy reference during coding sessions.

Prevent Recurrence

Establish a Project Guard

Create a project guard that automatically identifies and flags any deprecated features during code reviews. The guard should analyze the codebase for deprecated APIs and provide a clear report highlighting the specific lines of code that need attention. Additionally, include recommendations for alternative features or APIs that can be used instead. Ensure that the guard integrates seamlessly into the existing code review process and provides notifications to the development team when deprecated features are detected.

Prevent Recurrence

Frequently asked questions

How can I identify deprecated APIs in my code?+

Claude Code can scan your codebase to identify deprecated APIs by analyzing the code and library versions. It provides a list of deprecated features and their locations.

What should I do after finding deprecated methods?+

Use Claude Code to suggest modern alternatives and update your code accordingly. It can also help verify that changes do not introduce new issues.

How do I ensure my libraries are up-to-date?+

Claude Code can check the versions of libraries in use and suggest updates to the latest stable versions, ensuring compatibility with your codebase.

Can Claude Code help prevent future deprecated usage?+

Yes, Claude Code can help create rules in CLAUDE.md and other artefacts to prevent the introduction of deprecated features in future code.

What if my code still uses deprecated features after changes?+

Re-run the diagnostic prompts to ensure all deprecated features are identified and replaced. Claude Code can assist in verifying that no deprecated features remain.