Context Formats
PastePrompt turns selected repository files, metadata, and instructions into structured context bundles. The two primary formats are XML-like output and Markdown output.
What it does
PastePrompt generates copyable or exportable context bundles from the current selection. A bundle can include:
- File map.
- Selected file contents.
- Git metadata.
- Git diff context.
- Prompt template content.
- User instructions.
- Bundle metadata such as generated time or context hash when supported.
The same repository state, selection, format, and instructions should produce deterministic output so the bundle can be reviewed and reproduced.
Why it matters
LLM workflows work better when context is structured. A plain paste of unrelated files can make it hard for the model to distinguish file paths, file contents, instructions, and review goals.
Structured formats help you:
- Keep file boundaries clear.
- Preserve repository paths.
- Include explicit instructions.
- Compare generated bundles across runs.
- Store exported context as an audit artifact.
How to use it
- Select a repository.
- Select the files and folders you want to include.
- Add prompt instructions or apply a template.
- Choose XML or Markdown output.
- Review the bundle preview if available.
- Run the secret scanner.
- Copy the bundle or export it as Markdown.
- Paste or attach the bundle in your LLM tool.
XML-like format
The XML-like format uses explicit tags for file maps, file contents, and user instructions. It is useful when you want clear machine-readable boundaries without relying on Markdown structure.
Example:
<file_map>
<file path="src/auth/session.ts" tokens="1840" />
<file path="src/auth/types.ts" tokens="420" />
<file path="tests/session.test.ts" tokens="2290" />
</file_map>
<file_contents>
<file path="src/auth/session.ts">
<![CDATA[
export function createSession() {
// selected source code
}
]]>
</file>
<file path="src/auth/types.ts">
<![CDATA[
export type SessionConfig = {
// selected source code
}
]]>
</file>
</file_contents>
<user_instructions>
Focus only on high-confidence critical or high severity issues. Verify each claim against the included code and explain any assumptions.
</user_instructions>
Markdown format
The Markdown format is easier to read in exported files and audit notes. It typically uses headings for file paths and code fences for file contents.
Example:
# PastePrompt Context Bundle
## File Map
- `src/auth/session.ts`
- `src/auth/types.ts`
- `tests/session.test.ts`
## File Contents
### `src/auth/session.ts`
```ts
export function createSession() {
// selected source code
}
```
## User Instructions
Focus only on high-confidence critical or high severity issues.
Code fence escaping
Markdown bundles need to handle files that already contain triple backticks. PastePrompt should escape those fences or use longer outer fences so file contents do not break the bundle structure.
Deterministic ordering
For reproducibility, PastePrompt should order files deterministically. A stable order, such as normalized repository path order or the saved selection order, makes exported bundles easier to compare, hash, and review.
Example workflow
- Select product source files and tests.
- Apply the Critical/High Confidence Only prompt template.
- Choose XML-like output for a strict audit pass.
- Generate the bundle and scan for secrets.
- Export a Markdown copy for your audit notes.
- Paste the XML-like bundle into the LLM tool for review.
Limitations
- XML-like output is not a replacement for a formal schema or parser unless the consuming tool treats it that way.
- Markdown output can be easier to read but more sensitive to malformed code fences.
- Bundle size still depends on selected files and format overhead.
- A well-structured bundle does not guarantee accurate LLM output.
- Exported bundles can contain source code and must be stored carefully.