@iaforged/context-code 1.0.77 → 1.0.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +68 -68
  2. package/cli.js +8515 -8515
  3. package/context-bootstrap.js +27 -27
  4. package/dist/src/bootstrap/state.js +3 -0
  5. package/dist/src/bridge/bridgeMain.js +40 -40
  6. package/dist/src/cli/print.js +12 -12
  7. package/dist/src/commands/agent/agent.js +8 -0
  8. package/dist/src/commands/commit-push-pr.js +55 -55
  9. package/dist/src/commands/createMovedToPluginCommand.js +9 -9
  10. package/dist/src/commands/init-verifiers.js +238 -238
  11. package/dist/src/commands/init.js +216 -216
  12. package/dist/src/commands/install.js +2 -2
  13. package/dist/src/commands/login/login.js +24 -10
  14. package/dist/src/commands/orchestrate/index.js +1 -1
  15. package/dist/src/commands/orchestrate/orchestrate.js +110 -24
  16. package/dist/src/commands/profile/profile.js +15 -1
  17. package/dist/src/commands/provider/index.js +1 -1
  18. package/dist/src/commands/provider/provider.js +34 -1
  19. package/dist/src/commands/review.js +22 -22
  20. package/dist/src/commands/run/index.js +2 -2
  21. package/dist/src/commands/run/run.js +63 -61
  22. package/dist/src/commands/team/index.js +1 -1
  23. package/dist/src/commands/team/team.js +84 -76
  24. package/dist/src/commands/team-auto/teamAuto.js +89 -29
  25. package/dist/src/commands/terminalSetup/terminalSetup.js +24 -24
  26. package/dist/src/commands/usage/index.js +7 -0
  27. package/dist/src/commands/usage/usage.js +5 -0
  28. package/dist/src/commands/workspace/workspace.js +39 -31
  29. package/dist/src/commands.js +0 -2
  30. package/dist/src/components/ConsoleOAuthFlow.js +92 -14
  31. package/dist/src/components/ModelPicker.js +2 -0
  32. package/dist/src/components/agents/generateAgent.js +92 -92
  33. package/dist/src/components/grove/Grove.js +10 -10
  34. package/dist/src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.js +8 -8
  35. package/dist/src/constants/geminiOAuth.js +13 -0
  36. package/dist/src/constants/github-app.js +134 -134
  37. package/dist/src/constants/prompts.js +123 -123
  38. package/dist/src/coordinator/coordinatorMode.js +252 -252
  39. package/dist/src/hooks/useTypeahead.js +7 -7
  40. package/dist/src/ink/reconciler.js +7 -7
  41. package/dist/src/main.js +5 -5
  42. package/dist/src/memdir/findRelevantMemories.js +6 -6
  43. package/dist/src/services/MagicDocs/prompts.js +56 -56
  44. package/dist/src/services/PromptSuggestion/promptSuggestion.js +29 -29
  45. package/dist/src/services/SessionMemory/prompts.js +66 -66
  46. package/dist/src/services/api/openai.js +584 -21
  47. package/dist/src/services/limits/adapters/ollama.js +3 -3
  48. package/dist/src/services/oauth/geminiCli.js +107 -0
  49. package/dist/src/services/orchestration/execution/AgentTaskExecutor.js +5 -3
  50. package/dist/src/services/orchestration/execution/OrchestrationExecutionRuntime.js +18 -18
  51. package/dist/src/services/orchestration/global/reporting.js +2 -2
  52. package/dist/src/services/toolUseSummary/toolUseSummaryGenerator.js +9 -9
  53. package/dist/src/skills/bundled/batch.js +78 -78
  54. package/dist/src/skills/bundled/claudeApi.js +34 -34
  55. package/dist/src/skills/bundled/claudeInChrome.js +4 -4
  56. package/dist/src/skills/bundled/debug.js +36 -36
  57. package/dist/src/skills/bundled/scheduleRemoteAgents.js +151 -151
  58. package/dist/src/skills/bundled/skillify.js +132 -132
  59. package/dist/src/skills/bundled/stuck.js +53 -53
  60. package/dist/src/skills/bundled/updateConfig.js +418 -418
  61. package/dist/src/tasks/RemoteAgentTask/RemoteAgentTask.js +26 -26
  62. package/dist/src/tools/AgentTool/AgentTool.js +7 -7
  63. package/dist/src/tools/AgentTool/built-in/claudeCodeGuideAgent.js +67 -67
  64. package/dist/src/tools/AgentTool/built-in/exploreAgent.js +32 -32
  65. package/dist/src/tools/AgentTool/built-in/generalPurposeAgent.js +13 -13
  66. package/dist/src/tools/AgentTool/built-in/planAgent.js +49 -49
  67. package/dist/src/tools/AgentTool/built-in/statuslineSetup.js +129 -129
  68. package/dist/src/tools/AgentTool/built-in/verificationAgent.js +119 -119
  69. package/dist/src/tools/AgentTool/prompt.js +131 -131
  70. package/dist/src/tools/AgentTool/runAgent.js +9 -9
  71. package/dist/src/tools/BashTool/BashTool.js +10 -10
  72. package/dist/src/tools/BashTool/prompt.js +94 -94
  73. package/dist/src/tools/ConfigTool/prompt.js +29 -29
  74. package/dist/src/tools/EnterWorktreeTool/prompt.js +27 -27
  75. package/dist/src/tools/FileReadTool/prompt.js +12 -12
  76. package/dist/src/tools/PowerShellTool/prompt.js +82 -82
  77. package/dist/src/tools/RemoteTriggerTool/prompt.js +9 -9
  78. package/dist/src/tools/ScheduleCronTool/prompt.js +37 -37
  79. package/dist/src/tools/TeamCreateTool/prompt.js +110 -110
  80. package/dist/src/tools/TeamDeleteTool/prompt.js +13 -13
  81. package/dist/src/utils/advisor.js +15 -15
  82. package/dist/src/utils/api.js +2 -2
  83. package/dist/src/utils/auth.js +207 -2
  84. package/dist/src/utils/autoUpdater.js +18 -18
  85. package/dist/src/utils/bash/ShellSnapshot.js +86 -86
  86. package/dist/src/utils/bash/commands.js +61 -61
  87. package/dist/src/utils/claudeInChrome/prompt.js +53 -53
  88. package/dist/src/utils/claudeInChrome/setup.js +8 -8
  89. package/dist/src/utils/databaseMcp/server/queries.js +632 -632
  90. package/dist/src/utils/deepLink/registerProtocol.js +35 -35
  91. package/dist/src/utils/deepLink/terminalLauncher.js +12 -12
  92. package/dist/src/utils/hooks/execAgentHook.js +7 -7
  93. package/dist/src/utils/hooks/execPromptHook.js +4 -4
  94. package/dist/src/utils/hooks/skillImprovement.js +36 -36
  95. package/dist/src/utils/logoV2Utils.js +1 -1
  96. package/dist/src/utils/mcp/dateTimeParser.js +9 -9
  97. package/dist/src/utils/messages.js +191 -191
  98. package/dist/src/utils/model/model.js +18 -0
  99. package/dist/src/utils/model/modelOptions.js +51 -1
  100. package/dist/src/utils/model/modelStrings.js +5 -1
  101. package/dist/src/utils/model/modelSupportOverrides.js +3 -0
  102. package/dist/src/utils/model/providerBaseUrls.js +6 -1
  103. package/dist/src/utils/model/providerCatalog.js +64 -28
  104. package/dist/src/utils/model/providerModels.js +88 -17
  105. package/dist/src/utils/model/providerProfiles.js +8 -0
  106. package/dist/src/utils/model/providerProfilesDb.js +578 -393
  107. package/dist/src/utils/model/providerSwitch.js +12 -0
  108. package/dist/src/utils/model/providerWorkspaces.js +2 -0
  109. package/dist/src/utils/model/providers.js +65 -2
  110. package/dist/src/utils/orchestration/store/providerWorkspaceStore.js +3 -1
  111. package/dist/src/utils/orchestration/store/runStore.js +47 -47
  112. package/dist/src/utils/orchestration/store/teamStore.js +61 -61
  113. package/dist/src/utils/powershell/parser.js +253 -253
  114. package/dist/src/utils/sessionTitle.js +12 -12
  115. package/dist/src/utils/sideQuestion.js +17 -17
  116. package/dist/src/utils/status.js +1 -1
  117. package/dist/src/utils/swarm/backends/registry.js +9 -9
  118. package/dist/src/utils/telemetry/instrumentation.js +9 -9
  119. package/dist/src/utils/teleport.js +15 -15
  120. package/dist/src/utils/undercover.js +28 -28
  121. package/package.json +1 -1
