Chat Session Logging and Markdown Export
Feature Description
Feature Request: Chat Session Logging and Markdown Export
Summary
Add built-in commands and settings to automatically log chat conversations and MCP tool usage to markdown files, providing persistent documentation of AI assistance sessions.
Problem Statement
While Kiro maintains chat history, users face significant challenges when trying to preserve and share conversations:
Formatting Loss: When copying conversations from the chat panel to markdown files, all formatting is lost including:
- Code syntax highlighting
- Proper markdown structure
- MCP tool execution details
- Timestamps and session context
Manual Export Limitations: Current workflow requires:
- Manual copy/paste from chat history
- Reformatting content to restore markdown structure
- Recreating code blocks and syntax highlighting
- Adding missing context like MCP tool parameters and results
Users need a way to:
- Export conversations with preserved formatting
- Automatically capture MCP tool usage details
- Generate properly structured markdown documentation
- Share formatted technical discussions with team members
- Create searchable archives without manual reformatting
Proposed Solution
1. Chat Commands
Add new slash commands for session management:
/log-session [filename] - Start comprehensive session logging
/log-mcp - Log only MCP tool usage and results
/export-chat [filename] - Export current conversation to markdown
/stop-logging - Stop active session logging
/show-logs - List available chat logs
2. Settings Integration
Add configuration options in Kiro settings:
{
"chat": {
"autoLog": false,
"logDirectory": ".kiro/chat-logs",
"logFormat": "comprehensive", // "basic" | "comprehensive" | "mcp-only"
"includeTimestamps": true,
"includeMCPDetails": true
}
}
3. Dual Output Mode
When logging is active:
- Continue showing responses in chat panel (existing behavior)
- Simultaneously write to specified markdown file
- Provide visual indicator when content is being logged
- Show file path and update status
Detailed Feature Specifications
Logging Formats
Comprehensive Format
# Kiro Chat Session - 2025-01-08 14:30
## Session Info
- Started: 2025-01-08 14:30:15
- Workspace: /path/to/project
- MCP Servers Active: filesystem, aws-docs, markitdown
## Conversation Log
### 14:30:15 User
create a new React component for user authentication
### 14:30:18 Kiro
I'll help you create a React authentication component. Let me start by creating the basic structure:
**MCP Tools Used:**
- `fsWrite`: Created `src/components/AuthForm.jsx`
- Parameters: `{"path": "src/components/AuthForm.jsx", "text": "..."}`
- Result: ✅ File created successfully
[Component code here...]
### 14:32:10 User
add form validation
### 14:32:15 Kiro
I'll add comprehensive form validation to the component:
**MCP Tools Used:**
- `strReplace`: Updated AuthForm.jsx with validation logic
- Parameters: `{"path": "src/components/AuthForm.jsx", "oldStr": "...", "newStr": "..."}`
- Result: ✅ Validation added successfully
## Files Modified
- ✅ `src/components/AuthForm.jsx` - Created
- ✅ `src/components/AuthForm.jsx` - Added validation
## Summary
Created a complete React authentication component with form validation, error handling, and proper state management.
MCP-Only Format
# MCP Tool Usage Log - 2025-01-08
## Session: React Authentication Component
### 14:30:18 - fsWrite
- **File:** `src/components/AuthForm.jsx`
- **Action:** Create new file
- **Size:** 1,247 bytes
- **Status:** ✅ Success
### 14:32:15 - strReplace
- **File:** `src/components/AuthForm.jsx`
- **Action:** Add validation logic
- **Lines Changed:** 15-30
- **Status:** ✅ Success
## Summary
- Total MCP calls: 2
- Files created: 1
- Files modified: 1
- Success rate: 100%
User Experience Features
Visual Indicators
- 📝 Icon in chat when logging is active
- 💾 Save indicator when content is written to file
- 📁 Quick access to log file location
- ⚠️ Warning if logging fails
File Management
- Auto-generate descriptive filenames:
chat-react-auth-2025-01-08.md - Organize logs by date:
.kiro/chat-logs/2025/01/08/ - Prevent filename conflicts with timestamps
- Option to append to existing files vs. create new ones
Use Case: How Would You Use This Feature?
Current Frustrating Workflow
- ❌ Have technical discussion in Kiro chat
- ❌ Copy conversation from chat history
- ❌ Paste into markdown file → All formatting is lost!
- ❌ Manually recreate code blocks with ```language syntax
- ❌ Add back headers, lists, and structure
- ❌ Try to remember MCP tool parameters and results
- ❌ Spend 10+ minutes reformatting what should be instant
Proposed Seamless Workflow
- ✅ Start chat:
/log-session react-component-tutorial - ✅ Have technical discussion normally
- ✅ Get perfectly formatted markdown file automatically
- ✅ Share with team immediately - zero reformatting needed
Real-World Scenarios
Scenario 1: Creating Team Documentation
Current Problem: You get help building a complex React component, but when you copy the conversation to share with your team, all the code formatting disappears.
With This Feature:
User: /log-session react-auth-component-guide
User: Help me create a reusable authentication component with TypeScript
[Kiro creates files, explains patterns, shows examples with proper formatting]
Result: Perfect tutorial with working code blocks, ready for team wiki
Scenario 2: Debugging Sessions
Current Problem: You troubleshoot an AWS deployment issue with multiple MCP tool calls, but can't easily capture all the commands and outputs for documentation.
With This Feature:
User: /log-mcp aws-deployment-debug
User: My Lambda deployment is failing, help me debug
[Multiple AWS CLI calls, file operations, error analysis]
Result: Complete debugging log with all commands, parameters, and solutions
Scenario 3: Learning Documentation
Current Problem: You learn something complex from Kiro but lose the formatted explanation when trying to save it for later reference.
With This Feature:
User: /log-session kubernetes-concepts-explained
User: Explain Kubernetes deployments, services, and ingress
[Detailed explanation with examples and diagrams]
Result: Formatted learning material ready for personal knowledge base
Key Benefits in Daily Use
For Individual Developers:
- Save complex solutions without losing formatting
- Build personal knowledge base from AI interactions
- Reference past solutions with proper code structure
For Teams:
- Share formatted technical discussions instantly
- Create onboarding materials from problem-solving sessions
- Maintain searchable archive of architectural decisions
For Documentation:
- Generate tutorials from interactive sessions
- Create troubleshooting guides from actual debugging
- Build FAQ content from formatted conversations
Technical Implementation Notes
File Operations
- Use atomic writes to prevent corruption
- Handle concurrent access if multiple chat sessions
- Implement file rotation for large logs
- Support both relative and absolute paths
Performance Considerations
- Async file writing to avoid blocking chat responses
- Configurable buffer size for frequent updates
- Option to disable logging for performance-critical sessions
Error Handling
- Graceful degradation if file writing fails
- User notification of logging errors
- Fallback to memory buffer if disk issues
Benefits
For Users
- ✅ Preserve formatting when exporting conversations
- ✅ Easy sharing of properly formatted AI assistance sessions
- ✅ Automatic capture of MCP tool details and parameters
- ✅ No manual reformatting required
- ✅ Professional documentation from chat sessions
- ✅ Complete debugging trail with tool execution context
For Development
- ✅ Better user feedback and issue reporting
- ✅ Usage analytics for MCP tools
- ✅ Quality assurance for AI responses
- ✅ Feature usage insights
Alternative Approaches Considered
- Export-only: Only allow manual exports (rejected - not proactive enough)
- Auto-log everything: Log all sessions by default (rejected - privacy concerns)
- Cloud storage: Store logs remotely (rejected - local control preferred)
Acceptance Criteria
- [ ]
/log-sessioncommand starts comprehensive logging - [ ]
/log-mcpcommand logs only MCP tool usage - [ ]
/export-chatcommand exports current conversation - [ ] Visual indicators show logging status
- [ ] Settings allow customization of log format and location
- [ ] File operations are atomic and error-handled
- [ ] Performance impact is minimal
- [ ] Works with all existing MCP servers
- [ ] Supports both manual and automatic filename generation
Priority
Medium-High - This feature significantly improves the user experience for documentation, debugging, and collaboration workflows.
Labels
enhancement chat documentation mcp user-experience
Use Case
Use Case: How Would You Use This Feature?
Current Frustrating Workflow
- ❌ Have technical discussion in Kiro chat
- ❌ Copy conversation from chat history
- ❌ Paste into markdown file → All formatting is lost!
- ❌ Manually recreate code blocks with ```language syntax
- ❌ Add back headers, lists, and structure
- ❌ Try to remember MCP tool parameters and results
- ❌ Spend 10+ minutes reformatting what should be instant
Proposed Seamless Workflow
- ✅ Start chat:
/log-session react-component-tutorial - ✅ Have technical discussion normally
- ✅ Get perfectly formatted markdown file automatically
- ✅ Share with team immediately - zero reformatting needed
Additional Context
No response
I use this functionality in Cursor all the time.
Hi @abdelrazekrizk, thanks for sharing this feedback. We will mark this as a feature request for the team to evaluate further.
Since the export feature isn’t working yet, you can do the following: open DevTools (⌥⌘I), find the message node, and copy the block’s innerText/HTML with the markup.
I would like to be able to control this (and other functions) via a settings file that kiro loaded automatically. Having all of my kiro sessions automagically saved in somewhere under ~/.kiro as markdown would really help me go back and review past activity.
It confuses me why something like this was not one of the first thing the kiro devs implemented. Makes me wonder if they are dogfooding this tool.
Chat transcript export shipped in Kiro CLI 2.6.0 (Jun 5, 2026): /transcript save exports the full conversation as markdown, plaintext, or JSON. The --plain and --json flags also switch the rendered transcript format inline. This covers the core request for markdown export with preserved formatting. See the 2.6.0 changelog. Closing as delivered.