diff --git a/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java b/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java
index a28bf8bba96..b14a3002e0b 100644
--- a/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java
+++ b/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java
@@ -701,6 +701,30 @@ private String getTrimmedPoppedStateContents(State state) {
* a non-null, non-empty string, allowing for empty placeholders to be
* added that don't affect the resulting layout of the code.
*
+ *
{@code
+ * CodeWriter writer = new CodeWriter();
+ *
+ * // Prepend text to a section named "foo".
+ * writer.onSectionPrepend("foo", () -> writer.write("A"));
+ *
+ * // Write text to a section, and ensure that the original
+ * // text is written too.
+ * writer.onSection("foo", text -> {
+ * // Write the original text of the section.
+ * writer.write(text);
+ * // Write more text to the section.
+ * writer.write("C");
+ * });
+ *
+ * // Append text to a section.
+ * writer.onSectionAppend("foo", () -> writer.write("D"));
+ *
+ * // Create the section, write to it, then close the section.
+ * writer.pushState("foo").write("B").popState();
+ *
+ * assert(writer.toString().equals("A\nB\nC\nD\n"));
+ * }
+ *
* @param sectionName The name of the section to intercept.
* @param interceptor The function to intercept with.
* @return Returns the CodeWriter.
@@ -710,6 +734,48 @@ public CodeWriter onSection(String sectionName, Consumer