{"slug": "replace-with-pseudocode-md", "title": "replace-with-pseudocode.md", "summary": "Based on the provided text, this document is a set of instructions for a code rewriting task, not a standalone article with a factual summary. It describes a specific workflow for an AI agent (Claude) to replace selected lines of source code with pseudocode comments for active-recall practice, emphasizing that the original code must be completely deleted and not preserved. The instructions detail the precise level of abstraction required for the pseudocode and mandate a verification step to confirm the original lines are gone.", "body_md": "Claude Code reads the context: fork\nfrontmatter and isolates this task automatically; other agents do not. If you are not Claude, do this manually:\n- Delegate the rewrite to a subagent — pass it everything below this section (after the\n---\n) as the prompt, plus$1\nas the code reference - The subagent must run the Verify step below and report explicit confirmation that every original line in the selection is gone — without that confirmation, treat the edit as incomplete and request a re-check\n- After the subagent confirms, do NOT pull the loaded code back into your main context — the practice depends on the original being gone; the subagent's confirmation is your verification\nReplace $1\n(inclusive of starting/ending line numbers) with English pseudocode comments. Delete the original — only the pseudocode remains. I'll rewrite the code from the pseudocode as active-recall practice to build a core memory of the pattern, so the pseudocode must give me enough to rebuild the original — and no more. Leave room to think.\nOnly the lines in $1\nget rewritten as pseudocode. Code outside the selection (other functions, imports, surrounding structure) stays untouched. If the selection includes a signature, declaration, or class header, those get rewritten too — writing them from pseudocode is part of the core-memory practice.\n- Too literal — reads like a sentence-by-sentence translation of the syntax\n- Too abstract — I couldn't reconstruct the original from it\n- Right level — describes operations and their order in domain terms; leaves API, idiom, and syntax choices to me\n- Declaration shape — visibility (exported, public), kind (function, class, const), parameter roles and types with defaults, return type\n- Operations and their order — filter, then map, then sum\n- Control flow shape — loop, early return, branching condition\n- Data being transformed and where it comes from\n- Side effects — I/O, mutation, network calls\n- Names — use the role for variables, parameters, functions, and classes (\"a function that joins category hierarchies\" not\njoinCategoryHierarchy\n; \"the user list\" notusers\n) - Syntax markers — no\n.filter(...)\n, nofor x in y\n, no=>\n- Use the language's native comment syntax (\n//\n,#\n,--\n,/* */\n) - One comment per logical step — group related lines under a single comment that describes their joint intent\n- Preserve the original indentation so the block's shape is recognizable\n- \"Keep the original code commented out so it's not lost.\" → Defeats active recall; git history has the original\n- \"More detail makes the pseudocode easier to rewrite from.\" → Defeats active recall; if I don't have to think, I don't learn\nBefore reporting the edit complete, confirm every original line in the selection is gone:\n- Inclusive endpoints — both the start and end lines of the range must be replaced\n- Check by content, not by post-edit position — line numbers shift after the edit; the original end line might no longer exist or land elsewhere\n- Do not treat surrounding block structure as permission to preserve a line inside the selection — closing braces, dedent lines, the closing tag of a multi-line element inside the range still get replaced\n- Required state: every original source line from the requested range is absent from the modified file", "url": "https://wpnews.pro/news/replace-with-pseudocode-md", "canonical_source": "https://gist.github.com/tom-rigelblu/135dbba2b5700cb9b38b954767792d2c", "published_at": "2026-05-23 15:52:52+00:00", "updated_at": "2026-05-24 04:04:35.416802+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "artificial-intelligence"], "entities": ["Claude Code"], "alternates": {"html": "https://wpnews.pro/news/replace-with-pseudocode-md", "markdown": "https://wpnews.pro/news/replace-with-pseudocode-md.md", "text": "https://wpnews.pro/news/replace-with-pseudocode-md.txt", "jsonld": "https://wpnews.pro/news/replace-with-pseudocode-md.jsonld"}}