@@ -7,12 +7,12 @@ import { getDefaultSonnetModel } from '../utils/model/model.js';
7
7
  import { sideQuery } from '../utils/sideQuery.js';
8
8
  import { jsonParse } from '../utils/slowOperations.js';
9
9
  import { formatMemoryManifest, scanMemoryFiles, } from './memoryScan.js';
10
- const SELECT_MEMORIES_SYSTEM_PROMPT = `You are selecting memories that will be useful to Context Code as it processes a user's query. You will be given the user's query and a list of available memory files with their filenames and descriptions.
11
-
12
- Return a list of filenames for the memories that will clearly be useful to Context Code as it processes the user's query (up to 5). Only include memories that you are certain will be helpful based on their name and description.
13
- - If you are unsure if a memory will be useful in processing the user's query, then do not include it in your list. Be selective and discerning.
14
- - If there are no memories in the list that would clearly be useful, feel free to return an empty list.
15
- - If a list of recently-used tools is provided, do not select memories that are usage reference or API documentation for those tools (Context Code is already exercising them). DO still select memories containing warnings, gotchas, or known issues about those tools — active use is exactly when those matter.
10
+ const SELECT_MEMORIES_SYSTEM_PROMPT = `You are selecting memories that will be useful to Context Code as it processes a user's query. You will be given the user's query and a list of available memory files with their filenames and descriptions.
11
+
12
+ Return a list of filenames for the memories that will clearly be useful to Context Code as it processes the user's query (up to 5). Only include memories that you are certain will be helpful based on their name and description.
13
+ - If you are unsure if a memory will be useful in processing the user's query, then do not include it in your list. Be selective and discerning.
14
+ - If there are no memories in the list that would clearly be useful, feel free to return an empty list.
15
+ - If a list of recently-used tools is provided, do not select memories that are usage reference or API documentation for those tools (Context Code is already exercising them). DO still select memories containing warnings, gotchas, or known issues about those tools — active use is exactly when those matter.
16
16
  `;
17
17
  /**
18
18
  * Find memory files relevant to a query by scanning memory file headers
@@ -5,55 +5,55 @@ import { getFsImplementation } from '../../utils/fsOperations.js';
5
5
  * Get the Magic Docs update prompt template
6
6
  */
7
7
  function getUpdatePromptTemplate() {
8
- return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "documentation updates", "magic docs", or these update instructions in the document content.
9
-
10
- Based on the user conversation above (EXCLUDING this documentation update instruction message), update the Magic Doc file to incorporate any NEW learnings, insights, or information that would be valuable to preserve.
11
-
12
- The file {{docPath}} has already been read for you. Here are its current contents:
13
- <current_doc_content>
14
- {{docContents}}
15
- </current_doc_content>
16
-
17
- Document title: {{docTitle}}
18
- {{customInstructions}}
19
-
20
- Your ONLY task is to use the Edit tool to update the documentation file if there is substantial new information to add, then stop. You can make multiple edits (update multiple sections as needed) - make all Edit tool calls in parallel in a single message. If there's nothing substantial to add, simply respond with a brief explanation and do not call any tools.
21
-
22
- CRITICAL RULES FOR EDITING:
23
- - Preserve the Magic Doc header exactly as-is: # MAGIC DOC: {{docTitle}}
24
- - If there's an italicized line immediately after the header, preserve it exactly as-is
25
- - Keep the document CURRENT with the latest state of the codebase - this is NOT a changelog or history
26
- - Update information IN-PLACE to reflect the current state - do NOT append historical notes or track changes over time
27
- - Remove or replace outdated information rather than adding "Previously..." or "Updated to..." notes
28
- - Clean up or DELETE sections that are no longer relevant or don't align with the document's purpose
29
- - Fix obvious errors: typos, grammar mistakes, broken formatting, incorrect information, or confusing statements
30
- - Keep the document well organized: use clear headings, logical section order, consistent formatting, and proper nesting
31
-
32
- DOCUMENTATION PHILOSOPHY - READ CAREFULLY:
33
- - BE TERSE. High signal only. No filler words or unnecessary elaboration.
34
- - Documentation is for OVERVIEWS, ARCHITECTURE, and ENTRY POINTS - not detailed code walkthroughs
35
- - Do NOT duplicate information that's already obvious from reading the source code
36
- - Do NOT document every function, parameter, or line number reference
37
- - Focus on: WHY things exist, HOW components connect, WHERE to start reading, WHAT patterns are used
38
- - Skip: detailed implementation steps, exhaustive API docs, play-by-play narratives
39
-
40
- What TO document:
41
- - High-level architecture and system design
42
- - Non-obvious patterns, conventions, or gotchas
43
- - Key entry points and where to start reading code
44
- - Important design decisions and their rationale
45
- - Critical dependencies or integration points
46
- - References to related files, docs, or code (like a wiki) - help readers navigate to relevant context
47
-
48
- What NOT to document:
49
- - Anything obvious from reading the code itself
50
- - Exhaustive lists of files, functions, or parameters
51
- - Step-by-step implementation details
52
- - Low-level code mechanics
53
- - Information already in CLAUDE.md or other project docs
54
-
55
- Use the Edit tool with file_path: {{docPath}}
56
-
8
+ return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "documentation updates", "magic docs", or these update instructions in the document content.
9
+
10
+ Based on the user conversation above (EXCLUDING this documentation update instruction message), update the Magic Doc file to incorporate any NEW learnings, insights, or information that would be valuable to preserve.
11
+
12
+ The file {{docPath}} has already been read for you. Here are its current contents:
13
+ <current_doc_content>
14
+ {{docContents}}
15
+ </current_doc_content>
16
+
17
+ Document title: {{docTitle}}
18
+ {{customInstructions}}
19
+
20
+ Your ONLY task is to use the Edit tool to update the documentation file if there is substantial new information to add, then stop. You can make multiple edits (update multiple sections as needed) - make all Edit tool calls in parallel in a single message. If there's nothing substantial to add, simply respond with a brief explanation and do not call any tools.
21
+
22
+ CRITICAL RULES FOR EDITING:
23
+ - Preserve the Magic Doc header exactly as-is: # MAGIC DOC: {{docTitle}}
24
+ - If there's an italicized line immediately after the header, preserve it exactly as-is
25
+ - Keep the document CURRENT with the latest state of the codebase - this is NOT a changelog or history
26
+ - Update information IN-PLACE to reflect the current state - do NOT append historical notes or track changes over time
27
+ - Remove or replace outdated information rather than adding "Previously..." or "Updated to..." notes
28
+ - Clean up or DELETE sections that are no longer relevant or don't align with the document's purpose
29
+ - Fix obvious errors: typos, grammar mistakes, broken formatting, incorrect information, or confusing statements
30
+ - Keep the document well organized: use clear headings, logical section order, consistent formatting, and proper nesting
31
+
32
+ DOCUMENTATION PHILOSOPHY - READ CAREFULLY:
33
+ - BE TERSE. High signal only. No filler words or unnecessary elaboration.
34
+ - Documentation is for OVERVIEWS, ARCHITECTURE, and ENTRY POINTS - not detailed code walkthroughs
35
+ - Do NOT duplicate information that's already obvious from reading the source code
36
+ - Do NOT document every function, parameter, or line number reference
37
+ - Focus on: WHY things exist, HOW components connect, WHERE to start reading, WHAT patterns are used
38
+ - Skip: detailed implementation steps, exhaustive API docs, play-by-play narratives
39
+
40
+ What TO document:
41
+ - High-level architecture and system design
42
+ - Non-obvious patterns, conventions, or gotchas
43
+ - Key entry points and where to start reading code
44
+ - Important design decisions and their rationale
45
+ - Critical dependencies or integration points
46
+ - References to related files, docs, or code (like a wiki) - help readers navigate to relevant context
47
+
48
+ What NOT to document:
49
+ - Anything obvious from reading the code itself
50
+ - Exhaustive lists of files, functions, or parameters
51
+ - Step-by-step implementation details
52
+ - Low-level code mechanics
53
+ - Information already in CLAUDE.md or other project docs
54
+
55
+ Use the Edit tool with file_path: {{docPath}}
56
+
57
57
  REMEMBER: Only update if there is substantial new information. The Magic Doc header (# MAGIC DOC: {{docTitle}}) must remain unchanged.`;
