
Replit Ghostwriter is Replit's integrated AI coding assistant. It lives inside the Replit browser IDE and provides AI completions, chat assistance, code explanation, and bug fixing — all without leaving your browser or setting up a local development environment.
This tutorial covers how Ghostwriter works, how to get the most out of it, and how it fits into a real development workflow.
Ghostwriter is the AI layer built into Replit's IDE. It's distinct from Replit AI Agent — Ghostwriter assists you as you write code, while Agent takes autonomous actions. Think of Ghostwriter as your AI pair programmer and Agent as an autonomous developer you can delegate tasks to.
Ghostwriter includes:
Ghostwriter is available on Replit's paid plans. Once you're in a Repl, you'll see the Ghostwriter panel in the right sidebar. Enable completions from the settings if they're not already on.
If you're new to Replit itself, see what is Replit for an introduction to the platform.
As you type, Ghostwriter suggests completions in greyed-out text. Press Tab to accept. The suggestions are context-aware — Ghostwriter reads your open file and understands what you're building.
Tips for better completions:
// Fetch users from the database, filter by active status, sort by created date
async function getActiveUsers() {
// Ghostwriter will suggest the implementation here
Press the chat icon or use the keyboard shortcut to open the chat panel. You can ask questions about your code, request changes, or get explanations.
Example prompts:
Ghostwriter can see the code in your open file, so responses are relevant to what you're actually working on.
Select any block of code, right-click, and choose "Explain Code" (or use the shortcut). Ghostwriter gives you a plain-English breakdown of what the code does, step by step.
This is particularly valuable when:
Select code and use the Transform feature to describe a change:
Ghostwriter rewrites the selected block. Review the change before accepting — like any AI output, it can introduce errors, especially on complex transformations.
Use Generate when you want Ghostwriter to write something from scratch based on a description:
Generate a middleware function for Express that:
- Reads a Bearer token from the Authorization header
- Validates it against the ADMIN_TOKEN environment variable
- Returns 401 if missing or invalid
- Passes to next() if valid
The more detail you include in the description, the closer the generated code will be to what you actually need.
Ghostwriter supports all the languages available on Replit — JavaScript, TypeScript, Python, Go, Ruby, PHP, Java, C++, and many more. The quality of suggestions varies by language (JavaScript and Python get the most training data), but it's useful across all of them.
Use Ghostwriter when you want to write code yourself with AI assistance — completions, targeted refactoring, quick answers.
Use Replit Agent when you want to describe a complete feature or app and let AI build it autonomously.
Most productive Replit workflows use both — Agent for scaffolding and building, Ghostwriter for day-to-day coding and fixes.
Once your project is ready, Replit's one-click deployment gets it live quickly. See our Replit AI deployment guide for what to do after you deploy.
Your deployed app needs monitoring. Domain Monitor checks your Replit app every minute and alerts you if it goes down. Our guide to monitoring your published Replit app walks through the setup.
Generative AI creates new content — text, images, code, and more. This guide explains how it works, what tools are available, and where it's genuinely useful versus overhyped.
Read moreCursor AI is an AI-powered code editor built on VS Code. Learn what it does, how it works, and whether it's the right tool for your development workflow.
Read moreClaude Opus is Anthropic's most capable AI model, built for complex reasoning and demanding tasks. Learn what it does, how it compares, and when to use it.
Read moreLooking to monitor your website and domains? Join our platform and start today.