Skip to content

Commit 4cab77f

Browse files
committed
Improve docs
1 parent 7488f5c commit 4cab77f

File tree

3 files changed

+74
-71
lines changed

3 files changed

+74
-71
lines changed

docs/index.md

Lines changed: 63 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,85 @@
1-
# CTX: Context as Code (CaC) tool with MCP server inside.
2-
3-
### The missing link between your codebase and your LLM.
1+
# CTX: The missing link between your codebase and your LLM.
42

53
![Good morning, LLM](https://github.com/user-attachments/assets/8129f227-dc3f-4671-bc0e-0ecd2f3a1888)
64

7-
## What is **CTX**?
8-
9-
**CTX** is a tool made to solve a big problem when chatting with LLMs like ChatGPT or Claude: **giving them enough
10-
context about your project**.
11-
12-
> There is an article about **CTX**
13-
> on [Medium](https://medium.com/@butschster/context-not-prompts-2-0-the-evolution-9c4a84214784) that explains the
14-
> motivation behind the project and the problem it solves.
5+
**CTX** is a tool that solves the context management gap when working with LLMs like ChatGPT or Claude. It helps
6+
developers organize and automatically collect information from their codebase into structured documents that can be
7+
easily shared with AI assistants.
158

16-
Instead of manually copying or explaining your entire codebase each time, ctx automatically builds neat, organized
17-
context files from:
9+
**The tool doesn't work instead of developer - it's a tool where developers can describe their contexts and use them
10+
to provide information to LLMs.**
1811

19-
- Code files,
20-
- GitHub repositories,
21-
- Git commit changes and diffs
22-
- Web pages (URLs) with CSS selectors,
23-
- and plain text.
12+
For example, a developer describes what context they need:
2413

25-
It was created to solve a common problem: efficiently providing AI language models like ChatGPT, Claude with necessary
26-
context about your codebase.
14+
```yaml
15+
# context.yaml
16+
documents:
17+
- description: "User Authentication System"
18+
outputPath: "auth-context.md"
19+
sources:
20+
- type: file
21+
description: "Authentication Controllers"
22+
sourcePaths:
23+
- src/Auth
24+
filePattern: "*.php"
2725

28-
## CTX, CaC, and CDD: A Powerful Combination
26+
- type: file
27+
description: "Authentication Models"
28+
sourcePaths:
29+
- src/Models
30+
filePattern: "*User*.php"
31+
```
2932
30-
**CTX** is the foundational tool that enables two powerful development approaches:
33+
This configuration will gather all PHP files from the `src/Auth` directory and any PHP files containing "**User**" in
34+
their name from the `src/Models` directory into a single context file `.context/auth.md`. This file can then be pasted
35+
into a chat session or provided via the built-in [MCP server](./mcp/index.md).
3136

32-
- **CaC (Context as Code)**: An approach where code, documentation, and structure serve as explicit context for both
33-
humans and AI. With CaC, your codebase becomes self-documenting through meaningful comments, examples, and
34-
well-structured organization. CTX automatically extracts and formats this context, making it consumable by LLMs.
37+
### How it works
3538

36-
- **CDD (Claude/Context Driven Development)**: A methodology where AI assistants like Claude help generate and review
37-
code based on well-structured context, with humans providing guidance and final approval. CTX facilitates CDD by
38-
automating the context gathering process and maintaining a constant bridge between your code and the AI assistant.
39+
**CTX automatically builds structured context documents from:**
3940

40-
This virtuous cycle means better context leads to better AI assistance, which leads to better code, which in turn
41-
provides even better context.
41+
- [Code files and directories](./sources/file-source.md)
42+
- [GitHub repositories](./sources/github-source.md)
43+
- [Git commit changes and diffs](./sources/git-diff-source.md)
44+
- W[eb pages (URLs) with CSS selectors](./sources/url-source.md)
45+
- Plain text
46+
- and more!
4247

43-
> **Read more about the principles of CaC and CDD in the [Understanding CaC, CDD](/cdd.md) section.**
48+
**Process:**
4449

45-
## Why You Need This
50+
- Collects code from specified sources
51+
- Filters files through pattern matching, content search, size, or date criteria
52+
- Applies modifiers (e.g., extracting function signatures without implementation)
53+
- Organizes content into structured markdown documents
54+
- Saves context files ready for LLM consumption
55+
- Optionally serves context through MCP server for direct AI assistant access
4656

47-
When working with AI-powered development tools context is everything.
48-
49-
- **Code Refactoring Assistance**: Want AI help refactoring a complex class? **CTX** builds a properly
50-
formatted document containing all relevant code files.
57+
> Here is a [Quickstart guide](./quick-start.md) to get you started with CTX.
5158

52-
- **Multiple Iteration Development**: Working through several iterations with an AI helper requires constantly updating
53-
the context. **CTX** automates this process.
59+
### The Problem CTX Solves
5460

55-
- **Documentation Generation:** Transform your codebase into comprehensive documentation by combining source code with
56-
custom explanations. Use AI to generate user guides, API references, or developer documentation based on your actual
57-
code.
61+
**Without such a tool, you would need to:**
5862

59-
- **Reusable Prompt Libraries:** Create, share, and import collections of specialized prompts for common development
60-
tasks. Build once, use everywhere, and leverage the community's expertise without reinventing the wheel.
63+
- Manually search for all files that were changed
64+
- Copy their contents each time
65+
- Explain the codebase structure repeatedly
66+
- Spend significant time maintaining context consistency
6167

62-
- **Standardized Team Workflows:** Establish consistent AI interaction patterns across your team by sharing prompt
63-
libraries that encode best practices and domain expertise for your specific projects.
68+
This repetitive process becomes frustrating and can discourage continued development, as you end up doing the same
69+
context-gathering work over and over instead of writing code.
6470

65-
- **Seamless AI Integration**: With MCP support, [connect](/mcp-server) Claude AI directly to your codebase, allowing
66-
for real-time, context-aware assistance without manual context sharing.
71+
Since CTX describes contexts, this process becomes automated.
6772

68-
- **Automated Tool Execution**: Define [custom tools](/mcp/tools) that can be triggered through the MCP server, enabling
69-
automated code checks, builds, and other development workflows directly from your AI assistant.
73+
## Use Cases
7074

71-
## How it works
75+
When working with AI-powered development tools context is everything.
7276

73-
1. Gathers code from files, directories, GitHub repositories, web pages, or custom text.
74-
2. Targets specific files through pattern matching, content search, size, or date filters
75-
3. Applies optional modifiers (like extracting PHP signatures without implementation details)
76-
4. Organizes content into well-structured markdown documents
77-
5. Provides pre-defined prompts for common tasks that can be imported, shared, and reused
78-
6. Saves context files ready to be shared with LLMs
79-
7. Optionally serves context through an MCP server, allowing AI assistants like Claude to directly access project
80-
information
77+
- **Code Development**: Maintain up-to-date context for iterative development sessions with AI assistants. When your
78+
codebase changes, regenerate context documents to continue working with current code state.
79+
- **Code Refactoring**: Provide AI with complete context about classes, functions, and their dependencies for
80+
refactoring assistance.
81+
- **Documentation**: Generate documentation by combining source code with explanations, using AI to create guides and
82+
references based on actual code.
83+
- **Team Workflows**: Share context configurations across team members to maintain consistent AI interaction patterns.
84+
- **MCP Integration**: Connect Claude AI directly to your codebase for real-time, context-aware assistance without
85+
manual context sharing.

docs/mcp/index.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,9 @@ ensuring the AI receives precisely the information needed to assist you effectiv
105105

106106
## Setting Up
107107

108-
First of all you need to [install](https://claude.ai/download) Claude app and latest version of **CTX** (**>
109-
1.18.0**).
108+
First, you need to [install](https://claude.ai/download) Claude app and latest version of **CTX** (**>1.18.0**).
110109

111110
> **Note**: The MCP server is only available in the desktop version of Claude. The web version does not support it.
112-
>
113111
114112
### Steps
115113

docs/quick-start.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Quick Start
22

3-
Getting started with **CTX** is straightforward. Follow these simple steps to create your first context file
4-
for LLMs.
3+
Getting started with **CTX** is straightforward. Follow these steps to create your first context file for LLMs.
54

65
## 1. Install **CTX**
76

@@ -72,9 +71,10 @@ Generate your context file by running:
7271
ctx
7372
```
7473

75-
The tool will process your configuration and create the specified output file (`auth-context.md` in our example).
74+
The tool will process your configuration and create the specified output file (`.context/auth-context.md` in our
75+
example).
7676

77-
> **Tip**: Configure [Logging](/advanced/logging) with `-v`, `-vv`, or `-vvv` for detailed output
77+
> **Tip**: Configure [Logging](./getting-started/logging.md) with `-v`, `-vv`, or `-vvv` for detailed output
7878

7979
## 5. Share with an LLM
8080

@@ -86,7 +86,7 @@ Example prompt:
8686
> I've shared my authentication system code with you. Can you help me identify potential security vulnerabilities in the
8787
> user registration process?
8888

89-
> **Next steps:** Check out [Development with **CTX**](/advanced/development-process) for best practices on
89+
> **Next steps:** Check out [Development with **CTX**](./advanced/development-process.md) for best practices on
9090
> integrating context generation into your AI-powered development workflow.
9191

9292
That's it! You're now ready to leverage LLMs with proper context about your codebase.
@@ -109,7 +109,7 @@ Point the MCP client to the **CTX** server:
109109
}
110110
```
111111

112-
> **Note:** Read more about [MCP Server](/mcp-server) for detailed setup instructions.
112+
> **Note:** Read more about [MCP Server](./mcp/index.md#setting-up) for detailed setup instructions.
113113

114114
Now you can ask Claude questions about your codebase without manually uploading context files!
115115

@@ -136,7 +136,7 @@ prompts:
136136
content: "Generate a controller for the {{entityName}} entity."
137137
```
138138

139-
> **Note:** Read more about [Prompts](/mcp/prompts) for detailed configuration options.
139+
> **Note:** Read more about [Prompts](./mcp/prompts.md) for detailed configuration options.
140140

141141
Import sharable prompts from the community or create your own to enhance your workflow.
142142

@@ -173,7 +173,7 @@ tools:
173173
These tools can be executed directly by the LLM during conversations, enabling the AI to run code quality checks, tests,
174174
or other development tasks.
175175

176-
> **Note:** Read more about [Tools](/mcp/tools) for detailed configuration options and examples.
176+
> **Note:** Read more about [Tools](./mcp/tools.md) for detailed configuration options and examples.
177177

178178
## JSON Schema
179179

@@ -185,5 +185,5 @@ documents:
185185
...
186186
```
187187

188-
> **Learn more:** See [IDE Integration](/getting-started/ide-integration) for detailed setup instructions for VSCode,
189-
> PhpStorm, and other editors.
188+
> **Learn more:** See [IDE Integration](./getting-started/ide-integration.md) for detailed setup instructions for
189+
> VSCode, PhpStorm, and other editors.

0 commit comments

Comments
 (0)