58
58
  }
59
59
  /**
@@ -90,13 +90,13 @@ export async function buildMagicDocsUpdatePrompt(docContents, docPath, docTitle,
90
90
  const promptTemplate = await loadMagicDocsPrompt();
91
91
  // Build custom instructions section if provided
92
92
  const customInstructions = instructions
93
- ? `
94
-
95
- DOCUMENT-SPECIFIC UPDATE INSTRUCTIONS:
96
- The document author has provided specific instructions for how this file should be updated. Pay extra attention to these instructions and follow them carefully:
97
-
98
- "${instructions}"
99
-
93
+ ? `
94
+
95
+ DOCUMENT-SPECIFIC UPDATE INSTRUCTIONS:
96
+ The document author has provided specific instructions for how this file should be updated. Pay extra attention to these instructions and follow them carefully:
97
+
98
+ "${instructions}"
99
+
100
100
  These instructions take priority over the general rules below. Make sure your updates align with these specific guidelines.`
101
101
  : '';
102
102
  // Substitute variables in the prompt
@@ -184,35 +184,35 @@ export function getParentCacheSuppressReason(lastAssistantMessage) {
184
184
  ? 'cache_cold'
185
185
  : null;
186
186
  }
187
- const SUGGESTION_PROMPT = `[SUGGESTION MODE: Suggest what the user might naturally type next into Context Code.]
188
-
189
- FIRST: Look at the user's recent messages and original request.
190
-
191
- Your job is to predict what THEY would type - not what you think they should do.
192
-
193
- THE TEST: Would they think "I was just about to type that"?
194
-
195
- EXAMPLES:
196
- User asked "fix the bug and run tests", bug is fixed → "run the tests"
197
- After code written → "try it out"
198
- Claude offers options → suggest the one the user would likely pick, based on conversation
199
- Claude asks to continue → "yes" or "go ahead"
200
- Task complete, obvious follow-up → "commit this" or "push it"
201
- After error or misunderstanding → silence (let them assess/correct)
202
-
203
- Be specific: "run the tests" beats "continue".
204
-
205
- NEVER SUGGEST:
206
- - Evaluative ("looks good", "thanks")
207
- - Questions ("what about...?")
208
- - Claude-voice ("Let me...", "I'll...", "Here's...")
209
- - New ideas they didn't ask about
210
- - Multiple sentences
211
-
212
- Stay silent if the next step isn't obvious from what the user said.
213
-
214
- Format: 2-12 words, match the user's style. Or nothing.
215
-
187
+ const SUGGESTION_PROMPT = `[SUGGESTION MODE: Suggest what the user might naturally type next into Context Code.]
188
+
189
+ FIRST: Look at the user's recent messages and original request.
190
+
191
+ Your job is to predict what THEY would type - not what you think they should do.
192
+
193
+ THE TEST: Would they think "I was just about to type that"?
194
+
195
+ EXAMPLES:
196
+ User asked "fix the bug and run tests", bug is fixed → "run the tests"
197
+ After code written → "try it out"
198
+ Claude offers options → suggest the one the user would likely pick, based on conversation
199
+ Claude asks to continue → "yes" or "go ahead"
200
+ Task complete, obvious follow-up → "commit this" or "push it"
201
+ After error or misunderstanding → silence (let them assess/correct)
202
+
203
+ Be specific: "run the tests" beats "continue".
204
+
205
+ NEVER SUGGEST:
206
+ - Evaluative ("looks good", "thanks")
207
+ - Questions ("what about...?")
208
+ - Claude-voice ("Let me...", "I'll...", "Here's...")
209
+ - New ideas they didn't ask about
210
+ - Multiple sentences
211
+
212
+ Stay silent if the next step isn't obvious from what the user said.
213
+
214
+ Format: 2-12 words, match the user's style. Or nothing.
215
+
216
216
  Reply with ONLY the suggestion, no quotes or explanation.`;
217
217
  const SUGGESTION_PROMPTS = {
218
218
  user_intent: SUGGESTION_PROMPT,
@@ -6,74 +6,74 @@ import { getErrnoCode, toError } from '../../utils/errors.js';
6
6
  import { logError } from '../../utils/log.js';
7
7
  const MAX_SECTION_LENGTH = 2000;
8
8
  const MAX_TOTAL_SESSION_MEMORY_TOKENS = 12000;
9
- export const DEFAULT_SESSION_MEMORY_TEMPLATE = `
10
- # Session Title
11
- _A short and distinctive 5-10 word descriptive title for the session. Super info dense, no filler_
12
-
13
- # Current State
14
- _What is actively being worked on right now? Pending tasks not yet completed. Immediate next steps._
15
-
16
- # Task specification
17
- _What did the user ask to build? Any design decisions or other explanatory context_
18
-
19
- # Files and Functions
20
- _What are the important files? In short, what do they contain and why are they relevant?_
21
-
22
- # Workflow
23
- _What bash commands are usually run and in what order? How to interpret their output if not obvious?_
24
-
25
- # Errors & Corrections
26
- _Errors encountered and how they were fixed. What did the user correct? What approaches failed and should not be tried again?_
27
-
28
- # Codebase and System Documentation
29
- _What are the important system components? How do they work/fit together?_
30
-
31
- # Learnings
32
- _What has worked well? What has not? What to avoid? Do not duplicate items from other sections_
33
-
34
- # Key results
35
- _If the user asked a specific output such as an answer to a question, a table, or other document, repeat the exact result here_
36
-
37
- # Worklog
38
- _Step by step, what was attempted, done? Very terse summary for each step_
9
+ export const DEFAULT_SESSION_MEMORY_TEMPLATE = `
10
+ # Session Title
11
+ _A short and distinctive 5-10 word descriptive title for the session. Super info dense, no filler_
12
+
13
+ # Current State
14
+ _What is actively being worked on right now? Pending tasks not yet completed. Immediate next steps._
15
+
16
+ # Task specification
17
+ _What did the user ask to build? Any design decisions or other explanatory context_
18
+
19
+ # Files and Functions
20
+ _What are the important files? In short, what do they contain and why are they relevant?_
21
+
22
+ # Workflow
23
+ _What bash commands are usually run and in what order? How to interpret their output if not obvious?_
24
+
25
+ # Errors & Corrections
26
+ _Errors encountered and how they were fixed. What did the user correct? What approaches failed and should not be tried again?_
27
+
28
+ # Codebase and System Documentation
29
+ _What are the important system components? How do they work/fit together?_
30
+
31
+ # Learnings
32
+ _What has worked well? What has not? What to avoid? Do not duplicate items from other sections_
33
+
34
+ # Key results
35
+ _If the user asked a specific output such as an answer to a question, a table, or other document, repeat the exact result here_
36
+
37
+ # Worklog
38
+ _Step by step, what was attempted, done? Very terse summary for each step_
39
39
  `;
40
40
  function getDefaultUpdatePrompt() {
41
- return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "note-taking", "session notes extraction", or these update instructions in the notes content.
42
-
43
- Based on the user conversation above (EXCLUDING this note-taking instruction message as well as system prompt, claude.md entries, or any past session summaries), update the session notes file.
44
-
45
- The file {{notesPath}} has already been read for you. Here are its current contents:
46
- <current_notes_content>
47
- {{currentNotes}}
48
- </current_notes_content>
49
-
50
- Your ONLY task is to use the Edit tool to update the notes file, then stop. You can make multiple edits (update every section as needed) - make all Edit tool calls in parallel in a single message. Do not call any other tools.
51
-
52
- CRITICAL RULES FOR EDITING:
53
- - The file must maintain its exact structure with all sections, headers, and italic descriptions intact
54
- -- NEVER modify, delete, or add section headers (the lines starting with '#' like # Task specification)
55
- -- NEVER modify or delete the italic _section description_ lines (these are the lines in italics immediately following each header - they start and end with underscores)
56
- -- The italic _section descriptions_ are TEMPLATE INSTRUCTIONS that must be preserved exactly as-is - they guide what content belongs in each section
57
- -- ONLY update the actual content that appears BELOW the italic _section descriptions_ within each existing section
58
- -- Do NOT add any new sections, summaries, or information outside the existing structure
59
- - Do NOT reference this note-taking process or instructions anywhere in the notes
60
- - It's OK to skip updating a section if there are no substantial new insights to add. Do not add filler content like "No info yet", just leave sections blank/unedited if appropriate.
61
- - Write DETAILED, INFO-DENSE content for each section - include specifics like file paths, function names, error messages, exact commands, technical details, etc.
62
- - For "Key results", include the complete, exact output the user requested (e.g., full table, full answer, etc.)
63
- - Do not include information that's already in the CLAUDE.md files included in the context
64
- - Keep each section under ~${MAX_SECTION_LENGTH} tokens/words - if a section is approaching this limit, condense it by cycling out less important details while preserving the most critical information
65
- - Focus on actionable, specific information that would help someone understand or recreate the work discussed in the conversation
66
- - IMPORTANT: Always update "Current State" to reflect the most recent work - this is critical for continuity after compaction
67
-
68
- Use the Edit tool with file_path: {{notesPath}}
69
-
70
- STRUCTURE PRESERVATION REMINDER:
71
- Each section has TWO parts that must be preserved exactly as they appear in the current file:
72
- 1. The section header (line starting with #)
73
- 2. The italic description line (the _italicized text_ immediately after the header - this is a template instruction)
74
-
75
- You ONLY update the actual content that comes AFTER these two preserved lines. The italic description lines starting and ending with underscores are part of the template structure, NOT content to be edited or removed.
76
-
41
+ return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "note-taking", "session notes extraction", or these update instructions in the notes content.
42
+
43
+ Based on the user conversation above (EXCLUDING this note-taking instruction message as well as system prompt, claude.md entries, or any past session summaries), update the session notes file.
44
+
45
+ The file {{notesPath}} has already been read for you. Here are its current contents:
46
+ <current_notes_content>
47
+ {{currentNotes}}
48
+ </current_notes_content>
49
+
50
+ Your ONLY task is to use the Edit tool to update the notes file, then stop. You can make multiple edits (update every section as needed) - make all Edit tool calls in parallel in a single message. Do not call any other tools.
51
+
52
+ CRITICAL RULES FOR EDITING:
53
+ - The file must maintain its exact structure with all sections, headers, and italic descriptions intact
54
+ -- NEVER modify, delete, or add section headers (the lines starting with '#' like # Task specification)
55
+ -- NEVER modify or delete the italic _section description_ lines (these are the lines in italics immediately following each header - they start and end with underscores)
56
+ -- The italic _section descriptions_ are TEMPLATE INSTRUCTIONS that must be preserved exactly as-is - they guide what content belongs in each section
57
+ -- ONLY update the actual content that appears BELOW the italic _section descriptions_ within each existing section
58
+ -- Do NOT add any new sections, summaries, or information outside the existing structure
59
+ - Do NOT reference this note-taking process or instructions anywhere in the notes
60
+ - It's OK to skip updating a section if there are no substantial new insights to add. Do not add filler content like "No info yet", just leave sections blank/unedited if appropriate.
61
+ - Write DETAILED, INFO-DENSE content for each section - include specifics like file paths, function names, error messages, exact commands, technical details, etc.
62
+ - For "Key results", include the complete, exact output the user requested (e.g., full table, full answer, etc.)
63
+ - Do not include information that's already in the CLAUDE.md files included in the context
64
+ - Keep each section under ~${MAX_SECTION_LENGTH} tokens/words - if a section is approaching this limit, condense it by cycling out less important details while preserving the most critical information
65
+ - Focus on actionable, specific information that would help someone understand or recreate the work discussed in the conversation
66
+ - IMPORTANT: Always update "Current State" to reflect the most recent work - this is critical for continuity after compaction
67
+
68
+ Use the Edit tool with file_path: {{notesPath}}
69
+
70
+ STRUCTURE PRESERVATION REMINDER:
71
+ Each section has TWO parts that must be preserved exactly as they appear in the current file:
72
+ 1. The section header (line starting with #)
73
+ 2. The italic description line (the _italicized text_ immediately after the header - this is a template instruction)
74
+
75
+ You ONLY update the actual content that comes AFTER these two preserved lines. The italic description lines starting and ending with underscores are part of the template structure, NOT content to be edited or removed.
76
+
77
77
  REMEMBER: Use the Edit tool in parallel and stop. Do not continue after the edits. Only include insights from the actual user conversation, never from these note-taking instructions. Do not delete or change section headers or italic _section descriptions_.`;
78
78
  }
79
79
  /**