Skip to content

Basic Usage

This guide introduces common use cases for Carry Code to help you get started quickly.


When you need to complete a programming task, just tell AI what you want.

Write a script to batch rename files, replacing spaces with underscores

AI will:

  1. Analyze your requirements
  2. Write complete code
  3. Explain how the code works
  4. Ask if you want to execute
RequirementConversation
Write an APIWrite a simple REST API with Express.js, including user registration and login
Write a scraperWrite a Python script to crawl images from a webpage and save them locally
Write a utility scriptWrite a Shell script to batch compress all PDF files in the current directory

When you encounter errors, send the code and error message to AI.

This code has an error, help me find the problem:
def calculate(a, b):
return a / b
print(calculate(10, 0))

AI will:

  1. Analyze the error (division by zero)
  2. Provide a fix
  3. Explain the changes
My code has an error. The error message is:
[paste error message]
The code is:
[paste code]
Please help me find and fix the problem.

Don’t understand some code? Just send it to AI for explanation.

Explain what this code does:
const result = arr.filter(x => x > 0).map(x => x * 2).reduce((a, b) => a + b, 0);

AI will:

  1. Explain the code logic line by line
  2. Provide execution flow diagrams if helpful
  3. Offer simplified versions if available
ScenarioConversation
Understand open sourceHelp me analyze the main structure of this project
Learn new syntaxWhat’s the difference between TypeScript’s type and interface?
Understand algorithmsExplain how this sorting algorithm works

Code works but is messy? Let AI help you optimize.

This code works but feels messy, can you help me optimize it?
[paste your code]

AI will:

  1. Analyze code issues
  2. Provide an optimized version
  3. Explain what improvements were made
RequirementConversation
Improve performanceThis code is too slow, help me optimize
Improve readabilityThis code is hard to understand, please refactor for clarity
Add error handlingHelp me add error handling to this function

Don’t want to write tests manually? Let AI help.

Write unit tests for this function:
function sum(a, b) {
return a + b;
}

AI will generate complete test cases including normal and edge cases.

Write Jest tests for this function, covering:
1. Normal addition
2. Negative numbers
3. Decimal numbers
[paste function code]

Need documentation for your project? Let AI generate it.

Write a README.md for this project

AI will analyze the project structure and generate a README with:

  • Project description
  • Installation instructions
  • Usage instructions
  • API documentation (if applicable)
Add JSDoc comments to this function:
function calculate(a, b) {
return a + b;
}

Want to understand an unfamiliar project? Let AI analyze it.

Analyze the structure of this project

AI will:

  1. List the project directory structure
  2. Explain main files and their purposes
  3. Describe the tech stack
RequirementConversation
Analyze dependenciesWhat dependencies does this project use?
Find codeWhere is the user login code?
Analyze architectureHow is this project organized?

Carry Code can help you execute terminal commands.

Run `npm install` to install dependencies

Or:

List files in the current directory
  • AI will ask for confirmation before executing
  • Dangerous commands (like deleting files) require extra confirmation
  • You can adjust permission levels using the /approval command

ShortcutAction
EnterSend message
Shift + EnterNew line (multi-line input)
Shift + TabSwitch Build/Plan mode
/ Browse message history
Ctrl + CInterrupt AI response
Ctrl + DExit the program