bespex

Tutorial

Files, references and comments

Purpose: You find your way around the files of your project, see who changed what, and with references and @ai comments tell the AI exactly which file and which place you mean.

While your session works, it changes files in your project. The Files column shows you your whole project as a tree, and on every file what is going on with it. From here you also tell the AI which file you mean: with a reference that you paste into the chat, or with an @ai comment directly in the file.

The file tree

The tree shows all files and folders of your project, not just those the AI has touched. A click on a folder unfolds it. With the two buttons on the right of the toolbar you unfold or fold everything.

The Files column: at the top the toolbar with "New file…", "New folder…", the branch "feature/rate-limit" and the buttons for unfolding and folding, below it the group "Pinned" with docs and rate_limit.rs, then the tree with CLAUDE.md, README.md, TODO.md and ROADMAP.md at the top and the folders src, tests, fixtures and docs; on the right of the rows the signs of the sessions, @ai counters, flags, git letters and circles

At the very top of the tree are the guide files of your project, each with a sign of its own: the instructions for the coding agent (such as CLAUDE.md or AGENTS.md), the description (README.md), the tasks (TODO.md) and the roadmap (ROADMAP.md). These files decide how the AI works in your project and what’s next, so you always find them in the same place.

On the right of every row are signs that tell you what is going on with the file:

  • A letter at the right edge shows the git state: M for modified, A for new, D for deleted and R for renamed. The Git basics explain exactly what that means.
  • The signs of the sessions show which AI sessions have changed the file since the last commit. On a folder you see all sessions that changed something in it.
  • The circle shows whether you have already viewed the change. An empty circle means: not yet. A click on the circle sets or clears the tick.
  • @ai 1/3 counts the @ai comments in the file: one is still open, three is the total since the commit. More on this further down.
  • The flag means Look at this: CodeDeck has found something in the change that you should look at, for example a forgotten test output. That is the subject of the next chapter.
  • A branch sign with a name shows another git repository in your project, for example a folder docs with a branch of its own.

Files you need again and again you pin. They then stand in the group Pinned above the tree. A click on one shows the file in the tree. Files that don’t interest you, on the other hand, you can hide. You find both in a file’s menu.

Finding files

At the bottom of the column is the search field Search the project. As soon as you type something, the column shows a flat list of all matching files in the whole project instead of the tree, including those in folders that are folded right now.

The funnel on the right of the search field opens the filters. With them you show, for example, only files a particular session has changed, or only those with open @ai comments.

The open filters above the search field: under "What" changed, new, deleted and not viewed yet, under "By" the two sessions and "without a session", under "Marked" @ai open, look at this, pinned and guide files, under "Also" ignored by git and hidden

  • What filters by the kind of change: changed, new, deleted or not viewed yet.
  • By shows only what a particular session changed, or only changes without a session, that is, your own.
  • Marked shows files with open @ai comments, with Look at this, pinned files or the guide files.
  • Also adds files that are otherwise missing: those git ignores, for example build results, and those you have hidden.

If you choose several filters in one row, one of them is enough. Filters from different rows must all match. The chosen filters stand as small chips above the search field; a click on one removes it again.

The file card

When you select a file with a click, its file card appears below the tree. It sums up what you need to know about the file.

The file card of rate_limit.rs: at the top name, path and language, buttons for viewing and editing, "Diff in Dirq" and "Reference with comments", below them "Since the commit" with two sessions, "Viewed: not yet", "Look at this: New TODO, line 2", "@ai: 1 open @ai comment, 2 done since the commit" and the history with the sessions' turns and the latest commits

  • Since the commit names the sessions that changed the file, with the number of lines.
  • Viewed shows whether you have already viewed the change.
  • Look at this names what CodeDeck noticed in the change.
  • @ai counts the open and the done @ai comments.
  • History shows the turns in which a session changed the file, with its prompt, and below them the latest commits. When you point at a turn, you can bring the file back to its state before this turn with Put it back. The current state is kept in the process, so you can go back again.

