Compare commits

...

3 Commits

Author SHA1 Message Date
blink-so[bot] 7ce8738d8d chore: bump module versions (minor)
Co-authored-by: DevelopmentCats <176868952+DevelopmentCats@users.noreply.github.com>
2025-06-11 18:36:18 +00:00
blink-so[bot] f59ea6f0cf feat: add user memory support to claude-code module
- Add enable_user_memory variable to enable/disable user memory functionality
- Add user_memory_content variable for initial memory content
- Create ~/.claude/CLAUDE.md file for persistent user preferences
- Add comprehensive documentation with examples
- User memory persists outside workspace for cross-project preferences

Co-authored-by: DevelopmentCats <176868952+DevelopmentCats@users.noreply.github.com>
2025-06-11 18:35:32 +00:00
blink-so[bot] 6d1e99d6ae feat: add configurable Devolutions Gateway version for windows-rdp module (#148)
Co-authored-by: blink-so[bot] <211532188+blink-so[bot]@users.noreply.github.com>
Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
2025-06-11 23:14:30 +05:00
5 changed files with 102 additions and 9 deletions
+41 -3
View File
@@ -14,7 +14,7 @@ Run the [Claude Code](https://docs.anthropic.com/en/docs/agents-and-tools/claude
```tf
module "claude-code" {
source = "registry.coder.com/coder/claude-code/coder"
version = "1.3.1"
version = "1.4.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_claude_code = true
@@ -88,7 +88,7 @@ resource "coder_agent" "main" {
module "claude-code" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/claude-code/coder"
version = "1.3.1"
version = "1.4.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_claude_code = true
@@ -107,7 +107,7 @@ Run Claude Code as a standalone app in your workspace. This will install Claude
```tf
module "claude-code" {
source = "registry.coder.com/coder/claude-code/coder"
version = "1.3.1"
version = "1.4.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_claude_code = true
@@ -117,3 +117,41 @@ module "claude-code" {
icon = "https://registry.npmmirror.com/@lobehub/icons-static-png/1.24.0/files/dark/claude-color.png"
}
```
## Enable user memory
Claude Code supports [user memory](https://docs.anthropic.com/en/docs/claude-code/memory-management) that persists across all projects. This memory is stored in `~/.claude/CLAUDE.md` and contains personal preferences, coding standards, and instructions that apply to all your work.
```tf
module "claude-code" {
source = "registry.coder.com/coder/claude-code/coder"
version = "1.4.0"
agent_id = coder_agent.example.id
folder = "/home/coder"
install_claude_code = true
claude_code_version = "latest"
# Enable user memory
enable_user_memory = true
user_memory_content = <<-EOT
# My Claude Code Preferences
## Coding Style
- Always use descriptive variable names
- Prefer explicit over implicit code
- Add comments for complex logic
## Preferred Technologies
- Use TypeScript for JavaScript projects
- Prefer functional programming patterns
- Use modern ES6+ syntax
## Testing
- Write unit tests for all functions
- Use descriptive test names
- Aim for high test coverage
EOT
}
```
The `user_memory_content` is only used to create the initial `~/.claude/CLAUDE.md` file if it doesn't already exist. Once created, you can edit this file directly to update your preferences, and they will persist across workspace rebuilds since the file lives in the user's home directory outside the workspace.
@@ -84,9 +84,22 @@ variable "experiment_post_install_script" {
default = null
}
variable "enable_user_memory" {
type = bool
description = "Whether to enable user memory for Claude Code. This creates ~/.claude/CLAUDE.md for persistent user preferences."
default = false
}
variable "user_memory_content" {
type = string
description = "Initial content for the user memory file (~/.claude/CLAUDE.md). Only used if the file doesn't already exist."
default = null
}
locals {
encoded_pre_install_script = var.experiment_pre_install_script != null ? base64encode(var.experiment_pre_install_script) : ""
encoded_post_install_script = var.experiment_post_install_script != null ? base64encode(var.experiment_post_install_script) : ""
encoded_user_memory_content = var.user_memory_content != null ? base64encode(var.user_memory_content) : ""
}
# Install and Initialize Claude Code
@@ -113,6 +126,28 @@ resource "coder_script" "claude_code" {
echo "Folder created successfully."
fi
# Set up user memory if enabled
if [ "${var.enable_user_memory}" = "true" ]; then
echo "Setting up Claude Code user memory..."
# Create the .claude directory if it doesn't exist
if [ ! -d "$HOME/.claude" ]; then
echo "Creating ~/.claude directory..."
mkdir -p "$HOME/.claude"
fi
# Create the user memory file if it doesn't exist and content is provided
if [ ! -f "$HOME/.claude/CLAUDE.md" ] && [ -n "${local.encoded_user_memory_content}" ]; then
echo "Creating user memory file ~/.claude/CLAUDE.md..."
echo "${local.encoded_user_memory_content}" | base64 -d > "$HOME/.claude/CLAUDE.md"
echo "User memory file created successfully."
elif [ -f "$HOME/.claude/CLAUDE.md" ]; then
echo "User memory file ~/.claude/CLAUDE.md already exists, skipping creation."
else
echo "User memory enabled but no initial content provided. You can manually create ~/.claude/CLAUDE.md later."
fi
fi
# Run pre-install script if provided
if [ -n "${local.encoded_pre_install_script}" ]; then
echo "Running pre-install script..."
+16 -3
View File
@@ -16,7 +16,7 @@ Enable Remote Desktop + a web based client on Windows workspaces, powered by [de
module "windows_rdp" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/windows-rdp/coder"
version = "1.1.0"
version = "1.2.0"
agent_id = resource.coder_agent.main.id
resource_id = resource.aws_instance.dev.id
}
@@ -34,7 +34,7 @@ module "windows_rdp" {
module "windows_rdp" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/windows-rdp/coder"
version = "1.1.0"
version = "1.2.0"
agent_id = resource.coder_agent.main.id
resource_id = resource.aws_instance.dev.id
}
@@ -46,12 +46,25 @@ module "windows_rdp" {
module "windows_rdp" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/windows-rdp/coder"
version = "1.1.0"
version = "1.2.0"
agent_id = resource.coder_agent.main.id
resource_id = resource.google_compute_instance.dev[0].id
}
```
### With Custom Devolutions Gateway Version
```tf
module "windows_rdp" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/windows-rdp/coder"
version = "1.2.0"
agent_id = resource.coder_agent.main.id
resource_id = resource.aws_instance.dev.id
devolutions_gateway_version = "2025.1.6" # Specify a specific version
}
```
## Roadmap
- [ ] Test on Microsoft Azure.
+9 -2
View File
@@ -51,14 +51,21 @@ variable "admin_password" {
sensitive = true
}
variable "devolutions_gateway_version" {
type = string
default = "2025.2.1"
description = "Version of Devolutions Gateway to install. Defaults to the latest available version."
}
resource "coder_script" "windows-rdp" {
agent_id = var.agent_id
display_name = "windows-rdp"
icon = "/icon/desktop.svg"
script = templatefile("${path.module}/powershell-installation-script.tftpl", {
admin_username = var.admin_username
admin_password = var.admin_password
admin_username = var.admin_username
admin_password = var.admin_password
devolutions_gateway_version = var.devolutions_gateway_version
# Wanted to have this be in the powershell template file, but Terraform
# doesn't allow recursive calls to the templatefile function. Have to feed
@@ -21,7 +21,7 @@ function Configure-RDP {
function Install-DevolutionsGateway {
# Define the module name and version
$moduleName = "DevolutionsGateway"
$moduleVersion = "2024.1.5"
$moduleVersion = "${devolutions_gateway_version}"
# Install the module with the specified version for all users
# This requires administrator privileges