# Claude Context Inspector A local Chrome extension for analyzing and exporting Claude conversations. ## Features - **Token Counter**: Count tokens across Claude responses, thinking traces, user messages, and paste content - **Chat Export (truncated)**: Export full conversation with head/tail truncation on large pastes - **Chat Export (full)**: Export without any truncation - **Configurable truncation**: Adjust head/tail token counts for paste truncation ## Installation 1. Open Chrome and go to `chrome://extensions/` 2. Enable "Developer mode" (toggle in top right) 3. Click "Load unpacked" 4. Select the `claude-context-extension` folder 5. The extension icon should appear in your toolbar ## Usage 1. Navigate to a conversation on `claude.ai` 2. Click the extension icon in your toolbar 3. Use the buttons: - **Count Tokens**: Expands all thinking traces and counts tokens across the conversation - **Export Chat (with truncation)**: Copies the full chat to clipboard with large pastes truncated to head + tail - **Export Chat (full)**: Copies without truncation ## Truncation Settings The truncation follows the "truncation-on-load" heuristic: - **Head tokens**: How many tokens to keep from the START of a large paste (default: 100) - **Tail tokens**: How many tokens to keep from the END of a large paste (default: 50) Large pastes (documents, code dumps, data) get truncated to preserve the beginning and end while dropping the middle. This keeps context manageable while maintaining enough signal to understand what was pasted. Output format for truncated pastes: ``` [first ~100 tokens of content] [... truncated N tokens (paste) ...] [last ~50 tokens of content] ``` ## Notes - Token estimation uses chars/4 heuristic (same as your original console script) - The extension needs to expand thinking traces to count them, which takes a few seconds - Export copies to clipboard as markdown - Only works on `claude.ai` pages ## Troubleshooting If selectors break (claude.ai updates their DOM): - Check `popup.js` for the selectors used - Common culprits: `.standard-markdown`, `[class*="bg-bg-300"]`, paste button selectors - Update the selectors to match the new DOM structure