← Back to Articles

Operations Guide

Common Codex OperationsEditing, Screenshot Clarification, and Restoring Backups

Published Last updated

Got your first page working, but worried one tiny tweak might break the buttons? Continuing with codex-portfolio, learn how to guide edits with screenshots, hit Stop safely, report bugs clearly, and hand off to a fresh chat.

Codex
Official product screenshot from an earlier version; layout and model labels may differ. Not this exercise's result.

Section 1: The Maintenance Mindset

How to Update a Working Page Without Breaking Everything

The trickiest part isn't generating v1—it's making small tweaks afterward without accidentally breaking buttons that already worked. These three habits keep edits calm and predictable.

01

Change one thing per turn

Split big wishes into single moves: fix the title first, adjust spacing next. Each edit takes seconds to verify, and any slip is obvious right away.

02

Inspect the current file before ordering edits

Never prompt purely from memory. Ask Codex to summarize the existing index.html first so both of you start from the same baseline.

03

Duplicate your folder before major tweaks

Before big layout or styling shifts, make a quick copy of your folder on the side so rolling back takes two clicks.

Section 2: The Safe Opening Routine

Check Path, Scan Files, and Confirm Before Editing

Spend 15 seconds on these three checks whenever you reopen Codex—it prevents 90% of 'Wait, why did it edit the wrong file?' surprises.

  1. 1. Confirm codex-portfolio is mounted

    Look at the workspace header in Codex and verify it reads codex-portfolio—not your home directory, Desktop, or backup copy.

  2. 2. Spot index.html in the file list

    Check that index.html sits cleanly in the sidebar, and make sure any duplicate backups live outside this working folder.

  3. 3. Ask for a quick baseline summary first

    Don't lead with a rewrite. Ask: "Inspect the current index.html and briefly summarize its main heading, four filter categories, and modal behavior." Send edits once it answers accurately.

Checking the mounted directory ensures edits never land in Downloads or an old backup folder.

Section 3: Preserving Working Structure

Swap the Heading to 'My Work' Without Touching Buttons or Dialogs

Let's practice one surgical edit: rename the top title to 'My Work' while locking filter counts, modal popups, and Escape behavior untouched.

Name exact before/after text

Telling Codex to replace only the heading text with 'My Work' prevents unrequested rewording or restyling elsewhere.

Re-state untouchable behaviors

Spelling out filter counts and modal behavior in the same prompt draws a clear line around code that already passes checks.

Copyable Prompt Template
Edit the existing index.html to make a single targeted adjustment:
1. Change the main top heading text from its current value to "My Work".
2. Keep all four filter buttons ("All", "Photography", "Design", "Web"), card counts, and live filtering logic completely unchanged.
3. Keep all four showcase cards, their modal dialog descriptions, and keyboard Escape dismissal working exactly as they do now.
Update the file directly and briefly report which line was modified.

Verification Checklist

  • Refresh your browser and verify the main title now reads 'My Work'
  • Click 'All' and confirm all 4 cards still appear
  • Click 'Design' and confirm exactly 2 cards appear
  • Open any card dialog and check close + Escape still work

Pairing exact replacement wording with explicit 'do not touch' boundaries keeps working logic safe.

Section 4: Visual Guidance

Stop Describing Spacing in Words—Drop a Screenshot Instead

When buttons look cramped or misaligned, dragging a screenshot straight into chat communicates faster and clearer than two paragraphs of spatial directions.

Paste or drag screenshots straight into the composer

Snap your browser area with your OS screenshot tool, then paste it or hold Shift while dragging the image file into the composer until a thumbnail appears.

Always pair the image with a clear pointer

Never send a silent screenshot. Add one line such as 'Check the top button row spacing in this screenshot' so the assistant maps visuals to exact CSS rules.

Crop out sensitive screen edges

Frame only the webpage itself—cropping out bookmarks, URLs, and system bars keeps private details off chat and cuts visual clutter.

