> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dslip.com.au/llms.txt
> Use this file to discover all available pages before exploring further.

# Workflow

> Understanding how Chatledger captures and exports conversations

Chatledger works by periodically polling the Antigravity IDE's internal state to retrieve conversation histories. It then processes these conversations to generate clean, readable markdown files.

## Automatic Export

When `chatledger.enabled` is set to `true`, the extension runs a background process that checks for changes every `chatledger.pollInterval` minutes.

<Steps>
  <Step title="Polling">
    The extension wakes up and queries the local Antigravity server for active
    conversations in your current workspace.
  </Step>

  <Step title="Change Detection">
    It calculates a hash of the conversation content. If the hash matches the
    last export, the step is skipped to avoid redundant writes.
  </Step>

  <Step title="Sanitization">
    The content is scanned for sensitive information using built-in and custom
    regex patterns.
  </Step>

  <Step title="Export">
    New or modified conversations are written to the configured
    `exportDirectory` (default: `.chatledger`).
  </Step>
</Steps>

## Manual Export

You can trigger an export at any time, even if auto-export is disabled.

1. Open the Command Palette (`Ctrl+Shift+P`).
2. Run `Chatledger: Export Now`.

## Export Format

Conversations are saved as Markdown files. The filename format is:
`{sanitized_summary}_{last_12_uuid_chars}.md`

### File Structure

Each exported file contains:

* **Metadata Table**: Trajectory ID, total steps, start/end times.
* **User Request**: The initial prompt or task description.
* **Context**: `<details>` block showing active file and language context.
* **Agent Response**: The agent's thinking process and executed tools/actions.

<CodeGroup>
  ```markdown Example Output theme={null}
  # Fix Authentication Bug

  ## Metadata

  | Field             | Value       |
  | ----------------- | ----------- |
  | **Trajectory ID** | `abc123...` |
  | **Total Steps**   | 5           |

  ---

  ## User Request

  Fix the login issue.

  ## Agent Response

  ### Thinking

  Checking auth.ts...

  ```
</CodeGroup>

```
```
