diff --git a/.changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json b/.changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json
new file mode 100644
index 00000000000..ec9e2006859
--- /dev/null
+++ b/.changes/next-release/feature-d6e1bcfb-6d81-4b3a-af08-828ff10c02b1.json
@@ -0,0 +1,4 @@
+{
+ "type" : "feature",
+ "description" : "/doc: Add error message if updated README is too large"
+}
\ No newline at end of file
diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt
index fef49198881..e6389341cbd 100644
--- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt
+++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonqDoc/session/DocGenerationState.kt
@@ -179,6 +179,11 @@ private suspend fun DocGenerationState.generateCode(codeGenerationId: String, mo
),
-> docServiceError(message("amazonqDoc.exception.readme_too_large"))
+ codeGenerationResultState.codeGenerationStatusDetail()?.contains(
+ "README_UPDATE_TOO_LARGE"
+ ),
+ -> docServiceError(message("amazonqDoc.exception.readme_update_too_large"))
+
codeGenerationResultState.codeGenerationStatusDetail()?.contains(
"WORKSPACE_TOO_LARGE"
),
diff --git a/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties b/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties
index 33dc4c99ec6..de50f6840db 100644
--- a/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties
+++ b/plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties
@@ -50,6 +50,7 @@ amazonqDoc.exception.no_change_required=I couldn't find any code changes to upda
amazonqDoc.exception.prompt_too_vague=I need more information to make changes to your README. Try providing some of the following details:\n- Which sections you want to modify\n- The content you want to add or remove\n- Specific issues that need correcting\n\nFor more information on prompt best practices, see the Amazon Q Developer documentation.
amazonqDoc.exception.prompt_unrelated=These changes don't seem related to documentation. Try describing your changes again, using the following best practices:\n- Changes should relate to how project functionality is reflected in the README\n- Content you refer to should be available in your codebase\n\nFor more information on prompt best practices, see the Amazon Q Developer documentation.
amazonqDoc.exception.readme_too_large=The README in your folder is too large for me to review. Try reducing the size of your README, or choose a folder with a smaller README. For more information on quotas, see the Amazon Q Developer documentation.
+amazonqDoc.exception.readme_update_too_large=The updated README is too large. Try reducing the size of your README, or asking for a smaller update. For more information on quotas, see the Amazon Q Developer documentation.
amazonqDoc.exception.workspace_empty=The folder you chose did not contain any source files in a supported language. Choose another folder and try again. For more information on supported languages, see the Amazon Q Developer documentation.
amazonqDoc.inprogress_message.generating=Generating documentation...
amazonqDoc.progress_message.baseline=This might take a few minutes.