Copyable Prompt Template
(Attach a screenshot of your narrow mobile viewport to the conversation before sending this prompt.)
I have attached a screenshot of the portfolio on a narrow viewport. Please review the category button row near the top:
1. The button spacing appears cramped on narrow screens. Adjust the button margin and padding in index.html to improve tap spacing.
2. Keep existing button labels, styling, and filter logic unchanged.
Update the file directly.

Verification Checklist

  • Confirm no private paths, bookmarks, or account details appear in the screenshot
  • Pair the image with text naming the exact area to adjust
  • Resize the browser window narrow afterward and verify comfortable button spacing

Check edges before attaching: crop out private bookmarks, open tabs, or personal usernames.

Section 5: Steering and Pausing

Spotted Codex Drifting Off Track? Hit Stop—Then Check Your File

If you watch progress fly by and suddenly notice it installing packages or spawning extra files, don't wait for the turn to finish—click Stop right away.

Nudge minor tweaks in the same chat

If the first pass is close, keep going in the same thread: 'Spacing looks good—now round the button corners slightly more.'

Hit Stop immediately if scope drifts

The moment you see unexpected npm installs or extra stylesheets violating your single-file rule, click Stop or Cancel beside the composer.

Inspect index.html right after stopping

Never assume Stop leaves your file pristine. Open index.html or refresh your browser to inspect what was written—and use your backup copy if it stopped mid-edit.

Don't try to override an active tool run by typing faster

Typing another prompt mid-command won't always interrupt an active step instantly. Click Stop first, wait for things to settle, then inspect.

Crucial fact: clicking Stop halts future steps; it does NOT automatically roll back lines already written to your disk.

Section 6: Fixing Broken Filters

Don't Just Say 'It's Broken'—Share Steps + Expected vs. Actual

When a filter button fails to respond or counts do not match, listing reproducible steps alongside expected and observed behavior clarifies the underlying issue.

Write down exact reproduction steps

'Buttons are broken' forces guesswork. 'Opened index.html, clicked Design, expected 2 cards and all 4 vanished' points straight to the broken filter handler.

Put Expected right next to Actual

Debugging closes the gap between what should happen and what did—putting both lines side by side exposes logic bugs fast.

Ask for the narrowest possible fix

Adding 'apply a targeted fix' stops the assistant from rewriting the entire HTML file just to repair one filter condition.

Copyable Prompt Template
I noticed an issue with the category filtering logic in index.html. Please help diagnose and fix it:
1. Steps to reproduce:
   - Open index.html in my web browser.
   - Click the "Design" button at the top.
2. Expected behavior: 2 cards categorized under Design remain visible.
3. Actual behavior: [Fill in your observed result].
4. Console or system errors: [Paste original error if present; otherwise state no error observed].

Review the JavaScript filtering logic, apply a targeted fix, and verify that All, Photography, Design, and Web filtering work as intended.

Verification Checklist

  • Repeat the click steps yourself to confirm the bug happens consistently
  • Fill in what you actually saw inside the Actual behavior brackets
  • After the fix, test all four filter buttons (All, Photography, Design, Web)

No technical jargon needed—plain observations give the cleanest clues.

Section 7: Recovery Strategies

How to Roll Back Safely Without Losing Recent Tweaks

When an edit goes sideways, follow a calm order before overwriting files so you don't accidentally erase parts you liked.

Duplicate the current broken folder before restoring

Before copying your older backup back in, save a copy of the current folder first in case you wrote copy worth rescuing. Stop any active run, then copy the good index.html back over.

Navigating the Git review pane

When Git is configured, the review pane displays differences. You can toggle between "Last turn" to view changes from the most recent assistant turn, or inspect all working repository diffs combined.

Know that Revert clears the whole selected scope

Clicking Revert wipes every modification in the selected file or chunk—including any manual edits inside that range. Back up first.

Never count on AI to reconstruct unbacked files

