20 of the best prompts for resolving authentication breakage, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
20 of the best prompts for resolving authentication breakage, step by step across 4 stages. Works with ChatGPT, Claude, and Gemini.
Published June 28, 2026
Authentication failures disrupt user access and can lead to security vulnerabilities. This results in frustrated users and potential data breaches. These prompts help developers diagnose, fix, verify, and prevent authentication issues effectively. Built across 4 distinct stages covering Diagnose the Wall, Isolate and Fix, Verify the Resolution and more, this guide gives you one expert prompt per step so you never have to write from scratch or guess what the AI needs. The prompts work in ChatGPT, Claude, and Gemini and are designed to get usable output on the first try.
Focus on recent changes to authentication-related files and configurations.
Identify Recent Changes
Please identify and summarize all recent changes made to the authentication files. For each change, provide details on what was modified, including the specific lines of code or configuration settings that were altered. Highlight any changes that could potentially impact login processes or session management, and explain how they might affect user access or security. Format your response in a clear, organized manner, categorizing the changes by their potential impact.
Check CLAUDE.md Compliance
Please review the following CLAUDE.md file content: [PASTE CONTENT]. Analyze it for compliance with the established rules and identify any recent changes that may violate these rules. For each violation, specify the exact rule that is being broken and provide a brief explanation of how the change conflicts with the compliance requirements. Summarize your findings in a clear and organized format.
Review Error Logs
Please review the error logs for authentication-related issues and summarize the findings. Focus on the most recent errors, highlighting their frequency and any patterns that may indicate underlying problems. Include specific error codes, timestamps, and descriptions of each error, as well as potential causes and recommended actions to resolve these issues. Format the summary in a clear, organized manner, with bullet points for easy reference.
Analyze Session Management
Please analyze the session management code for [APPLICATION NAME] and identify any anomalies or recent changes that may affect its functionality. Focus on potential issues that could disrupt session handling, such as security vulnerabilities, improper session expiration, or inconsistencies in session state management. Provide a detailed report highlighting the findings, including specific lines of code that may need attention, recommendations for improvements, and best practices for secure session management.
Inspect Auth Flow
Please trace the authentication flow starting from the login process through to session creation for the application. Identify and highlight any deviations from the expected flow that could potentially lead to issues or vulnerabilities. Provide a detailed analysis of each step in the flow, including the expected behavior and any discrepancies you find. Additionally, suggest possible solutions or improvements to address any identified issues.
Focus on correcting the specific change that caused the authentication failure.
Revert Problematic Change
Identify the specific change that is causing the issue described by the following error: [PASTE ERROR]. Once identified, provide a detailed explanation of why this change led to the problem. Additionally, revert the change and outline the steps taken to ensure that the issue does not occur again in the future. Include any relevant code snippets or configurations that were affected by this change.
Correct Configurations
Identify any incorrect configurations in the authentication setup for [SYSTEM/APPLICATION NAME]. Provide a detailed analysis of each identified issue, including the specific configuration that is incorrect and the rationale behind its correction. For each correction made, explain the potential impact on the overall security and functionality of the authentication process. Format your response as a structured report, listing each issue, the correction, and the impact in separate sections for clarity.
Fix Session Handling
Please review the session handling code provided below for any potential issues. Identify specific problems related to session management, such as session expiration, data persistence, and security vulnerabilities. After pinpointing the issues, suggest detailed adjustments or improvements to ensure that sessions are handled correctly and securely. Additionally, provide a brief explanation of the changes made and how they enhance the overall session management process. Here is the session handling code: [INSERT CODE HERE].
Adjust Auth Logic
Please analyze the authentication process for [APPLICATION NAME] and identify any logical errors that may exist. For each error you find, provide a detailed explanation of the issue and suggest a correction. Additionally, include a rationale for each change, explaining why it improves the authentication logic and enhances security. Format your response in a clear, structured manner, outlining the original logic, the identified error, the proposed fix, and the reasoning behind each adjustment.
Restore Auth Flow
Please restore the authentication flow to its correct state for the application. Detail the specific changes you made to fix any issues, including the code modifications, configuration adjustments, and any relevant dependencies that were updated. Additionally, explain how these changes ensure that the authentication process functions as intended, and provide examples of how to test the flow to confirm it is working properly.
Ensure that the authentication process is functioning correctly after the fix.
Run Auth Tests
Please run a comprehensive set of authentication tests for the system. Include tests for various scenarios such as successful logins, failed logins, password resets, and account lockouts. After executing the tests, provide a detailed report of the results, indicating which tests passed and which, if any, failed. Additionally, confirm that all critical authentication functionalities are working as expected and summarize any issues encountered during the testing process.
Simulate User Login
Please simulate a user login process for an application. The login should include the following steps: entering a username and password, validating the credentials, and creating a user session upon successful authentication. Confirm that the entire process completes without errors and provide a detailed output of each step, including any relevant messages or status codes. Additionally, include a summary of the session details created during this process.
Check Error Logs Again
Please review the error logs after the recent fix. I need you to confirm that there are no new authentication-related errors present. If any errors are found, provide a summary of the error messages, including their frequency and any relevant details that could help in diagnosing the issue. Additionally, compare the current logs with the previous ones to identify any changes or patterns that may indicate ongoing problems.
Validate Session Management
Please validate the session management functionality for the application. Provide a detailed report that includes evidence of session creation, maintenance, and termination processes. Include information on session timeouts, any potential vulnerabilities, and how sessions are handled during user interactions. Additionally, outline the expected behavior for both successful and unsuccessful session management scenarios, and suggest improvements if any issues are identified.
Confirm Auth Flow
Please reproduce the original scenario that caused the authentication issue. Confirm whether the authentication flow now works correctly by detailing the steps taken and the results observed. Include a comparison of the before and after states, highlighting any changes made to resolve the issue. Provide specific examples of inputs used and the corresponding outputs to illustrate the functionality.
Implement measures to prevent future authentication issues.
Create CLAUDE.md Rule
Please draft a new rule for the CLAUDE.md documentation that addresses recent authentication issues. The rule should clearly outline the specific measures to be taken to prevent similar problems from occurring in the future. Include detailed instructions on implementation, any relevant examples, and the rationale behind these measures. Ensure that the text is concise yet comprehensive, suitable for inclusion in the documentation, and formatted for clarity.
Add Code Comment
Please insert a comment above the fixed authentication function in the code. The comment should clearly state the specific constraint that must not be violated, which is: '[INSERT SPECIFIC CONSTRAINT HERE]'. Ensure that the comment is concise yet informative, so that any developer or AI assistant reviewing the code understands the importance of adhering to this constraint. Format the comment in a way that follows standard coding practices for readability.
Develop Auth Checklist
Create a comprehensive checklist for initiating any session that involves changes to authentication processes. The checklist should include key steps such as verifying current authentication methods, assessing potential security risks, ensuring all stakeholders are informed, and documenting changes made. Additionally, include a section for reviewing past authentication issues to prevent recurrence and a final step for confirming that all changes have been tested and validated. Format the checklist in a clear, actionable manner with bullet points for easy reference.
Draft Session Guidelines
Draft a comprehensive guideline document outlining best practices for session management in web applications. Include sections on secure session creation, session expiration policies, and techniques for preventing session hijacking. Discuss the importance of using secure cookies, implementing proper session timeouts, and the role of HTTPS in protecting session data. Additionally, provide examples of common vulnerabilities and how to mitigate them. Format the document with clear headings and bullet points for easy readability.
Establish Auth Flow Protocol
Please define a detailed protocol for modifying the authentication flow in a system. The protocol should include specific steps for verifying that any changes made do not disrupt the existing flow. Include considerations for testing the modifications, documenting the changes, and ensuring compliance with security standards. Additionally, outline how to communicate these changes to relevant stakeholders and any rollback procedures in case of issues. Format the protocol as a structured document that can be easily referenced.
Claude Code may have introduced changes that conflict with existing authentication logic. Review recent changes and ensure they comply with your CLAUDE.md rules.
Use Claude Code to verify session management code for errors. Implement a checklist to guide future session handling changes and prevent issues.
Break down tasks into smaller, manageable parts and use CLAUDE.md to enforce rules. This helps maintain context and prevent errors.
Define strict rules in CLAUDE.md and regularly review changes made by Claude Code. This ensures adherence to project guidelines.
Keep CLAUDE.md updated with clear, concise rules. Use it to enforce coding standards and prevent errors during autonomous operations.
AI Prompts for Fixing Broken Tests After Changes
Code changes can break previously passing tests, causing unexpected failures.
See promptsAI Prompts for Ensuring Consistent API Contracts
When Claude Code changes a function signature or module export without updating all references, it breaks the API contract.
See promptsAI Prompts for Fixing Mobile Responsiveness Issues
Mobile responsiveness issues occur when styles or layout code work on desktop but break on mobile.
See prompts