Documentation
¶
Overview ¶
Package reduce strips code fence markers from journal content to eliminate nesting conflicts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanToolOutputJSON ¶
CleanToolOutputJSON extracts plain text from Tool Output turns whose body is raw JSON from the Claude API (e.g. [{"type":"text","text":"..."}]). The JSON text field's \n escapes become real newlines.
Parameters:
- content: Journal entry content with potential JSON tool output
Returns:
- string: Content with JSON tool output replaced by plain text
func StripFences ¶
StripFences removes all code fence markers from content, leaving the inner text as-is. This eliminates fence nesting conflicts entirely. Files whose fences have been verified (fencesVerified=true) are returned unchanged.
The result is plain text with structural markers preserved (turn headers, tool calls, section breaks). Serves as a readable baseline without AI reconstruction, or as input for the ctx-journal-normalize skill.
Parameters:
- content: Raw Markdown content of a journal entry
- fencesVerified: Whether the file's fences have been verified via state
Returns:
- string: Content with code fence markers removed
func StripSystemReminders ¶
StripSystemReminders removes internal Claude Code blocks from journal content. Handles:
- XML-style system reminders: <system-reminder>...</system-reminder>
- Bold-style system reminders: **System Reminder**: ... (paragraph until blank line)
- Context compaction summaries: multi-line <summary>...</summary> blocks (standalone <summary> on its own line - see config.TagCompactionSummaryOpen)
- Compaction continuation boilerplate: "If you need specific details from before compaction..." paragraph
The authoritative JSONL transcripts retain them; the exported Markdown doesn't need them.
Parameters:
- content: Journal entry content with potential internal blocks
Returns:
- string: Content with all internal blocks removed
Types ¶
This section is empty.