wcgw logo

wcgw

by rusiaaman

wcgw empowers chat applications like Claude and ChatGPT to code, build, and run on your local machine. It provides tightly integrated shell and code editing tools, allowing AI to interact with your system via a relay server.

View on GitHub

Last updated: N/A

What is wcgw?

wcgw is a tool that enables AI models like Claude and ChatGPT to interact with your local machine's shell and file system. It acts as a server (MCP server for Claude, relay server for ChatGPT) that provides the AI with the ability to execute commands, read and write files, and manage projects, all within a controlled and secure environment.

How to use wcgw?

For Claude, configure the claude_desktop_config.json file with the provided JSON snippet, ensuring that uv is installed and accessible. Restart the Claude app and verify the MCP icon is visible. For ChatGPT, follow the instructions in openai.md. Once set up, you can instruct the AI to perform tasks such as running code, editing files, or managing projects using natural language commands.

Key features of wcgw

  • Create, Execute, Iterate: Allows AI to iteratively run commands and fix errors.

  • Large file edit: Supports large file incremental edits.

  • Syntax checking on edits: Reports feedback to the LLM if its edits have any syntax errors.

  • Interactive Command Handling: Supports interactive commands using arrow keys, interrupt, and ansi escape sequences.

  • File protections: Implements several file protection mechanisms to prevent accidental overwrites and data loss.

  • Shell optimizations: Optimizes shell interaction for better performance and stability.

  • Saving repo context in a single file: Allows saving project context for later resumption or knowledge transfer.

  • Easily switch between various modes: Offers different modes (architect, code-writer, wcgw) with varying levels of access and restrictions.

Use cases of wcgw

  • Solve programming problems by creating, running, and fixing test cases.

  • Find instances of code with specific behavior in a repository.

  • Clone, understand, set up, and build a project from a Git repository.

  • Create and deploy web applications using various technologies.

  • Edit or update large files efficiently.

  • Automate tasks such as creating pull requests or fixing code issues.

  • Troubleshoot and fix failing commands in specific directories.

  • Create repo wide unittest cases.

FAQ from wcgw

How do I set up wcgw for Claude?

Install uv using homebrew (brew install uv). Then, create or update claude_desktop_config.json with the provided JSON configuration, ensuring the correct path to uv. Restart the Claude app.

How do I set up wcgw for ChatGPT?

Refer to the openai.md file in the repository for detailed instructions on setting up wcgw with ChatGPT.

What are the different modes available in wcgw?

wcgw offers three modes: 'architect' (read-only), 'code-writer' (limited file access and command execution), and 'wcgw' (full access). You can instruct Claude to run in a specific mode using natural language prompts.

How can I save and resume a task using wcgw?

Use the 'ContextSave' tool to save the task description and relevant files. An ID will be generated. In a new chat, say 'Resume <task id>' to load the saved context.

How can I attach to the working terminal that the AI uses?

If you have screen installed, wcgw runs on a screen instance automatically. Use screen -ls to list the screen sessions and screen -x <session_name> to attach to the wcgw session.