If an unbacked file outside version control is overwritten, deleted content may be gone for good. Keep duplicating folders before big moves.

Skip destructive terminal reset commands—your manual folder copy is the safest fallback.

Section 8: Starting a Clean Chat

Long Thread Getting Forgetful? Start Fresh with a Handoff Note

After 20 rounds of revisions—or when switching to a brand-new task—chats start getting muddy. Open a fresh thread on the same folder and paste this quick handoff note.

Tell the new session to read first, edit later

Asking it to summarize index.html before touching anything forces it to inspect live local code instead of guessing.

List verified features plus one next goal

Clearly separating what already passed testing from the single change you want next gives the fresh chat clean rails.

Copyable Prompt Template
(Update completed and pending items to reflect what actually works before sending; do not assume unverified items have passed.)
Hello, we are working on index.html inside the codex-portfolio folder.
Please inspect the existing file before making any edits.

Current project status:
1. Goal: A single-file personal portfolio showcase with category filtering and modal dialogs.
2. Verified completed features:
   - [List features that have been tested and work, e.g., heading "My Work", category filters, and modal dialogs].
3. Next planned task:
   - [Insert one concrete change here, such as adding a footer note].

Please summarize your understanding of the current file structure first, and wait for confirmation before editing.

Verification Checklist

  • Confirm the new chat still points to your codex-portfolio folder
  • Replace sample items with what actually works on your machine
  • Verify the first reply summarizes structure only without editing files yet

A new thread does not automatically remember earlier conversations; spelling out what works and what comes next keeps it accurate.

Operations Reference

Desktop Workspace Shortcuts

Once the workflow feels natural, use a handful of shortcuts to open panels faster.

ActionmacOSWindows / Linux
New chatCmdNCtrlN
Open folderCmdOCtrlO
Find text in current chatCmdFCtrlF
View keyboard shortcutsCmd/Ctrl/
Command menuCmdShiftPCtrlShiftP
SettingsCmd,Ctrl,
Search files in CodexCmdPCtrlP
Show / hide file tree in CodexCmdShiftECtrlShiftE
Show / hide terminal in CodexCtrl`Ctrl`
Model pickerCtrlShiftMCtrlShiftM

Note: On macOS, Cmd is Command and Ctrl is Control (note Terminal and Model Picker use Ctrl on Mac too). New chats do not undo file edits, and Find searches the active chat only. Sidebar bindings vary slightly across versions—press Cmd+/ (or Ctrl+/) to inspect live shortcuts or customize them in Settings > Keyboard Shortcuts.

Steady Edits Beat Fast Rewrites

Inspect first, guard what already works, and keep a folder backup before big changes—every future tweak gets dramatically smoother.

Section 9: Daily Operations Clarifications

Spinner Hangs, Usage Quotas, and Knowing When to Start Fresh

Quick solutions for the three hiccups people run into during everyday maintenance.

Why does the spinner keep spinning without changing files?

Often an approval prompt is waiting quietly for confirmation. Check for any pending dialog first; if it stays stuck and you hit Stop, inspect index.html afterward because partial edits may already be saved.

How do plan usage limits and quotas actually work?

Codex shares allowances with ChatGPT Work, separate from pay-as-you-go API billing. Caps and reset windows vary by subscription rather than following a single fixed count—check your account usage panel for live remaining quota and reset time.

When should I just open a fresh chat?

Open a new thread when an old one starts forgetting rules or repeating errors, or when you pivot to a completely unrelated feature. Keep the same folder attached and paste your quick handoff note.

Knowing how approval prompts and plan usage behave eliminates most guesswork.

← Back to Articles

Privacy settings

You can allow traffic measurement and masked interaction replays on selected pages. Choose either one in settings.

Essential features

Remember your choice, display preferences and protect the contact form. Always available.

Reducing permissions reloads this page to stop loaded trackers. Save any unfinished form first. Your choice is remembered for up to 180 days.