Skip to content

Commit fd8b9b1

Browse files
Rewrite docs to be customer-friendly without technical jargon
- Renamed from 'scope-keys' to 'context-inheritance' - Removed technical terms like 'scope key' throughout - Focused on when users should expect context vs fresh starts - Added clear examples of good vs bad interaction patterns - Emphasized practical scenarios and troubleshooting
1 parent 603f783 commit fd8b9b1

3 files changed

Lines changed: 142 additions & 157 deletions

File tree

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: "Context Inheritance: When Codegen Remembers Previous Work"
3+
description: "Understanding when Codegen builds on previous conversations and when it starts fresh"
4+
---
5+
6+
# Context Inheritance: When Codegen Remembers Previous Work
7+
8+
Codegen is designed to build on previous work and maintain context across related interactions. Understanding when this happens helps you work more effectively and avoid frustrating experiences like getting multiple PRs when you wanted updates to an existing one.
9+
10+
## When Codegen Remembers Context
11+
12+
Codegen automatically inherits context and builds on previous work when you interact within the same "conversation scope." Here's when this happens:
13+
14+
### Slack Threads
15+
**Codegen remembers everything in the same thread**
16+
17+
When you mention Codegen in a Slack thread, it can see and build on all previous messages in that thread. This means:
18+
- Follow-up requests build on previous work
19+
- Codegen remembers the entire conversation history
20+
- Context from earlier messages is automatically available
21+
22+
```
23+
Thread: "Can you fix the login bug?"
24+
├── Codegen creates PR #123
25+
└── "Please also add input validation"
26+
└── Codegen adds commits to PR #123 (same PR!)
27+
```
28+
29+
### Linear Issues
30+
**Codegen remembers all work on the same ticket**
31+
32+
All interactions on the same Linear issue share context. This enables:
33+
- Building on previous implementations
34+
- Maintaining context across multiple comments
35+
- Continuing work where you left off
36+
37+
```
38+
Linear Issue CG-456: "Improve test coverage"
39+
├── Comment: "Add tests for auth module"
40+
│ └── Codegen creates PR #789
41+
└── Comment: "Also need integration tests"
42+
└── Codegen adds to PR #789 (same PR!)
43+
```
44+
45+
### GitHub PRs
46+
**Codegen remembers all work on the same pull request**
47+
48+
When you comment on a PR that Codegen created, it will:
49+
- Add commits to the existing PR
50+
- Respond to review feedback
51+
- Continue iterating on the same feature branch
52+
53+
```
54+
PR #123: "Add user authentication"
55+
├── Initial PR created
56+
├── Review comment: "Fix the validation logic"
57+
│ └── Codegen adds fixing commit
58+
└── Review comment: "Add error handling"
59+
└── Codegen adds another commit (same PR!)
60+
```
61+
62+
## When Codegen Starts Fresh
63+
64+
Codegen will start a new conversation (and potentially create new PRs) when:
65+
66+
- **New Slack threads** - Starting a new thread breaks the context
67+
- **New Linear tickets** - Different tickets are treated as separate work
68+
- **Different repositories** - Work in different repos doesn't share context
69+
- **API calls without context** - Direct API calls start fresh unless context is provided
70+
71+
## Why This Matters
72+
73+
### ✅ Working With Context (Good Experience)
74+
```
75+
Slack Thread:
76+
You: "Create a PR to fix the login bug"
77+
Codegen: Creates PR #123
78+
79+
You: "Please also add input validation"
80+
Codegen: Adds commits to PR #123 ← Same PR!
81+
82+
You: "The tests are failing"
83+
Codegen: Fixes tests in PR #123 ← Still same PR!
84+
```
85+
86+
### ❌ Breaking Context (Frustrating Experience)
87+
```
88+
You: "Create a PR to fix the login bug"
89+
Codegen: Creates PR #123
90+
91+
[You start a new Slack thread]
92+
You: "Please also add input validation"
93+
Codegen: Creates PR #124 ← New PR! 😞
94+
95+
[You create a new Linear ticket]
96+
You: "The tests are failing"
97+
Codegen: Creates PR #125 ← Another new PR! 😞
98+
```
99+
100+
## Best Practices
101+
102+
### Do This ✅
103+
- **Continue conversations in the same thread/ticket** - This ensures context is inherited
104+
- **Ask for changes in the same place** - Codegen will update existing work
105+
- **Reference previous work** - Codegen can build on what it already knows
106+
- **Use reply threads in Slack** - Keep related work together
107+
108+
### Avoid This ❌
109+
- **Starting new threads for related work** - Context gets lost
110+
- **Creating new tickets for follow-ups** - Breaks the context chain
111+
- **Asking for "new PRs" unnecessarily** - Usually you want to update existing work
112+
- **Switching between different communication channels** - Each channel has separate context
113+
114+
## Common Scenarios
115+
116+
**Scenario**: "I asked Codegen to create a PR, but now I want to add more features to it"
117+
**Solution**: Ask for the changes in the same Slack thread or Linear ticket where you made the original request.
118+
119+
**Scenario**: "Codegen created multiple PRs for what should be one feature"
120+
**Solution**: Make sure all related requests happen in the same conversation thread.
121+
122+
**Scenario**: "I want Codegen to start completely fresh on a similar but different task"
123+
**Solution**: Start a new Slack thread or create a new Linear ticket to break context inheritance.
124+
125+
## Troubleshooting
126+
127+
**Problem**: Codegen keeps creating new PRs instead of updating existing ones
128+
**Solution**: Make sure you're asking for changes in the same Slack thread or Linear issue where the original work was done.
129+
130+
**Problem**: Codegen doesn't remember previous context
131+
**Solution**: Check that you're interacting in the same conversation thread as the previous interaction.
132+
133+
**Problem**: Codegen is building on unrelated previous work
134+
**Solution**: You might be in a thread with previous unrelated work - consider starting a new thread for your task.
135+
136+
---
137+
138+
Understanding when Codegen inherits context helps you work more effectively by ensuring your requests build on each other rather than starting from scratch each time.
139+

docs/architecture/scope-keys.mdx

Lines changed: 0 additions & 156 deletions
This file was deleted.

docs/docs.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
},
2626
{
2727
"group": "Architecture",
28-
"pages": ["architecture/scope-keys"]
28+
"pages": [
29+
"architecture/context-inheritance"
30+
]
2931
},
3032
{
3133
"tab": "Documentation",

0 commit comments

Comments
 (0)