claude-self-reflect 2.4.11 → 2.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile.importer +15 -7
- package/Dockerfile.importer-isolated.alpine +21 -0
- package/Dockerfile.importer.alpine +23 -0
- package/Dockerfile.mcp-server.alpine +22 -0
- package/Dockerfile.mcp-server.ubuntu +34 -0
- package/Dockerfile.streaming-importer.alpine +24 -0
- package/Dockerfile.watcher.alpine +24 -0
- package/README.md +54 -0
- package/docker-compose.yaml +11 -1
- package/package.json +1 -1
package/Dockerfile.importer
CHANGED
|
@@ -5,12 +5,20 @@ WORKDIR /app
|
|
|
5
5
|
# Update system packages for security
|
|
6
6
|
RUN apt-get update && apt-get upgrade -y && rm -rf /var/lib/apt/lists/*
|
|
7
7
|
|
|
8
|
-
# Install dependencies
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
# Install dependencies directly (avoids file path issues with global npm installs)
|
|
9
|
+
RUN pip install --no-cache-dir \
|
|
10
|
+
qdrant-client==1.15.0 \
|
|
11
|
+
openai==1.97.1 \
|
|
12
|
+
mcp-server-qdrant==0.8.0 \
|
|
13
|
+
backoff==2.2.1 \
|
|
14
|
+
tqdm==4.67.1 \
|
|
15
|
+
humanize==4.12.3 \
|
|
16
|
+
fastembed==0.7.1 \
|
|
17
|
+
voyageai==0.3.4 \
|
|
18
|
+
tenacity==9.1.2
|
|
11
19
|
|
|
12
|
-
#
|
|
13
|
-
|
|
20
|
+
# Note: The import script is mounted as a volume in docker-compose.yaml
|
|
21
|
+
# This allows the container to work with both local development and global npm installs
|
|
14
22
|
|
|
15
|
-
#
|
|
16
|
-
CMD ["python", "
|
|
23
|
+
# Default command (can be overridden by docker-compose)
|
|
24
|
+
CMD ["python", "--version"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
FROM python:3.12-alpine
|
|
2
|
+
|
|
3
|
+
# Install build dependencies, security updates and curl
|
|
4
|
+
RUN apk update && apk upgrade && \
|
|
5
|
+
apk add --no-cache gcc musl-dev linux-headers curl && \
|
|
6
|
+
rm -rf /var/cache/apk/*
|
|
7
|
+
|
|
8
|
+
# Install Python dependencies
|
|
9
|
+
RUN pip install --no-cache-dir \
|
|
10
|
+
qdrant-client \
|
|
11
|
+
sentence-transformers \
|
|
12
|
+
numpy
|
|
13
|
+
|
|
14
|
+
# Copy the import script with proper permissions
|
|
15
|
+
COPY scripts/import-conversations-unified.py /app/import.py
|
|
16
|
+
RUN chmod +x /app/import.py
|
|
17
|
+
|
|
18
|
+
WORKDIR /app
|
|
19
|
+
|
|
20
|
+
# Run the import script
|
|
21
|
+
CMD ["python", "import.py"]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
FROM python:3.12-alpine
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
# Install build dependencies and security updates
|
|
6
|
+
RUN apk update && apk upgrade && \
|
|
7
|
+
apk add --no-cache gcc musl-dev linux-headers curl && \
|
|
8
|
+
rm -rf /var/cache/apk/*
|
|
9
|
+
|
|
10
|
+
# Install Python dependencies
|
|
11
|
+
RUN pip install --no-cache-dir \
|
|
12
|
+
qdrant-client \
|
|
13
|
+
sentence-transformers \
|
|
14
|
+
numpy \
|
|
15
|
+
fastembed \
|
|
16
|
+
voyageai \
|
|
17
|
+
python-dotenv
|
|
18
|
+
|
|
19
|
+
# Copy scripts
|
|
20
|
+
COPY scripts/import-conversations-unified.py /app/
|
|
21
|
+
|
|
22
|
+
# Run the import script
|
|
23
|
+
CMD ["python", "import-conversations-unified.py"]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
FROM python:3.12-alpine
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
# Install build dependencies and security updates
|
|
6
|
+
RUN apk update && apk upgrade && \
|
|
7
|
+
apk add --no-cache gcc musl-dev linux-headers && \
|
|
8
|
+
rm -rf /var/cache/apk/*
|
|
9
|
+
|
|
10
|
+
# Copy the MCP server package files
|
|
11
|
+
COPY mcp-server/pyproject.toml ./
|
|
12
|
+
COPY mcp-server/src ./src
|
|
13
|
+
|
|
14
|
+
# Install the package in development mode
|
|
15
|
+
RUN pip install --no-cache-dir -e .
|
|
16
|
+
|
|
17
|
+
# Create a non-root user
|
|
18
|
+
RUN adduser -D -u 1000 mcpuser
|
|
19
|
+
USER mcpuser
|
|
20
|
+
|
|
21
|
+
# Keep the container running and wait for docker exec commands
|
|
22
|
+
CMD ["tail", "-f", "/dev/null"]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
FROM ubuntu:24.04
|
|
2
|
+
|
|
3
|
+
# Prevent interactive prompts during package installation
|
|
4
|
+
ENV DEBIAN_FRONTEND=noninteractive
|
|
5
|
+
|
|
6
|
+
WORKDIR /app
|
|
7
|
+
|
|
8
|
+
# Install Python 3.12 and security updates
|
|
9
|
+
RUN apt-get update && apt-get upgrade -y && \
|
|
10
|
+
apt-get install -y --no-install-recommends \
|
|
11
|
+
python3.12 \
|
|
12
|
+
python3.12-venv \
|
|
13
|
+
python3-pip \
|
|
14
|
+
python3.12-dev \
|
|
15
|
+
gcc \
|
|
16
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
17
|
+
|
|
18
|
+
# Create virtual environment
|
|
19
|
+
RUN python3.12 -m venv /venv
|
|
20
|
+
ENV PATH="/venv/bin:$PATH"
|
|
21
|
+
|
|
22
|
+
# Copy the MCP server package files
|
|
23
|
+
COPY mcp-server/pyproject.toml ./
|
|
24
|
+
COPY mcp-server/src ./src
|
|
25
|
+
|
|
26
|
+
# Install the package in development mode
|
|
27
|
+
RUN pip install --no-cache-dir -e .
|
|
28
|
+
|
|
29
|
+
# Create a non-root user
|
|
30
|
+
RUN useradd -m -u 1000 mcpuser
|
|
31
|
+
USER mcpuser
|
|
32
|
+
|
|
33
|
+
# Keep the container running and wait for docker exec commands
|
|
34
|
+
CMD ["tail", "-f", "/dev/null"]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
FROM python:3.12-alpine
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
# Install build dependencies and security updates
|
|
6
|
+
RUN apk update && apk upgrade && \
|
|
7
|
+
apk add --no-cache gcc g++ musl-dev linux-headers curl && \
|
|
8
|
+
rm -rf /var/cache/apk/*
|
|
9
|
+
|
|
10
|
+
# Install Python dependencies
|
|
11
|
+
RUN pip install --no-cache-dir \
|
|
12
|
+
qdrant-client \
|
|
13
|
+
sentence-transformers \
|
|
14
|
+
numpy \
|
|
15
|
+
fastembed \
|
|
16
|
+
voyageai \
|
|
17
|
+
python-dotenv \
|
|
18
|
+
torch==2.3.0 --index-url https://download.pytorch.org/whl/cpu
|
|
19
|
+
|
|
20
|
+
# Copy scripts
|
|
21
|
+
COPY scripts/import-conversations-voyage-streaming.py /app/
|
|
22
|
+
|
|
23
|
+
# Run the streaming import script
|
|
24
|
+
CMD ["python", "-u", "import-conversations-voyage-streaming.py"]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
FROM python:3.12-alpine
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
# Install build dependencies and security updates
|
|
6
|
+
RUN apk update && apk upgrade && \
|
|
7
|
+
apk add --no-cache gcc musl-dev linux-headers curl && \
|
|
8
|
+
rm -rf /var/cache/apk/*
|
|
9
|
+
|
|
10
|
+
# Install Python dependencies
|
|
11
|
+
RUN pip install --no-cache-dir \
|
|
12
|
+
qdrant-client \
|
|
13
|
+
sentence-transformers \
|
|
14
|
+
numpy \
|
|
15
|
+
fastembed \
|
|
16
|
+
voyageai \
|
|
17
|
+
python-dotenv
|
|
18
|
+
|
|
19
|
+
# Copy scripts with proper permissions
|
|
20
|
+
COPY scripts/ /app/scripts/
|
|
21
|
+
RUN chmod +x /app/scripts/*.py
|
|
22
|
+
|
|
23
|
+
# Run the watcher script
|
|
24
|
+
CMD ["python", "-u", "scripts/import-watcher.py"]
|
package/README.md
CHANGED
|
@@ -260,6 +260,60 @@ Both embedding options work well. Local mode uses FastEmbed for privacy and offl
|
|
|
260
260
|
- [Why We Built This](docs/motivation-and-history.md) - The full story
|
|
261
261
|
- [Advanced Usage](docs/advanced-usage.md) - Power user features
|
|
262
262
|
|
|
263
|
+
## Security
|
|
264
|
+
|
|
265
|
+
### Container Security Notice
|
|
266
|
+
⚠️ **Known Vulnerabilities**: Our Docker images are continuously monitored by Snyk and may show vulnerabilities in base system libraries. We want to be transparent about this:
|
|
267
|
+
|
|
268
|
+
- **Why they exist**: We use official Python Docker images based on Debian stable, which prioritizes stability over latest versions
|
|
269
|
+
- **Actual risk is minimal** because:
|
|
270
|
+
- Most CVEs are in unused system libraries or require local access
|
|
271
|
+
- Security patches are backported by Debian (version numbers don't reflect patches)
|
|
272
|
+
- Our containers run as non-root users with minimal permissions
|
|
273
|
+
- This is a local-only tool with no network exposure
|
|
274
|
+
- **What we're doing**: Regular updates, security monitoring, and evaluating alternative base images
|
|
275
|
+
|
|
276
|
+
**For production or security-sensitive environments**, consider:
|
|
277
|
+
- Building your own hardened images
|
|
278
|
+
- Running with additional security constraints (see below)
|
|
279
|
+
- Evaluating if the tool meets your security requirements
|
|
280
|
+
|
|
281
|
+
For maximum security:
|
|
282
|
+
```bash
|
|
283
|
+
# Run containers with read-only root filesystem
|
|
284
|
+
docker run --read-only --tmpfs /tmp claude-self-reflect
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Privacy & Data Security
|
|
288
|
+
- **Local by default**: Your conversations never leave your machine unless you explicitly enable cloud embeddings
|
|
289
|
+
- **No telemetry**: We don't track usage or collect any data
|
|
290
|
+
- **Secure storage**: All data stored in Docker volumes with proper permissions
|
|
291
|
+
- **API keys**: Stored in .env file with 600 permissions (read/write by owner only)
|
|
292
|
+
|
|
293
|
+
See our [Security Policy](SECURITY.md) for vulnerability reporting and more details.
|
|
294
|
+
|
|
295
|
+
## ⚠️ Important Disclaimers
|
|
296
|
+
|
|
297
|
+
### Tool Operation
|
|
298
|
+
- **Resource Usage**: The import process can be CPU and memory intensive, especially during initial import of large conversation histories
|
|
299
|
+
- **Data Processing**: This tool reads and indexes your Claude conversation files. Ensure you have adequate disk space
|
|
300
|
+
- **No Warranty**: This software is provided "AS IS" under the MIT License, without warranty of any kind
|
|
301
|
+
- **Data Responsibility**: You are responsible for your conversation data and any API keys used
|
|
302
|
+
|
|
303
|
+
### Limitations
|
|
304
|
+
- **Not Official**: This is a community tool, not officially supported by Anthropic
|
|
305
|
+
- **Experimental Features**: Some features like memory decay are experimental and may change
|
|
306
|
+
- **Import Delays**: Large conversation histories may take significant time to import initially
|
|
307
|
+
- **Docker Dependency**: Requires Docker to be running, which uses system resources
|
|
308
|
+
|
|
309
|
+
### Best Practices
|
|
310
|
+
- **Backup Your Data**: Always maintain backups of important conversations
|
|
311
|
+
- **Monitor Resources**: Check Docker resource usage if you experience system slowdowns
|
|
312
|
+
- **Test First**: Try with a small subset of conversations before full import
|
|
313
|
+
- **Review Logs**: Check import logs if conversations seem missing
|
|
314
|
+
|
|
315
|
+
By using this tool, you acknowledge these disclaimers and limitations.
|
|
316
|
+
|
|
263
317
|
## Problems?
|
|
264
318
|
|
|
265
319
|
- [Troubleshooting Guide](docs/troubleshooting.md)
|
package/docker-compose.yaml
CHANGED
|
@@ -2,6 +2,14 @@ volumes:
|
|
|
2
2
|
qdrant_data:
|
|
3
3
|
|
|
4
4
|
services:
|
|
5
|
+
# Fix permissions for config directory
|
|
6
|
+
init-permissions:
|
|
7
|
+
image: alpine
|
|
8
|
+
command: chown -R 1000:1000 /config
|
|
9
|
+
volumes:
|
|
10
|
+
- ./config:/config
|
|
11
|
+
profiles: ["watch", "mcp", "import"]
|
|
12
|
+
|
|
5
13
|
# Qdrant vector database - the heart of semantic search
|
|
6
14
|
qdrant:
|
|
7
15
|
image: qdrant/qdrant:v1.15.1
|
|
@@ -24,6 +32,7 @@ services:
|
|
|
24
32
|
dockerfile: Dockerfile.importer
|
|
25
33
|
container_name: claude-reflection-importer
|
|
26
34
|
depends_on:
|
|
35
|
+
- init-permissions
|
|
27
36
|
- qdrant
|
|
28
37
|
volumes:
|
|
29
38
|
- ${CLAUDE_LOGS_PATH:-~/.claude/projects}:/logs:ro
|
|
@@ -51,6 +60,7 @@ services:
|
|
|
51
60
|
dockerfile: Dockerfile.watcher
|
|
52
61
|
container_name: claude-reflection-watcher
|
|
53
62
|
depends_on:
|
|
63
|
+
- init-permissions
|
|
54
64
|
- qdrant
|
|
55
65
|
volumes:
|
|
56
66
|
- ${CLAUDE_LOGS_PATH:-~/.claude/projects}:/logs:ro
|
|
@@ -95,4 +105,4 @@ services:
|
|
|
95
105
|
networks:
|
|
96
106
|
default:
|
|
97
107
|
name: claude-reflection-network
|
|
98
|
-
external: false
|
|
108
|
+
external: false
|