Diff in Dirq opens the changes to the file in Dirq, a program that shows differences clearly side by side. The Preview tab at the top shows pictures and other files right in the file card. Without a selected file, the file card shows an Overview of the whole project.

A file’s menu

A right click on a file opens its menu. There you find everything you can do with the file.

The menu of src/middleware/rate_limit.rs: View (double click), Edit (middle click), View with…, Edit with…, Show the change, Path, Copy reference for the AI, Copy reference with comments, Second opinion…, Pass on to…, Rename…, Move to trash, Unpin and Hide

  • View opens the file in the program you read such files with, Edit in your editor. You get the same with a double click and with the middle mouse button. Under View with… and Edit with… you choose another program.
  • Show the change jumps to this file in the Changes tab.
  • Path copies the path of the file within the project or the full path, and opens its folder in the file manager or in a terminal.
  • Copy reference for the AI and Copy reference with comments are explained in the next section.
  • Second opinion… has another AI check the file, and Pass on to… starts a new session that works with this file as its task. Chapter 7 describes both.
  • Rename…, Move to trash, Pin or Unpin and Hide manage the file itself. Whatever ends up in the trash you can get back from there.

With Ctrl or Shift you select several files and do something with all of them at once. You can also get through the tree with the keyboard: the arrow keys move the selection, Enter opens the file for viewing, Ctrl+Enter for editing, the space bar pins or unpins, and the context menu key opens the menu.

You create new files and folders with the two buttons on the left of the toolbar. You move files by dragging them with the mouse into another folder.

Telling the AI which file you mean

CodeDeck sends nothing to the AI on its own. If you want a session to look at a particular file, you tell it in the chat. So that you don’t have to type out paths, there is the reference.

Copy reference for the AI puts the path of the file on the clipboard, the way the AI needs it. You paste it into your prompt, for example “Look at src/middleware/rate_limit.rs and …”. This also works with folders and with several selected files at once. References don’t exist only for files: you find the same entry in a session’s menu and on the tasks in the plan.

@ai comments

Sometimes it isn’t about a whole file but about a particular place. Then you write an @ai comment directly at that place in the file. An @ai comment is an ordinary comment in the language of the file that begins with @ai, for example in Rust:

// @ai Please also cover the case without a client ID here.

In Markdown and HTML you write it as an HTML comment, that is <!-- @ai … -->. Every session that CodeDeck started or that is connected to CodeDeck knows this rule: an @ai comment is an instruction at exactly this place. Once the AI has done what it asks for, it deletes it.

You write an @ai comment in your editor, from a diff in the Changes tab (see the next chapter) or in Dirq. CodeDeck finds it in any case and counts it on the file, on its folder and on the session. A comment counts as done when the AI has deleted it. In Markdown editors such as Marq you can also tick a comment off; it then becomes @ai#erledigt. The count always runs since the last commit: @ai 1/3 means that of three comments since the commit, one is still open.

So that the session actually works through the comments, you tell it to. That is what Copy reference with comments is for: this reference names the file, every open @ai comment with its line, and the task to work through them. You paste it into the chat, and the session knows exactly what to do.

Git from here

In the middle of the toolbar is the branch you are working on. A click on it or Ctrl+G opens the git actions: Fetch, Pull, Commit with a field for the commit message, and Push. Each action explains in one sentence what it would do right now. If your project has no remote yet, CodeDeck offers to add one here.

The git actions below the branch "feature/rate-limit": Fetch, Pull (locked right now), below them "5 uncommitted changes: 3 modified, 2 new" with the field "Commit message" and the Commit button, below that "2 commits not pushed yet" with the Push button

The symbol next to the branch opens the log of git commands (Ctrl+Shift+G). It lists every git command CodeDeck has run, with its output. That way you can always see what CodeDeck has done in your repository. Commit and push are covered in more detail in the next chapter.

Try it out

Select a file your session has changed and read its file card. Open the filters with the funnel and show only what this session has changed. Then write an @ai comment into a file in your editor, for example “@ai Explain this function in a comment”. Copy the reference with comments from the file’s menu, paste it in the session’s chat and watch the counter on the file switch to done.

More on this