> ## Documentation Index
> Fetch the complete documentation index at: https://codearchitect.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Example Workflows

> Real-world examples and workflows for using CodeArchitect MCP

## Getting Started

**First time?** Just ask:

```bash theme={null}
use codearchitect
```

This shows you all available features and how to use them. No memorization needed!

## System Design (Recommended Workflow)

**Step 1:** Export chat from Cursor/VS Code to `~/.codearchitect/exports/`

**Step 2:** Say:

```bash theme={null}
use codearchitect store_session
```

Or with explicit topic:

```bash theme={null}
use codearchitect store_session topic: "microservices architecture design"
```

Saves architecture decisions, trade-offs, and technology choices in a readable folder structure:

```
~/.codearchitect/sessions/2025-11-18/
└── microservices-architecture-design/
    ├── summary.md    # Quick overview + key decisions
    └── full.md       # Complete conversation
```

## Code Review

**Step 1:** Export chat to `~/.codearchitect/exports/`

**Step 2:**

```bash theme={null}
use codearchitect store_session topic: "authentication code review"
```

Documents review feedback, improvements, and best practices.

## Debugging

**Step 1:** Export chat to `~/.codearchitect/exports/`

**Step 2:**

```bash theme={null}
use codearchitect store_session topic: "database performance debugging"
```

Builds a troubleshooting knowledge base for future reference.

## Architecture Decisions

**Step 1:** Export chat to `~/.codearchitect/exports/`

**Step 2:**

```bash theme={null}
use codearchitect store_session topic: "ADR: Choosing PostgreSQL over MongoDB"
```

Tracks decision context, options, rationale, and consequences.

## Development Workflow

**Step 1:** Export chat to `~/.codearchitect/exports/`

**Step 2:**

```bash theme={null}
use codearchitect store_session topic: "CI/CD pipeline setup"
```

Captures setup steps, configuration, and troubleshooting tips.

## Team Knowledge Sharing

**Step 1:** Export chat to `~/.codearchitect/exports/`

**Step 2:**

```bash theme={null}
use codearchitect store_session topic: "GraphQL API implementation"
```

## Retrieving Sessions

### Get Help First

```bash theme={null}
use codearchitect get_session
```

Shows you how to retrieve sessions and lists available options.

### Get Specific Session

```bash theme={null}
use codearchitect get_session authentication-implementation
```

Retrieves a specific session by folder name with optimized format for LLM consumption.

### List Recent Sessions

```bash theme={null}
use codearchitect get_session 2025-11-18
```

Lists all sessions from a specific date, useful for reviewing daily work.

### List All Sessions

```bash theme={null}
use codearchitect get_session
```

Lists all available sessions across all dates.

### Review Architecture Decisions

```bash theme={null}
use codearchitect get_session microservices-architecture-design
```

Retrieves stored architecture discussions for reference during design work.

## Folder Structure

Sessions are organized in readable topic folders:

**Main location:** `~/.codearchitect/sessions/`

* Windows: `C:\Users\YourName\.codearchitect\sessions\`
* Linux/Mac: `~/.codearchitect/sessions/`

```
~/.codearchitect/sessions/
└── 2025-11-18/
    ├── authentication-implementation/
    │   ├── summary.md    # Quick summary + key points
    │   └── full.md       # Complete conversation (JSON + readable)
    ├── database-migration/
    │   ├── summary.md
    │   └── full.md
    └── microservices-architecture-design/
        ├── summary.md
        └── full.md
```

**Export folder:** `~/.codearchitect/exports/`

* Export chats here for automatic detection

## Token Optimization

The `get_session` tool automatically uses TOON format when retrieving sessions, providing \~40% token reduction when sending to LLMs:

```bash theme={null}
use codearchitect get_session authentication-implementation
```

This reduces API costs and improves response times when working with large conversation histories.

## Searching Sessions

### Search by Keyword

When you remember discussing something but not the exact session name:

```bash theme={null}
use codearchitect search_session "authentication"
```

This searches across all sessions and returns matching results with relevance scores and context snippets.

### Search with Date Filter

Search sessions from a specific date:

```bash theme={null}
use codearchitect search_session "database design" date: "2025-11-19"
```

### Search with Date Range

Search sessions within a date range:

```bash theme={null}
use codearchitect search_session "API" dateFrom: "2025-01-01" dateTo: "2025-01-31"
```

### Search with Limit

Get top matches only:

```bash theme={null}
use codearchitect search_session "test" limit: 10
```

### Find Related Conversations

Discover related sessions you might have forgotten about:

```bash theme={null}
use codearchitect search_session "microservices"
```

This helps you find all conversations about microservices architecture across your knowledge base.

### Complete Workflow: Store → Search → Retrieve

1. **Store session:**
   ```bash theme={null}
   use codearchitect store_session
   ```

2. **Search when needed:**
   ```bash theme={null}
   use codearchitect search_session "authentication implementation"
   ```

3. **Get specific session:**
   ```bash theme={null}
   use codearchitect get_session authentication-implementation
   ```

This workflow helps you maintain context across multiple conversations and build a comprehensive knowledge base.
