codetherapy 0.1.0__tar.gz
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.
- codetherapy-0.1.0/.gitignore +7 -0
- codetherapy-0.1.0/CHANGELOG.md +40 -0
- codetherapy-0.1.0/CONTRIBUTING.md +76 -0
- codetherapy-0.1.0/LICENSE +21 -0
- codetherapy-0.1.0/PKG-INFO +326 -0
- codetherapy-0.1.0/README.md +301 -0
- codetherapy-0.1.0/SECURITY.md +63 -0
- codetherapy-0.1.0/pyproject.toml +48 -0
- codetherapy-0.1.0/src/codetherapy/__init__.py +3 -0
- codetherapy-0.1.0/src/codetherapy/__main__.py +3 -0
- codetherapy-0.1.0/src/codetherapy/cli.py +494 -0
- codetherapy-0.1.0/src/codetherapy/clipboard.py +30 -0
- codetherapy-0.1.0/src/codetherapy/config.py +99 -0
- codetherapy-0.1.0/src/codetherapy/context.py +119 -0
- codetherapy-0.1.0/src/codetherapy/deep.py +93 -0
- codetherapy-0.1.0/src/codetherapy/notes.py +58 -0
- codetherapy-0.1.0/src/codetherapy/procutil.py +35 -0
- codetherapy-0.1.0/src/codetherapy/projects.py +131 -0
- codetherapy-0.1.0/src/codetherapy/search.py +163 -0
- codetherapy-0.1.0/src/codetherapy/server.py +163 -0
- codetherapy-0.1.0/src/codetherapy/sessions.py +101 -0
- codetherapy-0.1.0/src/codetherapy/textutil.py +11 -0
- codetherapy-0.1.0/src/codetherapy/tunnel.py +134 -0
- codetherapy-0.1.0/tests/conftest.py +30 -0
- codetherapy-0.1.0/tests/fake_claude.py +30 -0
- codetherapy-0.1.0/tests/fake_ngrok.py +26 -0
- codetherapy-0.1.0/tests/helpers.py +56 -0
- codetherapy-0.1.0/tests/test_cli.py +446 -0
- codetherapy-0.1.0/tests/test_clipboard.py +19 -0
- codetherapy-0.1.0/tests/test_config.py +84 -0
- codetherapy-0.1.0/tests/test_context.py +74 -0
- codetherapy-0.1.0/tests/test_deep.py +85 -0
- codetherapy-0.1.0/tests/test_http.py +84 -0
- codetherapy-0.1.0/tests/test_notes.py +55 -0
- codetherapy-0.1.0/tests/test_projects.py +75 -0
- codetherapy-0.1.0/tests/test_search.py +179 -0
- codetherapy-0.1.0/tests/test_server.py +109 -0
- codetherapy-0.1.0/tests/test_sessions.py +50 -0
- codetherapy-0.1.0/tests/test_textutil.py +15 -0
- codetherapy-0.1.0/tests/test_tunnel.py +120 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.0] - 2026-10-16
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Six MCP tools.** Each one is built for spoken answers.
|
|
14
|
+
- `list_projects` lists your Claude Code projects, most recently active first, found from Claude Code's session logs.
|
|
15
|
+
- `get_project_brief` gives a project's overview from `CLAUDE.md` or `README.md`, its git branch and recent commits, recent sessions, and open notes.
|
|
16
|
+
- `get_recent_activity` lists Claude Code sessions and git commits over the last N days.
|
|
17
|
+
- `search_project` is a fast, literal search of file names and contents that skips secret files.
|
|
18
|
+
- `ask_project` answers deep questions with a read-only, headless `claude -p` confined to the project folder. It runs at most 2 lookups at once, each with a 90-second timeout.
|
|
19
|
+
- `record_note` appends decisions, to-dos and notes to the project's `PM_NOTES.md`.
|
|
20
|
+
- **The `codetherapy` CLI.**
|
|
21
|
+
- `setup` checks prerequisites and writes the config.
|
|
22
|
+
- `start` runs the server and tunnel, then prints and copies the connector URL.
|
|
23
|
+
- `url` prints the connector URL.
|
|
24
|
+
- `rotate` replaces the secret token.
|
|
25
|
+
- `doctor` runs end-to-end diagnostics.
|
|
26
|
+
- `serve` runs the server only.
|
|
27
|
+
- **Cross-platform config.** Settings live in a per-user `config.env` on Windows, macOS and Linux. `CODETHERAPY_*` environment variables override it, and `--config` or `CODETHERAPY_CONFIG` point to a different file.
|
|
28
|
+
- **ngrok integration.**
|
|
29
|
+
- `start` runs ngrok on your static domain and waits for the tunnel to come online.
|
|
30
|
+
- It turns ngrok errors (a missing or rejected authtoken, an agent already running, a domain already online) into plain-language hints.
|
|
31
|
+
- On Windows it finds winget installs that aren't on the PATH yet.
|
|
32
|
+
- `setup --no-tunnel --public-host` lets you bring your own tunnel instead.
|
|
33
|
+
- **Security.**
|
|
34
|
+
- The token is a 256-bit secret in the URL path.
|
|
35
|
+
- The server binds to 127.0.0.1 only, and every other path returns 404.
|
|
36
|
+
- DNS-rebinding protection is on, and request paths are never logged.
|
|
37
|
+
- `ask_project` and `search_project` refuse a project that is your whole home folder.
|
|
38
|
+
|
|
39
|
+
[Unreleased]: https://github.com/Rapideo/codetherapy/compare/v0.1.0...HEAD
|
|
40
|
+
[0.1.0]: https://github.com/Rapideo/codetherapy/releases/tag/v0.1.0
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Contributing to Code Therapy
|
|
2
|
+
|
|
3
|
+
Thanks for helping. Bug reports, fixes and new PM tools are all welcome. For anything big, please open an issue first so we can agree on the shape of it.
|
|
4
|
+
|
|
5
|
+
## Dev setup
|
|
6
|
+
|
|
7
|
+
You need [uv](https://docs.astral.sh/uv/) and git.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
git clone https://github.com/Rapideo/codetherapy.git
|
|
11
|
+
cd codetherapy
|
|
12
|
+
uv sync
|
|
13
|
+
uv run pytest
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The tests use stand-ins for `claude` and `ngrok` (`tests/fake_claude.py` and `tests/fake_ngrok.py`), so you don't need either installed, or an internet connection.
|
|
17
|
+
|
|
18
|
+
## Running locally
|
|
19
|
+
|
|
20
|
+
Use a throwaway config file, so you don't touch your real one. This runs the server without a tunnel:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
uv run codetherapy --config ./dev.env setup --no-tunnel --public-host example.test --yes
|
|
24
|
+
uv run codetherapy --config ./dev.env start --no-tunnel
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The server listens on 127.0.0.1:8765. If that port is taken, pass `--port N` to both commands.
|
|
28
|
+
|
|
29
|
+
`example.test` isn't a real host, so the `https://example.test/...` URL that `start` prints won't reach anything. Connect locally instead:
|
|
30
|
+
|
|
31
|
+
- Point any MCP client that speaks Streamable HTTP at `http://127.0.0.1:8765/mcp/<token>`.
|
|
32
|
+
- The token is `CODETHERAPY_TOKEN` in `dev.env`. You can also run `uv run codetherapy --config ./dev.env url` and swap `https://example.test` for `http://127.0.0.1:8765`.
|
|
33
|
+
|
|
34
|
+
`uv run codetherapy --config ./dev.env doctor` checks the local endpoint. Its public-endpoint check is expected to fail for `example.test`.
|
|
35
|
+
|
|
36
|
+
Don't commit `dev.env`, because it contains a token. It's already in `.gitignore`.
|
|
37
|
+
|
|
38
|
+
## Project layout
|
|
39
|
+
|
|
40
|
+
| Module | What it does |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `src/codetherapy/cli.py` | The `codetherapy` command: `setup`, `start`, `url`, `rotate`, `doctor` and `serve` |
|
|
43
|
+
| `src/codetherapy/config.py` | Per-user config file location, reading and writing, `CODETHERAPY_*` overrides, and token generation |
|
|
44
|
+
| `src/codetherapy/server.py` | The six MCP tools, the server instructions, and the token-guarded Streamable HTTP app |
|
|
45
|
+
| `src/codetherapy/projects.py` | Discovering projects from `~/.claude/projects` and resolving spoken names to them |
|
|
46
|
+
| `src/codetherapy/sessions.py` | Reading Claude Code session logs to get titles, prompts and the working directory |
|
|
47
|
+
| `src/codetherapy/context.py` | Project briefs and recent activity built from docs, git and sessions |
|
|
48
|
+
| `src/codetherapy/search.py` | Fast literal search that skips secret files |
|
|
49
|
+
| `src/codetherapy/deep.py` | The read-only headless `claude -p` behind `ask_project` |
|
|
50
|
+
| `src/codetherapy/notes.py` | `PM_NOTES.md`, the only file the server writes |
|
|
51
|
+
| `src/codetherapy/tunnel.py` | Finding and running ngrok, and turning its log lines into hints |
|
|
52
|
+
| `src/codetherapy/clipboard.py` | Best-effort clipboard copy |
|
|
53
|
+
| `src/codetherapy/procutil.py` | Process groups and killing a whole process tree |
|
|
54
|
+
| `src/codetherapy/textutil.py` | Small string helpers |
|
|
55
|
+
| `src/codetherapy/__main__.py` | `python -m codetherapy` |
|
|
56
|
+
| `tests/` | pytest suite, with fakes for `claude` and `ngrok` and helpers that build fake session logs and git repos |
|
|
57
|
+
|
|
58
|
+
## Style
|
|
59
|
+
|
|
60
|
+
- **Keep modules small and focused.** Each one does one job, and the table above should stay true.
|
|
61
|
+
- **Use the stdlib first.** The runtime dependencies are `mcp` and `uvicorn`. Please discuss any new runtime dependency in an issue before adding it.
|
|
62
|
+
- **Use TDD.** Write a failing test first, then make it pass. Every change to behavior comes with a test.
|
|
63
|
+
- **Never log tokens.**
|
|
64
|
+
- The token and connector URL are printed only by `codetherapy url` and the `start` banner.
|
|
65
|
+
- Request paths aren't logged, because the token is in every path.
|
|
66
|
+
- Error messages that might contain the URL must redact it.
|
|
67
|
+
- **Write output that sounds right spoken.** Tool results are often read aloud: keep them short, lead with the status, and avoid tables and code blocks.
|
|
68
|
+
- **Keep it cross-platform.** Code must work on Windows, macOS and Linux. Use `pathlib`, and don't depend on a particular shell.
|
|
69
|
+
|
|
70
|
+
## Pull request checklist
|
|
71
|
+
|
|
72
|
+
- [ ] `uv run pytest` passes.
|
|
73
|
+
- [ ] New behavior has tests.
|
|
74
|
+
- [ ] `README.md` and `CHANGELOG.md` are updated, if users will notice the change.
|
|
75
|
+
- [ ] No token, connector URL, or personal path appears in code, tests, logs or docs.
|
|
76
|
+
- [ ] No new runtime dependency, or one that was agreed in an issue.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rapideo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: codetherapy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Talk to your Claude Code projects — by voice, from the Claude app — about how they're doing.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Rapideo/codetherapy
|
|
6
|
+
Project-URL: Issues, https://github.com/Rapideo/codetherapy/issues
|
|
7
|
+
Project-URL: Changelog, https://github.com/Rapideo/codetherapy/blob/main/CHANGELOG.md
|
|
8
|
+
Author: Rapideo
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: claude,claude-code,connector,mcp,mcp-server,project-management,voice
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Software Development
|
|
21
|
+
Requires-Python: >=3.12
|
|
22
|
+
Requires-Dist: mcp<3,>=2.3
|
|
23
|
+
Requires-Dist: uvicorn>=0.31
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# Code Therapy
|
|
27
|
+
|
|
28
|
+
*"Lie back. Tell me about your repo."*
|
|
29
|
+
|
|
30
|
+
[](https://pypi.org/project/codetherapy/)
|
|
31
|
+
[](https://pypi.org/project/codetherapy/)
|
|
32
|
+
[](https://github.com/Rapideo/codetherapy/actions/workflows/ci.yml)
|
|
33
|
+
[](https://github.com/Rapideo/codetherapy/blob/main/LICENSE)
|
|
34
|
+
|
|
35
|
+
Code Therapy is an MCP connector that lets you talk with an AI project manager that knows every Claude Code project on your machine. You can talk to it by voice in the Claude app, or type to it on claude.ai. It runs on your computer and reads your Claude Code session history, git, and project docs. From that it tells you where each project stands and what you worked on, finds things in the code, answers deeper questions, and writes your decisions back into the repo for your next coding session.
|
|
36
|
+
|
|
37
|
+
You're the manager. This is you checking in with your code about how it's doing.
|
|
38
|
+
|
|
39
|
+
## A session, in practice
|
|
40
|
+
|
|
41
|
+
> **You:** How's acme-api doing?
|
|
42
|
+
>
|
|
43
|
+
> **Claude:** acme-api is on the `rate-limits` branch with two uncommitted files. Your last session was "Add per-key rate limiting", and one to-do is still open: write the migration for the keys table.
|
|
44
|
+
>
|
|
45
|
+
> **You:** And what did I get done on storefront this week?
|
|
46
|
+
>
|
|
47
|
+
> **Claude:** Four sessions and nine commits. You finished the checkout redesign, fixed the coupon rounding bug, and started on order emails.
|
|
48
|
+
>
|
|
49
|
+
> **You:** Where's the rate limiter in acme-api? And how does it decide a key is over the limit?
|
|
50
|
+
>
|
|
51
|
+
> **Claude:** It's in `src/middleware/rate_limit.py`. For the how, I'll have Claude Code read the code, which can take up to a minute... It keeps a sliding one-minute window per API key and returns a 429 once the count passes that key's plan limit.
|
|
52
|
+
>
|
|
53
|
+
> **You:** Let's make the free tier 100 requests a minute. Write that down as a decision.
|
|
54
|
+
>
|
|
55
|
+
> **Claude:** Saved to acme-api's `PM_NOTES.md`: "DECISION: Free tier is 100 requests a minute."
|
|
56
|
+
|
|
57
|
+
## How it works
|
|
58
|
+
|
|
59
|
+
```mermaid
|
|
60
|
+
flowchart LR
|
|
61
|
+
claudeApp["claude.ai / Claude app<br/>(via Anthropic's cloud)"] -->|HTTPS| tunnel["ngrok static domain<br/>name.ngrok-free.dev"]
|
|
62
|
+
subgraph machine["Your machine"]
|
|
63
|
+
ctServer["codetherapy<br/>127.0.0.1:8765"]
|
|
64
|
+
sessionLogs["~/.claude/projects<br/>session logs"]
|
|
65
|
+
gitRepo["git"]
|
|
66
|
+
projectDocs["CLAUDE.md / README.md"]
|
|
67
|
+
pmNotes["PM_NOTES.md"]
|
|
68
|
+
claudeP["claude -p<br/>(read-only)"]
|
|
69
|
+
ctServer --> sessionLogs
|
|
70
|
+
ctServer --> gitRepo
|
|
71
|
+
ctServer --> projectDocs
|
|
72
|
+
ctServer -->|append only| pmNotes
|
|
73
|
+
ctServer --> claudeP
|
|
74
|
+
end
|
|
75
|
+
tunnel --> ctServer
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Claude calls your connector from Anthropic's cloud over HTTPS, and ngrok forwards each request to the `codetherapy` server, which listens only on 127.0.0.1. The server finds your projects in Claude Code's own session logs under `~/.claude/projects`, then builds briefs, activity and search results from those logs, git, and the project files, without calling any AI model. Deep questions run your own `claude` CLI headless and read-only inside the project folder, and decisions are appended to `PM_NOTES.md`. Nothing is uploaded on its own: tool results go to Claude in your conversation, and `ask_project`'s Claude Code sends the files it reads to Anthropic, just like a normal Claude Code session. ngrok relays the traffic and can see it (see the [security model](https://github.com/Rapideo/codetherapy#security-model)).
|
|
79
|
+
|
|
80
|
+
## Requirements
|
|
81
|
+
|
|
82
|
+
- A Claude **Pro, Max, Team or Enterprise** plan, for custom connectors.
|
|
83
|
+
- **Claude Code**, installed and used at least once in each project you want to talk about. The `claude` CLI must be on your PATH and logged in for `ask_project`. The other tools work without it.
|
|
84
|
+
- **Python 3.12+** via [uv](https://docs.astral.sh/uv/). uv installs Python for you if you need it.
|
|
85
|
+
- A free [ngrok](https://ngrok.com) account, or [your own tunnel](https://github.com/Rapideo/codetherapy#bring-your-own-tunnel).
|
|
86
|
+
- Windows, macOS or Linux.
|
|
87
|
+
|
|
88
|
+
## Quick start
|
|
89
|
+
|
|
90
|
+
0. **Before you start, do these once.**
|
|
91
|
+
- Install [uv](https://docs.astral.sh/uv/getting-started/installation/).
|
|
92
|
+
- Set up ngrok: install it, run `ngrok config add-authtoken <token>`, and copy your free static domain. See [ngrok, once](https://github.com/Rapideo/codetherapy#ngrok-once) for the details.
|
|
93
|
+
1. Install it with `uv tool install codetherapy`. If your shell then can't find `codetherapy`, run `uv tool update-shell` and open a new terminal. You can also run any command without installing, as `uvx codetherapy …`.
|
|
94
|
+
2. Run `codetherapy setup`. It checks your prerequisites and asks for your ngrok domain.
|
|
95
|
+
3. Run `codetherapy start`, and leave it running. It prints your connector URL and copies it to the clipboard.
|
|
96
|
+
4. Open <https://claude.ai/settings/connectors>, choose **Add custom connector**, and paste the URL. Then ask Claude, "What projects do I have?"
|
|
97
|
+
|
|
98
|
+
## Detailed setup
|
|
99
|
+
|
|
100
|
+
### ngrok, once
|
|
101
|
+
|
|
102
|
+
1. Sign up at <https://dashboard.ngrok.com/signup>. The free plan is enough.
|
|
103
|
+
2. Install ngrok:
|
|
104
|
+
- **Windows:** `winget install ngrok.ngrok`
|
|
105
|
+
- **macOS:** `brew install ngrok`
|
|
106
|
+
- **Linux:** follow <https://ngrok.com/download>
|
|
107
|
+
3. Copy your authtoken from <https://dashboard.ngrok.com/get-started/your-authtoken> and run:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
ngrok config add-authtoken <token>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
4. Find your free static domain under **Dashboard → Domains**. It looks like `name.ngrok-free.dev`. Using that domain keeps your connector URL the same every time you start.
|
|
114
|
+
|
|
115
|
+
### `codetherapy setup`
|
|
116
|
+
|
|
117
|
+
`setup` prints the config file it's using, then checks:
|
|
118
|
+
|
|
119
|
+
- that `claude` is on your PATH. If it isn't, you get a warning only, because only `ask_project` needs it.
|
|
120
|
+
- that ngrok is installed. On Windows it also looks in winget's install folders, since winget doesn't update the PATH of the shell you're already in.
|
|
121
|
+
- that ngrok has an authtoken.
|
|
122
|
+
|
|
123
|
+
It then asks for your ngrok static domain, unless you passed `--public-host` or saved one before. You can paste it with or without `https://`. It generates a random token and saves everything. If you run `setup` again, it keeps your token and any setting you don't change. Pass `--rotate` if you want a new token.
|
|
124
|
+
|
|
125
|
+
The config file is `config.env` in your per-user config folder:
|
|
126
|
+
|
|
127
|
+
| OS | Location |
|
|
128
|
+
|---|---|
|
|
129
|
+
| Windows | `%APPDATA%\codetherapy\config.env` |
|
|
130
|
+
| macOS | `~/Library/Application Support/codetherapy/config.env` |
|
|
131
|
+
| Linux | `$XDG_CONFIG_HOME/codetherapy/config.env` (default `~/.config/codetherapy/config.env`) |
|
|
132
|
+
|
|
133
|
+
On macOS and Linux the file is created with mode 600. It holds these keys:
|
|
134
|
+
|
|
135
|
+
- `CODETHERAPY_TOKEN`
|
|
136
|
+
- `CODETHERAPY_PUBLIC_HOST`
|
|
137
|
+
- `CODETHERAPY_PORT`, which defaults to 8765
|
|
138
|
+
- `CODETHERAPY_TUNNEL`, which is `ngrok` (the default) or `none`
|
|
139
|
+
- `CODETHERAPY_PROJECTS_DIR`, which defaults to `~/.claude/projects`
|
|
140
|
+
|
|
141
|
+
Environment variables with the same names override the file. To use a different file, pass `--config PATH` or set `CODETHERAPY_CONFIG`.
|
|
142
|
+
|
|
143
|
+
### Connecting claude.ai
|
|
144
|
+
|
|
145
|
+
- **Add the connector on the web.** Go to <https://claude.ai/settings/connectors> → **Add custom connector**, name it "Code Therapy", and paste the URL from `codetherapy start` (or `codetherapy url`). Leave the OAuth fields empty. On Team and Enterprise plans, an owner may need to allow custom connectors first.
|
|
146
|
+
- **Use it anywhere.** Once added, the connector appears in the Claude mobile and desktop apps too. You don't add it again there.
|
|
147
|
+
- **Turn it on in a chat.** Enable Code Therapy from the tools menu in the chat composer.
|
|
148
|
+
- **Allow it on first use.** The first time Claude calls one of its tools, claude.ai asks for permission. Allow it, or choose to always allow it.
|
|
149
|
+
|
|
150
|
+
### Voice mode
|
|
151
|
+
|
|
152
|
+
Many people use custom connectors in the Claude app's voice mode, and Code Therapy is written for it: answers are short, spoken-style, and lead with the status. However, Anthropic doesn't officially document voice-mode support for custom connectors. If voice doesn't call the tools for you, text chat always works.
|
|
153
|
+
|
|
154
|
+
## What to say
|
|
155
|
+
|
|
156
|
+
| Tool | What it's for | Try saying | Speed |
|
|
157
|
+
|---|---|---|---|
|
|
158
|
+
| `list_projects` | Your Claude Code projects, most recently active first, with each one's latest session title | "What projects do I have?" | Fast |
|
|
159
|
+
| `get_project_brief` | Where a project stands: overview from `CLAUDE.md` or `README.md`, git branch and recent commits, recent sessions, and open notes | "How's acme-api doing?" | Fast |
|
|
160
|
+
| `get_recent_activity` | Sessions and commits over the last N days (7 by default) | "What did I do on storefront this week?" | Fast |
|
|
161
|
+
| `search_project` | Literal, case-insensitive search of file names and contents. It returns up to 20 matches | "Where's the rate limiter in acme-api?" | About 1 second |
|
|
162
|
+
| `ask_project` | A deep answer about how the code works, from read-only Claude Code | "How does storefront calculate shipping?" | Slow, 20–90 seconds |
|
|
163
|
+
| `record_note` | Saves a decision, to-do or note to the project's `PM_NOTES.md` | "Write that down as a decision." | Fast |
|
|
164
|
+
|
|
165
|
+
You don't need to say tool names. Just talk about your projects, and Claude picks the tool. Project names are matched loosely, so "acme api" finds `acme-api`. Claude says so before it starts a slow `ask_project` lookup.
|
|
166
|
+
|
|
167
|
+
## Notes back into your coding session
|
|
168
|
+
|
|
169
|
+
`record_note` appends timestamped lines like `- [2026-10-16 09:30] **DECISION:** …` to `PM_NOTES.md` in the project folder. That's the only file Code Therapy writes in your projects. Its own config file lives elsewhere. Open notes also show up in `get_project_brief`.
|
|
170
|
+
|
|
171
|
+
Claude Code doesn't load `PM_NOTES.md` by itself, and Code Therapy never edits your `CLAUDE.md`. To have your next coding session pick up the notes, add this line to the project's `CLAUDE.md` once:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
@PM_NOTES.md
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Or just start the session with "read PM_NOTES.md".
|
|
178
|
+
|
|
179
|
+
## Commands
|
|
180
|
+
|
|
181
|
+
All commands accept `--config PATH` before the command name, as in `codetherapy --config ./dev.env start`. Use `codetherapy --version` to print the version.
|
|
182
|
+
|
|
183
|
+
| Command | What it does | Flags |
|
|
184
|
+
|---|---|---|
|
|
185
|
+
| `setup` | Checks prerequisites and writes the config file | `--public-host HOST` sets your public hostname, such as your ngrok domain.<br>`--no-tunnel` means you bring your own tunnel and requires a public host.<br>`--ngrok` switches back to the built-in ngrok tunnel. You can't combine it with `--no-tunnel`.<br>`--port N` sets the local port, 1–65535 (default 8765).<br>`--projects-dir DIR` sets where Claude Code's projects live.<br>`--rotate` generates a new token.<br>`--yes` never prompts. |
|
|
186
|
+
| `start` | Runs the server and ngrok, prints the connector URL and copies it. Press Ctrl+C to stop both | `--no-tunnel` skips ngrok for this run.<br>`--port N` uses a different local port for this run.<br>`--public-host HOST` uses a different public hostname for this run. |
|
|
187
|
+
| `url` | Prints the connector URL | `--copy` also copies it to the clipboard. |
|
|
188
|
+
| `rotate` | Replaces the token. This revokes the old URL once you restart `codetherapy start` | None. |
|
|
189
|
+
| `doctor` | Checks the config, prerequisites, and the local and public endpoints | `--port N` checks this port, if you ran `start --port N`. |
|
|
190
|
+
| `serve` | Runs only the server, with no tunnel, for your own process manager | None. |
|
|
191
|
+
|
|
192
|
+
## Security model
|
|
193
|
+
|
|
194
|
+
- **The URL is the password.** The connector URL contains a 256-bit random secret, and it's the only credential. Treat it like a password and don't share it. `codetherapy rotate` replaces it. This revokes the old URL once you restart `codetherapy start`. Then update the URL on claude.ai.
|
|
195
|
+
- **Small attack surface.** The server binds to 127.0.0.1 only. Every path except the secret one returns 404, and DNS-rebinding protection is on, so only your public host and localhost are accepted. Request paths are never logged.
|
|
196
|
+
- **Read-only.** The only exception is appending to `PM_NOTES.md`.
|
|
197
|
+
- **`ask_project` is locked down.**
|
|
198
|
+
- It runs `claude -p` with only the Read, Grep and Glob tools, and they're confined to the project folder.
|
|
199
|
+
- Reading `~/.claude`, `~/.claude.json`, `~/.ssh` and `~/AppData` is always denied, as is reading the config of Code Therapy, ngrok, `gh`, Docker, kubectl and PyPI. So is reading the secret files listed in the next point.
|
|
200
|
+
- Claude Code applies these Read deny rules to Grep and Glob too, but only on a best-effort basis.
|
|
201
|
+
- A project that is your whole home folder (because you ran `claude` from `~`), or a folder above it, is refused. `search_project` refuses it too. Open Claude Code in a specific project folder instead.
|
|
202
|
+
- It runs in restricted mode with no MCP servers, and it can't run commands, edit files or browse the web.
|
|
203
|
+
- At most 2 lookups run at once, each with a 90-second timeout.
|
|
204
|
+
- **Secret files are skipped by name.** `search_project` never reads them, and `ask_project` is denied reading them (best-effort for Grep and Glob, as above). The list is:
|
|
205
|
+
- `.env` and `.env.*`
|
|
206
|
+
- `.envrc`, `.npmrc`, `.netrc` and `.pgpass`
|
|
207
|
+
- keys and certificates: `*.pem`, `*.key`, `*.p12`, `*.pfx`, `*.keystore`, `*.jks`, `id_rsa*` and `id_ed25519*`
|
|
208
|
+
- any file with "credentials" or "secret" in its name
|
|
209
|
+
- anything inside `.ssh`, `.aws` or `.gnupg` folders
|
|
210
|
+
- **What it can see.** It can read anything else inside your project folders. That includes secrets committed under other names, such as a token in `config.yaml`. If a project holds something you wouldn't read aloud, keep it out of that folder.
|
|
211
|
+
- **Your tunnel provider can see your traffic.** ngrok terminates TLS at its edge, and so does a Cloudflare tunnel. That means the provider can see request paths, including the token, as well as tool results. Tailscale Funnel is the exception among the [tunnels described here](https://github.com/Rapideo/codetherapy#bring-your-own-tunnel), because it terminates TLS on your own device.
|
|
212
|
+
- **No telemetry.** Code Therapy doesn't phone home.
|
|
213
|
+
- **OAuth sign-in is on the roadmap**, as an alternative to the secret URL.
|
|
214
|
+
|
|
215
|
+
To report a vulnerability, see [SECURITY.md](https://github.com/Rapideo/codetherapy/blob/main/SECURITY.md).
|
|
216
|
+
|
|
217
|
+
## Bring your own tunnel
|
|
218
|
+
|
|
219
|
+
Any tunnel works as long as it gives you a **stable public HTTPS hostname** that forwards to `http://127.0.0.1:8765`. First tell Code Therapy the hostname and that it shouldn't start ngrok:
|
|
220
|
+
|
|
221
|
+
```sh
|
|
222
|
+
codetherapy setup --no-tunnel --public-host <your hostname>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Then start your tunnel, and run `codetherapy start` as usual.
|
|
226
|
+
|
|
227
|
+
**Tailscale Funnel.** This gives you a stable `*.ts.net` name:
|
|
228
|
+
|
|
229
|
+
```sh
|
|
230
|
+
codetherapy setup --no-tunnel --public-host box.tailnet.ts.net
|
|
231
|
+
tailscale funnel 8765
|
|
232
|
+
codetherapy start
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Run `tailscale funnel` in its own terminal, or add `--bg` to keep it running in the background. Funnel needs to be enabled for your tailnet. See <https://tailscale.com/kb/1223/funnel>.
|
|
236
|
+
|
|
237
|
+
**Cloudflare named tunnel.** If you have a domain on Cloudflare, point a named tunnel's ingress at the server:
|
|
238
|
+
|
|
239
|
+
```yaml
|
|
240
|
+
# ~/.cloudflared/config.yml
|
|
241
|
+
tunnel: <tunnel-id>
|
|
242
|
+
credentials-file: /path/to/<tunnel-id>.json
|
|
243
|
+
ingress:
|
|
244
|
+
- hostname: codetherapy.example.com
|
|
245
|
+
service: http://127.0.0.1:8765
|
|
246
|
+
- service: http_status:404
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
```sh
|
|
250
|
+
codetherapy setup --no-tunnel --public-host codetherapy.example.com
|
|
251
|
+
cloudflared tunnel run <tunnel-name>
|
|
252
|
+
codetherapy start
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
**Cloudflare quick tunnels won't work.** A quick tunnel (`trycloudflare.com`) gets a new URL every time it starts, so your connector would break on every restart.
|
|
256
|
+
|
|
257
|
+
To go back to ngrok, run `codetherapy setup --ngrok`.
|
|
258
|
+
|
|
259
|
+
## Troubleshooting
|
|
260
|
+
|
|
261
|
+
Run **`codetherapy doctor`** first. It checks:
|
|
262
|
+
|
|
263
|
+
- that your config loads and `claude` is installed
|
|
264
|
+
- that ngrok is installed and has its authtoken, if you use the ngrok tunnel
|
|
265
|
+
- whether the server is running
|
|
266
|
+
- that the local endpoint answers with all six tools
|
|
267
|
+
- that the public endpoint answers through your tunnel
|
|
268
|
+
|
|
269
|
+
It reports each problem in plain language.
|
|
270
|
+
|
|
271
|
+
**"port 8765 is in use — is Code Therapy already running?"**
|
|
272
|
+
|
|
273
|
+
- Another `codetherapy start` is probably still running, perhaps in another terminal. Stop it with Ctrl+C.
|
|
274
|
+
- If something else owns the port, use another one: `codetherapy start --port 8766` for one run, or `codetherapy setup --port 8766` to keep it. Use the same port with `doctor --port`.
|
|
275
|
+
|
|
276
|
+
**ngrok errors.** `start` translates ngrok's errors into hints:
|
|
277
|
+
|
|
278
|
+
- **No authtoken, or a rejected one.** Copy it again from <https://dashboard.ngrok.com/get-started/your-authtoken> and run `ngrok config add-authtoken <token>`.
|
|
279
|
+
- **Already running, or the domain is already online.** The free plan allows one ngrok agent at a time. Stop the other ngrok (another terminal, another computer, or an old `start` still running), then try again.
|
|
280
|
+
|
|
281
|
+
**claude.ai says it couldn't connect.**
|
|
282
|
+
|
|
283
|
+
- `codetherapy start` must be running when you use the connector. Your computer has to be awake.
|
|
284
|
+
- Run `codetherapy doctor`. If the local endpoint works but the public one doesn't, the problem is the tunnel.
|
|
285
|
+
- Make sure you pasted the whole URL, including the `/mcp/…` part. `codetherapy url` prints it again.
|
|
286
|
+
- If you ran `rotate`, update the connector URL on claude.ai.
|
|
287
|
+
|
|
288
|
+
**A project is missing from `list_projects`.**
|
|
289
|
+
|
|
290
|
+
- Projects are discovered from Claude Code's session logs, and Claude Code deletes old logs (after 30 days by default). So only folders with Claude Code session history in roughly the last 30 days show up. To bring one back, open Claude Code in that folder once. It appears within a minute.
|
|
291
|
+
- `list_projects` shows the 15 most recent projects. Ask for an older one by name.
|
|
292
|
+
|
|
293
|
+
**`ask_project` times out or fails.**
|
|
294
|
+
|
|
295
|
+
- Lookups stop after 90 seconds. For questions that big, ask in Claude Code directly.
|
|
296
|
+
- Only 2 lookups run at once. If another is running, Claude is told to try again shortly.
|
|
297
|
+
- Check that `claude` is on your PATH and logged in. Try `claude -p "hello"` in a terminal.
|
|
298
|
+
- For "where is…" questions, `search_project` is much faster.
|
|
299
|
+
|
|
300
|
+
## FAQ
|
|
301
|
+
|
|
302
|
+
**Does my code go to Anthropic?**
|
|
303
|
+
Only what's needed to answer you. Tool results go to Claude in your conversation: briefs include paths, commit messages and recent session prompts, and searches include matching lines. When `ask_project` runs, Claude Code sends the files it reads to Anthropic, the same as any Claude Code session. Nothing is uploaded on its own.
|
|
304
|
+
|
|
305
|
+
**Does it cost API credits?**
|
|
306
|
+
The fast tools don't call any model. `ask_project` runs your own logged-in `claude` CLI, so it uses your Claude Code plan, or your API key if your `claude` is configured with one. It's the same as running Claude Code yourself.
|
|
307
|
+
|
|
308
|
+
**Can my team use one instance?**
|
|
309
|
+
No. It's single-user: one person's machine, one person's projects, one secret URL. Each person runs their own.
|
|
310
|
+
|
|
311
|
+
**Why "therapy"?**
|
|
312
|
+
You lie back (on the couch, on the bus, on a walk) and ask your repos how they're doing. They tell you what's been on their mind this week, what's bothering them, and the decisions they keep putting off. There's no couch fee, and the notes go into `PM_NOTES.md` instead of a file folder.
|
|
313
|
+
|
|
314
|
+
## Roadmap
|
|
315
|
+
|
|
316
|
+
- OAuth sign-in for claude.ai, as an alternative to the secret URL
|
|
317
|
+
- An autostart service, so the connector is running whenever your machine is
|
|
318
|
+
- Discovering older projects from Claude Code memory files, not just recent session logs
|
|
319
|
+
- A listing in the MCP Registry
|
|
320
|
+
- More PM tools
|
|
321
|
+
|
|
322
|
+
## Contributing and license
|
|
323
|
+
|
|
324
|
+
Contributions are welcome. See [CONTRIBUTING.md](https://github.com/Rapideo/codetherapy/blob/main/CONTRIBUTING.md) for dev setup and the PR checklist, and [CHANGELOG.md](https://github.com/Rapideo/codetherapy/blob/main/CHANGELOG.md) for what's changed. Code Therapy is released under the [MIT License](https://github.com/Rapideo/codetherapy/blob/main/LICENSE).
|
|
325
|
+
|
|
326
|
+
<!-- mcp-name: io.github.rapideo/codetherapy -->
|