{"id":19,"date":"2026-03-27T09:40:22","date_gmt":"2026-03-27T16:40:22","guid":{"rendered":"https:\/\/pyyk.ai\/?p=19"},"modified":"2026-03-27T09:40:22","modified_gmt":"2026-03-27T16:40:22","slug":"inline-prompting","status":"publish","type":"post","link":"https:\/\/pyyk.ai\/?p=19","title":{"rendered":"Inline Prompting"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hustle &amp; Flow<\/h2>\n\n\n\n<p>Put <strong>@prompt<\/strong> in the source file instead of <strong>@file<\/strong> in the prompt dialog.<\/p>\n\n\n\n<p>That is the simple premise behind inline prompting, so that interacting with AI integrates with rather than disrupts my existing workflows.  In most applications AI feels bolted on.  Awkward.  Intrusive.<\/p>\n\n\n\n<p>I\u2019m old school, my \u201cIDE\u201d is emacs in one half of a split screen terminal window and bash in the other.&nbsp; That is the most productive development environment for me.&nbsp; Anything that pulls me away from the keyboard and looking at the code slows me down, whether it is navigating to a separate app, picking a menu item, or typing text in a dialog box.&nbsp; Inline prompting allows me to write prompts for the coding agent inside the work product itself and stay in flow, then execute all inline prompts with a single command or keystroke.<\/p>\n\n\n\n<div style=\"height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ - inline prompts looks like the following:\n\/\/\n\/\/ @codex\n\/\/ - implement this method to reverse the elements of a vector\nvector&lt;string> &amp;Foo::reverse(vector&lt;string> &amp;in) {\n  \/\/ - the coding agent fills in the body of the method, not shown here\n}<\/pre>\n\n\n\n<p>Given that I live in <strong>emacs<\/strong> and <strong>bash<\/strong>, shell scripts were the natural choice to implement processing of inline prompts.&nbsp; I can execute from the <strong>bash<\/strong> terminal, or bind to a expression in emacs, and bind the expression to a key sequence.<\/p>\n\n\n\n<div style=\"height:0px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#!\/usr\/bin\/bash\n\nset -euo pipefail\n\n# - omitted for brevity, other shell commands could be executed here and\n#   results used in constructing the prompt below\n# - ditto for command line arguments, especially useful for passing context\n#   from the IDE\n\ncodex exec -m gpt-5-codex --sandbox workspace-write &lt;&lt;'EOF'\n- find source files in this repository with the tag @codex in comments\n- the comments following the @codex tags are instructions for you\n- instructions end with the comment block or tag @end\n- generate a session timestamp at the beginning of each session in the form\n  YYYY-MM-DD HH:mm\n- after you make modifications related to a particular @codex tag,\n  add the session timestamp after the @codex tag\n- only update for @codex tags without revision timestamps; those with\n  revision timestamps are from previous sessions\n- record the revision timestamp in the comment block marked @revision\n  with one revision per line with a brief summary of the revisions\n- comment code copiously for human review, in particular any block\n  larger than a dozen lines\n- mark your changes with a @review tag with the session timestamp\n- src\/template.h and src\/template.c are provided as style guides and should be followed\n  especially when adding new source files, classes, methods, functions, or\n  variables; these templates should also be used in refactoring when\n  moving methods etc.\nEOF<\/pre>\n\n\n\n<p>While I edit code in emacs, I do love the visual debuggers in IDEs over <strong>gdb<\/strong> and <strong>lldb<\/strong> and use CLion for its cross platform support.&nbsp; I can\u2019t speak to all IDEs, but CLion allows easy integration of shell scripts as <strong>External Tools<\/strong> with macros like <strong>$FilePath$<\/strong> to pass IDE context to the shell script.&nbsp; Many of the other apps and IDEs I peeked at supported customizations, but felt klunky and bolted on and less powerful, flexible, and portable than simple shell scripts.<\/p>\n\n\n\n<div class=\"wp-block-group has-global-padding is-layout-constrained wp-block-group-is-layout-constrained\">\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"844\" src=\"https:\/\/pyyk.ai\/wp-content\/uploads\/2026\/03\/CLion-REPL-Code-1-1024x844.png\" alt=\"\" class=\"wp-image-48\" srcset=\"https:\/\/pyyk.ai\/wp-content\/uploads\/2026\/03\/CLion-REPL-Code-1-1024x844.png 1024w, https:\/\/pyyk.ai\/wp-content\/uploads\/2026\/03\/CLion-REPL-Code-1-300x247.png 300w, https:\/\/pyyk.ai\/wp-content\/uploads\/2026\/03\/CLion-REPL-Code-1-768x633.png 768w, https:\/\/pyyk.ai\/wp-content\/uploads\/2026\/03\/CLion-REPL-Code-1-1536x1265.png 1536w, https:\/\/pyyk.ai\/wp-content\/uploads\/2026\/03\/CLion-REPL-Code-1-2048x1687.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Integrating shell scripts in CLion IDE is straightforward.<\/figcaption><\/figure>\n<\/div>\n\n\n\n<p>Inline prompting leverages existing models for this interaction, using <strong>@mentions<\/strong> to mark prompts (and I used several in addition to <strong>@codex<\/strong>: for instance, <strong>@doxy<\/strong>, <strong>@review<\/strong> and <strong>@refactor<\/strong>), and can leverage <strong>#hashtags<\/strong> or other markup as prompting shorthand (for example, there could be <strong>#hashtags<\/strong> for common <strong>@refactor<\/strong>ing tasks like <strong>#rename<\/strong>).&nbsp; Inline prompting also follows tools like <strong>doxygen<\/strong> by putting all the meta text in code comments.&nbsp; It\u2019s old wine in new bottles, having coding agents adopt existing patterns rather than inventing.<\/p>\n\n\n\n<p>The way AI and coding agents are implemented in some user interfaces is so intrusive that it becomes a distraction and I turn off AI features wholesale.&nbsp; I want a relationship modelled after the one an author might have with an editor \u2014 instead of hovering <em>annoyingly <\/em>over my shoulder during the creative process, interrupting me every few minutes with yet another unwelcome suggestion, let\u2019s communicate via mark up text in the \u201cmargins\u201d of the document.&nbsp; Without going into detail, I also believe inline prompting is a superior model for other disciplines \u2014 think of how interaction with a human reviewer would be structured, and model AI interaction after <em>that<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">REPL Coding<\/h2>\n\n\n\n<p>At scale software engineering is an iterative process, and the majority of the work is iterative refinement of <em>existing code<\/em> to modify, extend, or correct existing functionality.&nbsp; Iterations have become progressively tighter from the era of waterfall, through the age of Agile, to Continuous Delivery and Deployment (CI\/CD), and onto today\u2019s coding agents.&nbsp; In essence, a software engineer is iterating in what is classically termed a read-eval-print-loop (REPL) with a coding agent as a pair programming bot.<\/p>\n\n\n\n<p>Inline prompting streamlines REPL and permits precision control, targeting, and scoping by colocating coding agent prompts with code.&nbsp; It better supports co-mingling hand crafted and generated code.&nbsp; The prompts can also remain as artifacts in the code and solve a common question and complaint, what prompts were used to generate this code?&nbsp; As a matter of housekeeping I do clean up older inline prompts knowing I can always find them again in revision history.&nbsp; I also prompt the coding agent to add a <strong>@revision<\/strong> tag with a timestamp and brief comment on change to a source file.<\/p>\n\n\n\n<p>Over time the set of scripts will become fine tuned for the most common tasks, customized and optimized for specific workflows, with prompting compacted into specialized <strong>@tags<\/strong> and markup elements, making for efficient interaction with a coding agent as a pair programming bot.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">In Conclusion<\/h2>\n\n\n\n<p>It\u2019s a pretty simple idea.&nbsp; Put prompts inline with the source code.&nbsp; Use a shell script to process the inline prompts.&nbsp; Integrate the shell scripts with your editor or IDE.&nbsp; Or just run from a shell.&nbsp; It was born of frustration with the friction of interacting with coding agents and wanting to keep my workflow streamlined.<\/p>\n\n\n\n<p>I put some sample scripts and source code in a github repo called <a href=\"https:\/\/github.com\/Pykkai\/REPLcode\">REPLcode<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hustle &amp; Flow Put @prompt in the source file instead of @file in the prompt dialog. That is the simple premise behind inline prompting, so that interacting with AI integrates with rather than disrupts my existing workflows. In most applications AI feels bolted on. Awkward. Intrusive. I\u2019m old school, my \u201cIDE\u201d is emacs in one [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-engineering"],"_links":{"self":[{"href":"https:\/\/pyyk.ai\/index.php?rest_route=\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pyyk.ai\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pyyk.ai\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pyyk.ai\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pyyk.ai\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19"}],"version-history":[{"count":16,"href":"https:\/\/pyyk.ai\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions"}],"predecessor-version":[{"id":56,"href":"https:\/\/pyyk.ai\/index.php?rest_route=\/wp\/v2\/posts\/19\/revisions\/56"}],"wp:attachment":[{"href":"https:\/\/pyyk.ai\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pyyk.ai\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pyyk.ai\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}