Skip to content

Commit 8859b47

Browse files
Huge update for extension (v3)
BREAKING CHANGE: Reconstruct Chrome Extension Architecture for Production-Grade Scalability (v3.0.0)
2 parents 33cb5f6 + 70abcf6 commit 8859b47

48 files changed

Lines changed: 1960 additions & 44 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: chrome-extension CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "extensions/chrome/**"
8+
pull_request:
9+
branches: [main]
10+
paths:
11+
- "extensions/chrome/**"
12+
13+
defaults:
14+
run:
15+
working-directory: ./extensions/chrome
16+
17+
jobs:
18+
lint-and-format:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Setup Bun
28+
uses: oven-sh/setup-bun@v1
29+
with:
30+
bun-version: latest
31+
32+
- name: Install dependencies
33+
run: bun install
34+
35+
- name: Run ESLint and format fix
36+
run: bun run fix
37+
38+
- name: Run markdown lint
39+
# DON't TOUCH THIS LINE BELOW #
40+
run: bunx markdownlint-cli2 "./**/*.md" --config .markdownlint-cli2.jsonc
41+
42+
test-and-build:
43+
needs: lint-and-format
44+
runs-on: ubuntu-latest
45+
permissions:
46+
contents: write
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- name: Setup Bun
51+
uses: oven-sh/setup-bun@v1
52+
with:
53+
bun-version: latest
54+
55+
- name: Install dependencies
56+
run: bun install
57+
58+
- name: Run tests
59+
run: bun test
60+
61+
- name: Build extension
62+
run: bun run build
63+
64+
- name: Zip Extension
65+
run: zip -r chrome-extension.zip dist/
66+
67+
# Automatically increments the patch version (e.g., 1.0.0 -> 1.0.1)
68+
# and creates a release
69+
# Only increment patch version for non-major versions
70+
- name: Check existing tag
71+
id: check_tag
72+
run: |
73+
current_version=$(node -p "require('./package.json').version")
74+
if [[ "$current_version" =~ ^[0-9]+\.0\.0$ ]]; then
75+
# Don't increment major versions (x.0.0)
76+
echo "version=$current_version" >> $GITHUB_OUTPUT
77+
echo "version_changed=false" >> $GITHUB_OUTPUT
78+
elif git ls-remote --tags origin refs/tags/v$current_version >/dev/null; then
79+
# If tag exists and it's not a major version, increment patch
80+
IFS='.' read -r major minor patch <<< "$current_version"
81+
new_version="$major.$minor.$((patch + 1))"
82+
echo "version=$new_version" >> $GITHUB_OUTPUT
83+
echo "version_changed=true" >> $GITHUB_OUTPUT
84+
# Update package.json with new version
85+
sed -i "s/\"version\": \"$current_version\"/\"version\": \"$new_version\"/" package.json
86+
# Update manifest.json with new version
87+
sed -i "s/\"version\": \"$current_version\"/\"version\": \"$new_version\"/" public/manifest.json
88+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
89+
git config --global user.name "github-actions[bot]"
90+
git add package.json public/manifest.json
91+
git commit -m "chore: bump version to $new_version [skip ci]"
92+
git push
93+
else
94+
echo "version=$current_version" >> $GITHUB_OUTPUT
95+
echo "version_changed=false" >> $GITHUB_OUTPUT
96+
fi
97+
- name: Create Release
98+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
99+
uses: softprops/action-gh-release@v1
100+
with:
101+
name: Chrome Extension v${{ steps.check_tag.outputs.version }}
102+
tag_name: v${{ steps.check_tag.outputs.version }}
103+
files: extensions/chrome/chrome-extension.zip
104+
generate_release_notes: true
105+
token: ${{ secrets.GITHUB_TOKEN }}
106+
fail_on_unmatched_files: true

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Dependencies
2+
node_modules/
3+
.pnp/
4+
.pnp.js
5+
bun.lockb
6+
7+
# Testing
8+
coverage/
9+
.nyc_output/
10+
11+
# Production & Build files
12+
dist/
13+
build/
14+
*.tsbuildinfo
15+
16+
# Development & IDE
17+
.DS_Store
18+
.env
19+
.env.local
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
.idea/
24+
.vscode/*
25+
!.vscode/extensions.json
26+
!.vscode/settings.json
27+
!.vscode/tasks.json
28+
!.vscode/launch.json
29+
30+
# Debug logs
31+
npm-debug.log*
32+
yarn-debug.log*
33+
yarn-error.log*
34+
debug.log
35+
*.log
36+
37+
# Cache directories
38+
.npm/
39+
.eslintcache
40+
.stylelintcache
41+
.prettiercache
42+
.cache/
43+
44+
# Chrome Extension specific
45+
*.crx
46+
*.pem
47+
*.zip
48+
49+
# Temporary files
50+
*.swp
51+
*.swo
52+
*~
53+
54+
# OS generated files
55+
.DS_Store
56+
.DS_Store?
57+
._*
58+
.Spotlight-V100
59+
.Trashes
60+
ehthumbs.db
61+
Thumbs.db

.husky/post-commit

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env sh
2+
3+
# DON'T TOUCH THIS FILE IF YOU DON'T KNOW WHAT YOU ARE DOING
4+
5+
echo "Checking for changes in chrome..."
6+
if git log -1 --name-only --pretty=format: | grep "^extensions/chrome" > /dev/null; then
7+
echo "Changes detected, fetching..."
8+
git fetch
9+
echo "Fetch complete"
10+
echo "Pulling changes..."
11+
git pull
12+
echo "Pull complete"
13+
fi
14+
15+
# TODO: config this for other extensions too

.husky/pre-commit

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env sh
2+
3+
# DON'T TOUCH THIS FILE IF YOU DON'T KNOW WHAT YOU ARE DOING
4+
5+
# Check if there are changes in extensions directory
6+
if ! git diff --cached --name-only | grep "^extensions/chrome" > /dev/null; then
7+
echo "No changes in chrome"
8+
exit 0
9+
fi
10+
11+
if ! cd extensions/chrome; then
12+
echo "Failed to change directory"
13+
exit 1
14+
fi
15+
16+
if ! bun run lint:staged; then
17+
echo "Lint failed"
18+
exit 1
19+
fi
20+
21+
# TODO: config this for other extensions too

README.md

Lines changed: 67 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,71 +6,93 @@ Let Claude think comprehensively before responding!
66
> Thinking claude **is not aimed for benchmarks or huge leaps in math or something**, since those are pre-determined by the base model (new Claude-3.5 Sonnet).
77
> I only want to explore how further we could reach with Claude's "deep mindset". That said, when using it in your daily tasks, you will find Claude's inner monolog (thinking process) very very fun and interesting.
88
9-
## Demo:
10-
9+
## Demo
1110

1211
https://github.com/user-attachments/assets/88ff0c75-c51b-42b9-a042-00d47053795a
1312

14-
1513
## Overview
1614

1715
This project consists of two main components:
16+
1817
1. **Thinking Protocol**: A comprehensive set of instructions that guides Claude to think deeply and systematically before responding
1918
2. **Browser Extension**: A tool that makes Claude's thinking process more readable and manageable in the browser interface
2019

2120
## Project Structure
22-
thinking-claude/
23-
├── extension/
24-
│ ├── .vscode/
25-
│ ├── chrome/
26-
│ ├── firefox/
27-
│ └── changelog.md
28-
├── model_instructions/
29-
│ ├── changelog.md
30-
│ ├── v3.5-20241113.md
31-
│ ├── v4-20241118.md
32-
│ └── v4-lite-20241118.md
33-
├── LICENSE
34-
└── README.md
35-
The project is organized into two main directories:
36-
- `extension/`: Contains browser extension implementations
37-
- `model_instructions/`: Contains thinking protocols for different versions
38-
39-
Each directory maintains its own changelog for version tracking.
21+
22+
```bash
23+
thinking-claude/
24+
├── extensions/
25+
│ ├── chrome/ # Current version of Chrome extension
26+
│ ├── chrome_v0/ # Legacy Chrome extension (deprecated)
27+
│ ├── firefox/ # Firefox extension (in development)
28+
│ └── changelog.md
29+
├── model_instructions/
30+
│ ├── changelog.md
31+
│ ├── v5-Exp-20241123.md
32+
│ ├── v4-20241118.md
33+
│ ├── v4-lite-20241118.md
34+
│ └── v3.5-20241113.md
35+
├── .github/ # GitHub configurations and workflows
36+
├── .husky/ # Git hooks for development
37+
├── LICENSE
38+
└── README.md
39+
```
40+
41+
The project is organized into two main components:
42+
43+
- `extensions/`: Browser extension implementations
44+
45+
- `chrome/`: Current version with modern architecture and features
46+
- `chrome_v0/`: Legacy version (deprecated)
47+
- `firefox/`: Firefox version (in development)
48+
49+
- `model_instructions/`: Thinking protocols for different versions
50+
- Contains versioned instruction sets
51+
- Each version brings improvements to Claude's thinking process
52+
4053
## Thinking Protocol
4154

4255
The thinking protocol instructs Claude to follow a natural, thorough thought process before providing responses.
4356

4457
## Browser Extension
4558

46-
The browser extension enhances the Claude interface by making the thinking process more manageable:
59+
The browser extension makes Claude's thinking process easier to read and use! It automatically organizes Claude's thoughts into neat, collapsible sections.
4760

4861
### Features
49-
- 🔄 Collapsible thinking process sections
50-
- 📋 Easy copy functionality
51-
- 🎯 Clean and intuitive interface
52-
- ⚡ Automatic processing of new messages
5362

54-
### Installation
63+
- 🎯 Makes Claude's thinking process easy to read
64+
- 🔄 Fold and unfold different parts of Claude's thoughts
65+
- 📋 Copy any part with just one click
66+
- ⚡ Works automatically with new messages
67+
- 🎨 Clean, modern design that's easy on the eyes
68+
69+
### 🚀 Quick Install Guide
5570

56-
#### Chrome
71+
1. **Chrome Users (Recommended)**
5772

58-
**Quick Install:**
59-
Install directly from the [Chrome Web Store](https://chromewebstore.google.com/detail/thinking-claude/ncjafpbbndpggfhfgjngkcimeaciahpo)
73+
- Install directly from the [Chrome Web Store](https://chromewebstore.google.com/detail/thinking-claude/ncjafpbbndpggfhfgjngkcimeaciahpo)
6074

61-
**Manual Installation:**
62-
1. Clone the repository:
63-
```bash
64-
git clone https://github.com/yourusername/thinking-claude.git
65-
2. Open Chrome and navigate to `chrome://extensions/`
66-
3. Enable "Developer mode"
67-
4. Click "Load unpacked" and select the `extension/chrome` folder
75+
2. **Manual Installation**
76+
- Download the latest version from our [Releases Page](https://github.com/richards199999/Thinking-Claude/releases)
77+
- Unzip the file
78+
- Open Chrome and go to `chrome://extensions/`
79+
- Turn on "Developer mode" (top right corner)
80+
- Click "Load unpacked" and select the unzipped folder
6881

69-
#### Firefox
70-
1. Clone this repository
71-
2. Open Firefox and navigate to `about:debugging#/runtime/this-firefox`
72-
3. Click "Load Temporary Add-on"
73-
4. Navigate to the repository and select the `extension/firefox/manifest.json` file
82+
👉 Want more details? Check out our [Extension Guide](extensions/chrome/README.md) for:
83+
84+
- Step-by-step installation instructions
85+
- Development setup
86+
- Advanced features and usage
87+
- Troubleshooting tips
88+
89+
### 🎉 Getting Started
90+
91+
Once installed, just:
92+
93+
1. Visit [Claude.ai](https://claude.ai)
94+
2. Start chatting with Claude
95+
3. That's it! The extension will automatically make Claude's thinking process more readable
7496

7597
## Usage
7698

@@ -79,11 +101,12 @@ Install directly from the [Chrome Web Store](https://chromewebstore.google.com/d
79101
1. Copy the latest version in `model_instructions` folder
80102
2. Start a new Project in Claude.ai
81103
3. Paste the instructions to the Custom Instructions section
82-
3. Claude will now follow the thinking protocol for all subsequent interactions
104+
4. Claude will now follow the thinking protocol for all subsequent interactions
83105

84106
### Using the Extension
85107

86108
Once installed, the extension automatically:
109+
87110
- Detects Claude's thinking process blocks
88111
- Adds collapse/expand functionality
89112
- Provides a copy button for each block
@@ -98,6 +121,7 @@ Once installed, the extension automatically:
98121
## Contributing
99122

100123
Contributions are welcome! Feel free to:
124+
101125
- Submit bug reports
102126
- Propose new features
103127
- Create pull requests
File renamed without changes.

extensions/chrome/.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Package manager files
5+
bun.lockb
6+
7+
# Build output
8+
dist/
9+
build/
10+
11+
# IDE and editor files
12+
.idea/
13+
.vscode/
14+
*.swp
15+
*.swo
16+
.DS_Store
17+
18+
# Environment variables
19+
.env
20+
.env.local
21+
.env.*.local
22+
23+
# Debug logs
24+
debug.log
25+
26+
# Test coverage
27+
coverage/

0 commit comments

Comments
 (0)